Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2010, 03:06 PM
JPnyc JPnyc is offline
 
Join Date: May 2005
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default can't find the right hook

hi folks, I have a plug-in I wrote some time ago which, when hooked on register add member process, works fine. However registration is going to be taken away from me, the database is going to be written to directly, bypassing the vbulletin installation, entirely. I need to hook this someplace else prior to the posting process. I tried show thread start and complete, user online, all of which prevented the page from loading. I know the plug-in works so I assumed that it had to interfere with other functions that follow

What function or hook is connected to the loading of the page, particularly any page where posts could be entered? Thanks in advance.
Reply With Quote
  #2  
Old 01-13-2010, 03:10 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you go into debug mode (only suggested to do on your test site), then you will see a list on the bottom of the page of all the hooks called in the order they are rendered.

Add to your config.php file to go into debug mode:
PHP Code:
    $config['Misc']['debug'] = true
Reply With Quote
  #3  
Old 01-13-2010, 03:32 PM
JPnyc JPnyc is offline
 
Join Date: May 2005
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks, Lynne. Will that list be visible to all or just to admin? Thanks again.
Reply With Quote
  #4  
Old 01-13-2010, 03:33 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It will be visible to all which is why I said to do it on your test site.
Reply With Quote
  #5  
Old 01-13-2010, 03:59 PM
JPnyc JPnyc is offline
 
Join Date: May 2005
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was afraid of that. We don't actually have a test site, I'm using one of our internal forums, only visible to employees. At the moment my problem is trying to figure out why any hook I attached this plug-in on prevents the page load. I tried hooking it on editor toolbar start and end as well as show thread and I get a blank page. I even tried changing the execution order to 1000, so it would be sure to execute after everything else hooked on the same process. Puzzling...

--------------- Added [DATE]1263406044[/DATE] at [TIME]1263406044[/TIME] ---------------

here's the code, by the way.

PHP Code:
$regIP=IPADDRESS

$badIPs= array('122','121','123','124','125','41','196','58','59','61','218','219','220','221','222','118','117','116','210','114','113','68'); 



  
$regIPparts explode(".",$regIP); 
if(
in_array($regIPparts[0],$badIPs)) 


   { 

     
$userdata->set('usergroupid',4); 

      } 
Reply With Quote
  #6  
Old 01-13-2010, 04:30 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you have a static IP at the moment, you can try this for debug mode:
Code:
if ($_SERVER["REMOTE_ADDR"] == "xx.xx.xx.xx") {
    // enable debug mode for only my IP address
    $config['Misc']['debug'] = true;
}
Change xx.xx.xx.xx to your IP. That should work.
Reply With Quote
  #7  
Old 01-13-2010, 04:52 PM
JPnyc JPnyc is offline
 
Join Date: May 2005
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

much thanks, Lynne.
Reply With Quote
  #8  
Old 01-21-2010, 02:21 PM
JPnyc JPnyc is offline
 
Join Date: May 2005
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, still working on this. Can anybody see anything in the above code that would stop the entire page from rendering, on absolutely any hook vBulletin?
Reply With Quote
  #9  
Old 01-21-2010, 02:51 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Take a look in your error_logs. Something should be in there about why you are getting errors. Try commenting out parts of your code to see which part is causing the problem. Also, $userdata->set is only going to work if that datamanager is in use in that area of the code.
Reply With Quote
  #10  
Old 01-21-2010, 03:32 PM
JPnyc JPnyc is offline
 
Join Date: May 2005
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, I was afraid of that. I tried hooking it on global for that reason, figuring that is where all variables are initialized, but I got the same result, no load. I'll check the logs. Thanks

--------------- Added [DATE]1264095994[/DATE] at [TIME]1264095994[/TIME] ---------------

Okay it's this line:$userdata->set('usergroupid',4);
Anyone know another way of changing user group that can be hooked on any page which contains posting tools? I can hook it on anything, including editor toolbar start or end. That should include any template wherein posting can be done Thanks in advance.

--------------- Added [DATE]1264096272[/DATE] at [TIME]1264096272[/TIME] ---------------

nevermind, I realize now there is no way to do what I'm trying to do. Thanks anyway for your help.
Reply With Quote
Reply


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 07:53 AM.


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.04795 seconds
  • Memory Usage 2,260KB
  • 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
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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