View Full Version : can't find the right hook
JPnyc
01-13-2010, 03:06 PM
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:
$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 1263406044 at 1263406044 ---------------
here's the code, by the way.
$regIP=IPADDRESS;
$badIPs= array('122','121','123','124','125','41','196','58 ','59','61','218','219','220','221','222','118','1 17','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:
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 1264095994 at 1264095994 ---------------
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 1264096272 at 1264096272 ---------------
nevermind, I realize now there is no way to do what I'm trying to do. Thanks anyway for your help.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.