PDA

View Full Version : vbulletin object initialization


facingwest
09-03-2009, 05:49 PM
Ok here's the delima. I'm not that experienced with vbulletin but have been able to do some decent modifications. But what i'm trying to do now is initialize the vbulletin object outside of vbulletin. I've added vbulletin to my drupal installation. But now i'd like to initialize the vbulletin object actually in drupal so that i can utilize some functionality in vbulletin in drupal. Such as the signature editor and functions like that. Also this would help push the integration of the two even deeper.

I've tried including the global.php file with no success. I was getting errors since the path was incorrect. I've added a snipit of code to handle that,


$dir = getcwd();
chdir('/var/www/html/forums/');
require_once './global.php';
chdir($dir);


That took care of all the pathing issues when initializing the vbulletin object. However i now have errors regarding query_first_slave.


PHP Fatal error: Call to a member function query_first_slave() on a non-object in /u01/www/html/forums/includes/functions.php on line 1368



Which means that either the vbulletin object never got created or the db object never got created. Any ideas on how i can over come this?

Thanks

--------------- Added 1252009950 at 1252009950 ---------------

I've went through and it seems like the db object is the culprit. but i'm not sure why it's not initializing. Any help on this would be great.

Dismounted
09-04-2009, 05:09 AM
That error is most likely caused by initialising the core inside a function. You cannot do that (with the current incarnation of vBulletin).

facingwest
09-08-2009, 02:56 PM
Thanks, i believe you where correct. the file i was adding it to was indeed being included via a function. So changing that to a different file corrected the issue. You rock!

NLP-er
10-10-2009, 04:22 AM
Also great thanks from me :) I just had same issue - solved :D

Adrian Schneider
10-10-2009, 04:28 AM
Note - you can init vBulletin inside a function, but you need to set quite a few variables global in order for this to work. :) Not recommended... lol