The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Accessing $db object from within a sidebar block
Hello,
I'm trying to create my first sidebar block using PHP. I'm hitting an issue where I can't access the $db object from within the code. I've tried both $db and $vbulletin->db here's a sample of my code: PHP Code:
Fatal error: Call to a member function query_read() on a non-object in /home/content/04/7100404/html/includes/block/html.php(95) : eval()'d code on line 5 Any ideas? |
#2
|
|||
|
|||
That code is called from inside a function, so you need to declare any globals you want to use. You want to add:
Code:
global $vbulletin; |
#3
|
|||
|
|||
That was it... I forgot one of the basics... Thanks kh99!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|