I'm working on a custom page.
I followed this
tutorial and everything is working fine. I can also use the $vbulletin->db object on the custom page. But if I try to use it inside a function, it just throws
Fatal error: Call to a member function on a non-object in....
This is the code:
PHP Code:
[...]
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
[...]
// ######################## START MAIN SCRIPT ############################
$content[center] = do_something(3);
[...]
// ######################## FUNCTIONS ############################
function do_something($value) {
[...]
$result = $vbulletin->db->query_read($sql);
while ($array = $vbulletin->db->fetch_array($result))
{
[...]
}
return $output;
}