Lampwrights Forum

Lampwrights Forum (http://www.lampwrights.com/index.php)
-   vBulletin Wordpress Bridge (http://www.lampwrights.com/forumdisplay.php?f=13)
-   -   Error in Vbulletin 4.2 (http://www.lampwrights.com/showthread.php?t=347)

Spikedadragon 05-29-2012 03:53 AM

Error in Vbulletin 4.2
 
Hello,

I know you have stated that this is for 3.x and have no intent on working with vb4.x, however it was working fine up to 4.1.12. :)

Just curious if you can help out and figure out why the error :
Fatal error: Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30

Is now appearing when going to the wordpress site, following upgrade to Vbulletin 4.2.0 ?

They may have changed something I suppose which makes the wordpress bridge no longer work.

This is line 29-38 on vb.php
Code:

*/
abstract class vB
{
    /*Properties====================================================================*/

    /**
    * Whether the framework has been initialized.
    *
    * @var bool
    */
    private static $initialized;

Also at the top of the file is this single line. I don't recall it before but never looked either.

<?php if (!defined('VB_ENTRY')) die('Access denied.');


Thanks!
D

Jeff 05-29-2012 04:20 AM

You could try adding this to your wp-config.php file:

PHP Code:

define('VB_ENTRY'true); 

I have no idea though, I am not running vb 4.x..

Spikedadragon 05-29-2012 04:29 AM

Man, I wish that was that easy... but nope :(

Trying to find out from VB what changed as well.

Jeff 05-29-2012 04:50 PM

Will need to see the error from your error log.

Spikedadragon 05-29-2012 06:08 PM

Quote:

Originally Posted by Jeff (Post 1163)
Will need to see the error from your error log.

Unfortunately this is all you gt in the error log.

Code:


[29-May-2012 11:59:31] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 13:41:30] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 17:03:03] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 18:00:22] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 18:12:39] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 18:35:53] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 19:06:00] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 19:55:25] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 20:43:10] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 20:51:25] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 20:58:56] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 21:23:58] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 22:07:15] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 22:07:16] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30 [29-May-2012 22:07:18] PHP Fatal error:  Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30


Jeff 05-29-2012 06:23 PM

Well, if 4.x has a class called VB, then yeah, that is going to cause issues because I named the class VB in the loader. You could try renaming my class and then editing every instance of:

PHP Code:

VB::instance()-> 

To:

PHP Code:

NEW_CLASSNAME::instance()-> 

And any instance of:

PHP Code:

new VB

To:

PHP Code:

new NEW_CLASSNAME

I guess I should rename this class in the next version, but just have no time for it now.

Spikedadragon 05-29-2012 06:28 PM

Interesting. Didn't think those conflicted.

I'll give it a try and let you know :)

Spikedadragon 05-29-2012 07:30 PM

Hey Jeff,

It's working!
Renamed all $VB class/instances/occurences to $WPVB4 which hopefully vbulletin's developers have no need to use hah.

Just to be sure though were there any other files to the plugin but vbloader.php and vbbridge.php ?

Jeff 05-29-2012 07:31 PM

That's it. :)

Spikedadragon 05-29-2012 07:33 PM

Quote:

Originally Posted by Jeff (Post 1168)
That's it. :)

Hah great, thank you!

Hopefully this thread helps others then as that's one update on vbulletin that they changed something that actually broke the plugin that's based for vb3 :D

Jeff 05-31-2012 07:09 AM

I will have to change this class name in the next version just to avoid headaches lol.. Once I get some free time, I will do that and package it up.

Spikedadragon 05-31-2012 07:18 AM

Quote:

Originally Posted by Jeff (Post 1170)
I will have to change this class name in the next version just to avoid headaches lol.. Once I get some free time, I will do that and package it up.

It'll probably be easier if you do so. There are after all a ton of instances in the two files. I thought I caught them all, then did a recursive find and found a few I missed but in the end, works great.

I can attach my vbbridge.php and vbloader.php files later if it helps.

ChaseH 06-01-2012 01:32 AM

Quote:

Originally Posted by Spikedadragon (Post 1171)
It'll probably be easier if you do so. There are after all a ton of instances in the two files. I thought I caught them all, then did a recursive find and found a few I missed but in the end, works great.

I can attach my vbbridge.php and vbloader.php files later if it helps.

If you could, that would be great. I *think* I have it working, but every now and then I get some errors. Thanks

Spikedadragon 06-01-2012 02:45 AM

1 Attachment(s)
Quote:

Originally Posted by ChaseH (Post 1172)
If you could, that would be great. I *think* I have it working, but every now and then I get some errors. Thanks

No problem. Attached as .zip. since php files arne't allowed to attach.
Keep in mind this isn't checked over by Jeff!
It's also not been widely used as the site I work with is currently 'renovating' the design so we haven't even fully opened the access outside the Admin and Moderator groups :)

Kwith 07-29-2012 10:42 PM

I'm getting a different error than what is on here. Now, I'm running VB 4.2 and WP 3.4.1 so this may very well be the issue but this is what its saying:

Warning: include_once(/home/thegc315/public_html/wordpresstest/wp-content/plugins/vbbridge/vbloader.php) [function.include-once]: failed to open stream: No such file or directory in /home/thegc315/public_html/wordpresstest/wp-content/plugins/vbbridge.php on line 47

Warning: include_once() [function.include]: Failed opening '/home/thegc315/public_html/wordpresstest/wp-content/plugins/vbbridge/vbloader.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/thegc315/public_html/wordpresstest/wp-content/plugins/vbbridge.php on line 47

Fatal error: Class 'WPVB4' not found in /home/thegc315/public_html/wordpresstest/wp-content/plugins/vbbridge.php on line 49

I tried using the posted files but it still says the same thing when I go to activate the plugin. Any ideas?

insulinclub 08-05-2012 05:44 AM

Quote:

Warning: Invalid argument supplied for foreach() in /var/ww/html/wordpress/wp-content/plugins/vbbridge/vbbridge.php on line 87

Warning: Cannot modify header information - headers already sent by (output started at /var/www/ml/wordpress/wp-content/plugins/vbbridge/vbbridge.php:87) in /var/www/ml/wordpress/wp-includes/pluggable.php on line 881
Can somebody help me ?

Jeff 08-05-2012 09:09 AM

This plugin does NOT work for vbulletin 4.

opersme 08-28-2012 12:37 PM

Spike,

May i know which version of Wordpress you are using on vBulletin 4.1.12 ?



Quote:

Originally Posted by Spikedadragon (Post 1160)
Hello,

I know you have stated that this is for 3.x and have no intent on working with vb4.x, however it was working fine up to 4.1.12. :)

Just curious if you can help out and figure out why the error :
Fatal error: Cannot redeclare class vB in /home/halkum1/public_html/vb/vb.php on line 30

Is now appearing when going to the wordpress site, following upgrade to Vbulletin 4.2.0 ?

They may have changed something I suppose which makes the wordpress bridge no longer work.

This is line 29-38 on vb.php
Code:

*/
abstract class vB
{
    /*Properties====================================================================*/

    /**
    * Whether the framework has been initialized.
    *
    * @var bool
    */
    private static $initialized;

Also at the top of the file is this single line. I don't recall it before but never looked either.

<?php if (!defined('VB_ENTRY')) die('Access denied.');


Thanks!
D



All times are GMT -4. The time now is 06:58 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2024, vBulletin Solutions, Inc.