Since it was related I figured I'd add this question to the same thread. I get this error alot and I haven't found a way around it....
Fatal error: Call to a member function query_read() on a non-object in /home/myaccount/public_html/forums/ascript.php(4142) : eval()'d code on line 2
At one point it locked me out of my forums and I had to disable plugins to get back in. The code that generates the errors is below.
PHP Code:
$tmp_uid=& $vbulletin->userinfo['userid'];
$result = $db->query_read("SELECT * FROM vb3_credit_user WHERE userid='$tmp_uid'");
$content=mysql_fetch_array($result);
$mygold = $content['gold'];
$mynewgold=$mygold + 10;
$db->query_write("UPDATE vb3_credit_user SET gold='$mynewgold', turns='$mynewturns' WHERE userid='$tmp_uid'");
I tried replacing the first line with this and it had no effect( i think thats where the problem is).
PHP Code:
$tmp_uid = fetch_userinfo($loggedin['userid']);
What I dont get is that this same code works in many other hooks, but not in a few specific ones...such as the login_ hooks and ibarcade_ hooks. Works find in the post bit hooks, reply, new thread. Could the Execution order have something to do with it? I'm stumped. Oh, to the previous poster, thanks for your help in the previous problem, it helped alot. I'm using these plugins to award credit for certain activities...such as playing a game or simply loging in. I got it to work for posting.