PDA

View Full Version : How to integrate vbulletin into phpMVC framework?


SeV3n
06-20-2008, 07:57 AM
Hi, I would like to integrate some vbulletin features into a website based upon a php framework. I've already managed to do it with a simple website but now I would like to reach the same goal with an OOP and MVC structure.

I'm trying to create a main class (to be extended by the controllers) to initialize the vbulletin registry object in order to integrate vbulletin login and to use the bb code parser class.
Here is the issue: including the global.php inside the class constructor I got a fatal error on a method that use the $vbulletin object.
Call to a member function query_write() on a non-object in forum/includes/functions.php on line 5226.
The $vbulletin object seems not to be correctly initialized since I checked the content of the object with vardump. It sounds like a scoping problem but I'm quite new to OOP php programming and I would like to know if anybody already tried this way.

Thanks in advance.

Dismounted
06-20-2008, 10:04 AM
You probably need to include global.php outside the class, as any variables (such as $vbulletin) initialised inside the class will be in the local scope - not what you want.

SeV3n
06-20-2008, 04:20 PM
:\ No other way then?

Dismounted
06-21-2008, 03:36 AM
Not really, no.

SeV3n
07-15-2008, 08:59 AM
Well the thing works fine into a stand alone class but I get the same error (Call to a member function query_write() on a non-object) whenever I try to use it inside a PHP framework (i tried CodeIgniter and Kohanaphp).