vBulletin

Thank you for visiting. This is our website archive. Please visit our main website by clicking the banner above.
vBulletin FAQ is dedicated to helping the forum owner build, manage and profit from his vBulletin Forum
vBulletin Web Hosting - Free skins and styles for your vBulletin - Search Engine Optimization




A Quick Tip

mikelbeck
12-16-2005, 11:03 AM
If you're dumb like me, and you put untested code in the global_start hook and suddenly you find that you can't access your board anymore, here's an easy way to fix it.

Open global.php, search for this block of code:


if (!is_demo_mode())
{
@ob_start();
($hook = vBulletinHook::fetch_hook('global_start')) ? eval($hook) : false;
$phpinclude_output = @ob_get_contents();
@ob_end_clean();
}


and comment it out, so it looks like this:


/*
if (!is_demo_mode())
{
@ob_start();
($hook = vBulletinHook::fetch_hook('global_start')) ? eval($hook) : false;
$phpinclude_output = @ob_get_contents();
@ob_end_clean();
}
*/


Then you'll be able to access your board again and can go in and either fix or delete your bad code. After you fix it, go back to global.php and un-comment the code.

:D

Noppid
12-16-2005, 04:26 PM
I know this is serious, but that is about as hard as I've laughed in a while! I'm sure you worded that for the effect. It worked!

That's a good heads up though on disabling the hook. Good job.

Another way to avoid a lost cause is to make an ACP setting to enable/disable a hack. Then wrap your hook in code that checks if it's enabled or not.


if($vbulletin->options['my_hack_control'])
{
//do stuff
}


APC settings are easy enough these days.

mikelbeck
12-16-2005, 05:03 PM
I know this is serious, but that is about as hard as I've laughed in a while! I'm sure you worded that for the effect. It worked!

Thanks. *I* didn't think it was all that funny when I put what I thought was my last code change in, and then found that I couldn't get to my board anymore.

That's a good heads up though on disabling the hook. Good job.

Thanks!

Another way to avoid a lost cause is to make an ACP setting to enable/disable a hack. Then wrap your hook in code that checks if it's enabled or not.


if($vbulletin->options['my_hack_control'])
{
//do stuff
}


APC settings are easy enough these days.

Ya, but what if you can't even get into the ACP to disable it? That was the position I was in - nothing worked...

Noppid
12-16-2005, 05:17 PM
Thanks. *I* didn't think it was all that funny when I put what I thought was my last code change in, and then found that I couldn't get to my board anymore.



Thanks!



Ya, but what if you can't even get into the ACP to disable it? That was the position I was in - nothing worked...

Oh, I didn't think of that. DOH!

mikelbeck
12-16-2005, 07:17 PM
Oh, I didn't think of that. DOH!

D'oh indeed, my friend. D'oh indeed. :wave:


vBulletin

seo book

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum