Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 01-02-2009, 02:22 AM
XFSIllusion XFSIllusion is offline
 
Join Date: Aug 2004
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Plugin Question

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.
Reply With Quote
  #2  
Old 01-02-2009, 03:09 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 01-02-2009, 03:48 AM
XFSIllusion XFSIllusion is offline
 
Join Date: Aug 2004
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 01-02-2009, 04:47 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Goto a thread, view the source, find where the QR is sending data to...
Reply With Quote
  #5  
Old 01-06-2009, 02:50 AM
XFSIllusion XFSIllusion is offline
 
Join Date: Aug 2004
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 01-06-2009, 03:04 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.)
Reply With Quote
  #7  
Old 01-06-2009, 03:57 AM
XFSIllusion XFSIllusion is offline
 
Join Date: Aug 2004
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 01-07-2009, 04:12 AM
Bellardia Bellardia is offline
 
Join Date: Jul 2007
Location: Hamilton, Ontario
Posts: 378
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by XFSIllusion View Post
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:03 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04589 seconds
  • Memory Usage 2,231KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete