vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   can't find the right hook (https://vborg.vbsupport.ru/showthread.php?t=233005)

JPnyc 01-13-2010 03:06 PM

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.

Lynne 01-13-2010 03:10 PM

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


JPnyc 01-13-2010 03:32 PM

thanks, Lynne. Will that list be visible to all or just to admin? Thanks again.

Lynne 01-13-2010 03:33 PM

It will be visible to all which is why I said to do it on your test site.

JPnyc 01-13-2010 03:59 PM

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); 

      } 


Lynne 01-13-2010 04:30 PM

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.

JPnyc 01-13-2010 04:52 PM

much thanks, Lynne.

JPnyc 01-21-2010 02:21 PM

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?

Lynne 01-21-2010 02:51 PM

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.

JPnyc 01-21-2010 03:32 PM

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.


All times are GMT. The time now is 05:24 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01041 seconds
  • Memory Usage 1,734KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete