The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Enabling plugin causes whitescreen
I have a small PHP program, http://www.netbuilders.org/showlinks.php, which acts as a link rotator.
I want to include it in my vBulletin templates, so I created a plugin called showlinks. I used global_start as the hook location and used this as my plugin PHP code: Code:
ob_start(); include('/usr/local/www/data/netbuilders.org/showlinks.php'); $nblinks = ob_get_contents(); ob_end_clean(); I have read these two documents and they are not providing me with any usable clues:
When the whitescreen behavior is occurring, this error message fills my Apache logs: "PHP Fatal error: Call to a member function query_read_slave() on a non-object in /usr/local/www/data/netbuilders.org/includes/functions.php on line 4819." The code around line 4819 is: Code:
$ismod_all = $vbulletin->db->query_read_slave(" SELECT forumid, moderatorid, permissions, permissions2 FROM " . TABLE_PREFIX . "moderator WHERE userid = $userid" . (!$issupermod ? ' AND forumid != -1' : '') ); |
#2
|
||||
|
||||
The error you're talking about means that you haven't created the $db object in $vbulletin. Because you have the member function defined, and you don't have the $db object, it means that global.php is terminating early (probably through an error).
The global_start hook that you chose is why it's terminating early. I believe that because you're fussing with ob_ stuff it's not having the desired result. Change your plugin code to be this: PHP Code:
|
#3
|
||||
|
||||
TigerC10:
Isn't that the opposite of what vBulletin.com recommends in the documentation and the forum?
Changed, tested, confirmed, fixed. Thanks man! |
#4
|
||||
|
||||
Eh, it's a matter of style preference. I prefer to avoid the ob_ stuff because the PHP api changes how that stuff is handled from time to time.
Glad I could help you trace your error, though. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|