View Full Version : Plugin Question
XFSIllusion
01-02-2009, 02:22 AM
I'm adding a small series of plugins to execute a query if the following actions are done.
New reply
quick reply
new thread
new private message(to anyone but self)
login that day
I need help identifying the hooks. I got it to work for the new reply(newreply_post_complete) and new thread(newthread_post_complete), but it wont work for the quick reply, i assume there must be a separate hook for that. I'm having a separate database entry made for each action that takes place(a type of points system type thing). I'm using vb 3.7.2. Thanks in advance.
Dismounted
01-02-2009, 03:09 AM
Look at the actions of those forms - and look at the file it is sending the data to. One you get to the right PHP file, the rest is easy.
XFSIllusion
01-02-2009, 03:48 AM
Yeah, its just so confusing the way its set up. for example, when viewing the index, i have no idea where the quick reply form is located or being called from.
Dismounted
01-02-2009, 04:47 AM
Goto a thread, view the source, find where the QR is sending data to...
XFSIllusion
01-06-2009, 02:50 AM
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.
$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).
$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.
Lynne
01-06-2009, 03:04 AM
Take a look at the code in the page near where the hook is located and see how they are dealing with userinfo. You are probably not making a valid call and need to see if that variable is available there or if it has a different name.
(And, it really is better to start your own thread rather than piggy-back on another. If you need more help, please do so.)
XFSIllusion
01-06-2009, 03:57 AM
I have no idea where the hook is located, i just happen to see it on the plugin list lol. But i'll try to find it.
Bellardia
01-07-2009, 04:12 AM
I have no idea where the hook is located, i just happen to see it on the plugin list lol. But i'll try to find it.
Open the php file of the page where the hook is.
Ex showthread_complete is in the showthread.php page.
Ctrl + F, type in the hook, you should find its location, look above it to find out what happens before the hook is called.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.