[eluser]Uplift[/eluser]
[quote author="CroNiX" date="1271646495"]Just a note, I couldn't get the vb datamanagers working from within CI, or at least the one I was trying which was the user datamanager. I kept getting "Call to a member function query_first_slave() on a non-object" errors and finally tracked it down to the fact that we were unsetting $GLOBALS['vbulletin']. The datamanagers internally call upon the global $vbulletin, so we can't unset it if we want to use datamangers, unless Im missing something. After commenting out this line I was able to use the user datamanager and change a persons usergroup with no errors. This hasn't yet shown to prove harmful to anything else that I've done, although it probably consumes more memory because you aren't destroying the global vbulletin object.
Has anybody done anything interesting with CI/VB integration? Any common issues? It would be nice if we could collaborate so everything is in one thread.
Thanks.[/quote]
I'm trying to use the above code
$query = $this->vbulletin->db->query_read("SELECT * FROM post WHERE postid = 1");
$post = $this->vbulletin->db->fetch_array($query);
print_r($post);
but get the error you mentioned above
Fatal error: Call to a member function query_read() on a non-object ...
i'm pretty sure this worked when i first tested it before i built my site
i can use stuff like getUsername(), hasSession() without issues.
any ideas?
[edit] i also get
A PHP Error was encountered
Severity: Notice
Message: Undefined property: vBulletin::$db
Filename: controllers/theme.php
Line Number: 22