PDA

View Full Version : Enable Debugmode just for your PC


Xenon
01-02-2004, 10:00 PM
Ok, so i can release at least one vb3 hack already, some more will follow once vb.org is upgraded and i find more time.

This hack is to enable Debugmode just for your PC, ignoring which account you use, so you can even browse with debug mode while you are logged out.

If you have a static IP, this hack is very small, but if you have dynamic IP's like myself it's a bit more complicated as it works with cookies :)

The Hack has been tested a long time on vb3G, i think it will work on RC1 as well, tests will follow :)

enjoy

sabret00the
01-03-2004, 09:25 PM
shouldn't this be in beta forums ;) :p

Xenon
01-03-2004, 09:26 PM
the hack itself works for the versions i mentioned, so nope :)
there is no point saying you cannot release hacks for betaversions as well :)

MindTrix
01-03-2004, 09:36 PM
Hes the admin, he doesnt need to post in Beta :) If any one moans it doesnt work, he can ban them :)

Cheers for the hack Xenon, i dont believe i have a need for it YET.

Cant wait to see the rest of your hacks sometime soon :)

Xenon
01-03-2004, 09:41 PM
Hehe, i wanted to post a fair reason, of course the one you mentioned is correct, too ;)

Well i normally just write hacks for myself, and release them.
I could use this hack often, as it shows me uncached templates and so on. :)

MindTrix
01-03-2004, 09:45 PM
Sounds interesting :)

Xenons next hack = Stay logged in on vB3 ;) You know you want too

Boofo
01-04-2004, 05:29 AM
Can there be a link made along with turning this on to erase the cookie to turn ift off, too? A redirect would be good after turning it on, too. ;)

Dean C
01-04-2004, 12:38 PM
Hehe what a great hack Stefan :)!

Admin
01-04-2004, 02:09 PM
And if you want to be really shortened:
$debug = ($_SERVER['REMOTE_ADDR'] == 'xxx.xxx.xxx.xxx');

Princeton
01-04-2004, 03:39 PM
I have something similar but I like your cookie idea. :up:
me clicks "Installed"

Xenon
01-04-2004, 03:52 PM
@Chen: :p

of course it's very easy if you have a static ip, but not all of us have, and the cookie part is important for me :)

@Bob: you can change the link in admin/index.php to tell you the actual info as well, but as the ACP is based on frames, that won't help you once you've toggled the debug madoe, that's why the neutral way was choosen by me :)

if the debug mode is enabled is easy to see on your forum's footer ;)

Boofo
01-04-2004, 03:56 PM
Stefan, I was wondering if there was a way to erase the cookie for the debug mode without having to log out. That way we can turn it off just as easy as turning it on. The redirect would also be nice instead of it sitting at DEBUG MODE ON (or whatever it says). ;)

But this is a great hack and idea, sir. ;)

Xenon
01-04-2004, 04:14 PM
oops, sorry, there was a little bit missing in the file.

if ($_COOKIE['admindebugcookie'] == 'enabled')
should have been
if ($_COOKIE['bbadmindebugcookie'] == 'enabled')

that way, it will delete the debugcookie after the second click :)
(damn, new cookieprefixes ;))

i've uploaded a new installfile, changed another small issue as well :)

Boofo
01-04-2004, 04:17 PM
Is that in this part?

REQUIRE BACK-END

Xenon
01-04-2004, 04:22 PM
just dl the whole file again, and reinstall again.
most of the bugs were just damn little typings ;)

Boofo
01-04-2004, 04:22 PM
I think you also need to change this:<a href="debugcookie.php">

to this:

<a href="admindebug.php">

;)

Xenon
01-04-2004, 04:26 PM
hmm, you could be right there :p

Link14716
01-04-2004, 04:39 PM
Nice one. :)

*Installs*

Boofo
01-04-2004, 04:46 PM
That filename still needs to be changed in the install file, but other than that, it works like a charm! Thank you, sir. ;)

MindTrix
01-10-2004, 04:01 PM
I did everything as said and yet i see no difference :S Must have done something wrong along the way (Yes i clicked the link and it said Cookie set, or something like that. Odd

Boofo
01-10-2004, 04:04 PM
I did everything as said and yet i see no difference :S Must have done something wrong along the way (Yes i clicked the link and it said Cookie set, or something like that. Odd
When it says "Debug Mode is on", go into your forumhome and scroll all the way to the bottom of the page. You'll see it all there. ;)

MindTrix
01-10-2004, 04:08 PM
Nopes it doesnt but i think i know why, lemme check if im right :)

MindTrix
01-10-2004, 04:11 PM
Got it. I skipped the second part of Config.php because it says if you have a static IP then you can. Well i do have a static IP but turns out i needed to put the second part in aswell so, go figure :) Working fine now though.

MindTrix
01-10-2004, 04:14 PM
OMG this is brilliant :) Eye opener for me yay

Xenon
01-10-2004, 04:26 PM
if you have a static ip, you can use the small little trick floris posted.
but then then debugmode will be always enabled, with the cookie, you have the choise :)

MindTrix
01-10-2004, 04:28 PM
Well i got IP and COOKIE option in there now and it works great so thats good enough for me :)

MindTrix
01-11-2004, 12:59 PM
Just out of pure interest why in the installation file do you have at the top

Release: not yet

? :p

Xenon
01-11-2004, 01:08 PM
lol *g*

well because i wrote the install file on beta 6, and just added the changes for gamma into it, but forgot to change the release date :)

MindTrix
01-11-2004, 01:14 PM
Tut tut, sometimes i wonder what you would do without me here to show you the errors in your way :)

Xenon
01-11-2004, 01:17 PM
hehe ;)

well i'm a coder in my heart, writing install files isn't that funny for me, i just like to write the codes ;)
maybe i shouldn't release them next time :p

Boofo
01-11-2004, 01:21 PM
maybe i shouldn't release them next time :p
Wrong! Next answer, please. ;)

MindTrix
01-11-2004, 01:24 PM
Im guessing/hoping he meant not to release the install instructions :p

Either way, Your the admin Xenon so i thought it is in my best interest not to argue with you :)

Boofo
01-11-2004, 01:31 PM
Without the install instructions, there is no hack. ;)

Quick! Apologize to him before he figures out what's going on. ;)

ChuanSE
03-17-2004, 01:32 PM
Hmm, it seems i have some problems with this on RC4


vBulletin Message
Unable to add cookies, header already sent.
File: /usr/home/puredj/WWW/forums/admincp/admindebug.php
Line: 1

Xenon
03-17-2004, 08:26 PM
Hmm, i cannot confirm that, it works flawless for me using RC4

make sure there is no char before the opening <?php in the named file

maybe you've installed another hack which starts output before the cookie is sent

ChuanSE
03-20-2004, 11:34 AM
maybe you've installed another hack which starts output before the cookie is sent

* ChuanSE is a hack-mess :p
i don't really find what is wrong

is there another way to enable debug mode?

Xenon
03-20-2004, 06:06 PM
with a static ip, yes ;)

and i think Stadler has released a similar mod here as well

but you may try to reinstall it from the scratch, maybe it was just a little mistake.
If it doesn't work, i may have to investigate further

BarBeQue
04-01-2004, 05:43 PM
Forgive me for sounding like a compleet newbie, but can someone shed some light on what the debugger will do/ show and how to add uncached template to the cache?
I couldn't find anything in the documents and on vb.com a search for uncached gave me a post saying to look at vb.org.

After installing the sidebar hack i get 1 uncached post (i use erwin's microstat's hack, which told me about the uncached template). How can solve that?

Xenon
04-01-2004, 05:47 PM
the debugger is just there do give you more informations about your board (like the ammount of queries/running time or used templates and of course which of the used templates are uncached)

and to answer the offtopic thing: to precache an uncached template, you have to add it's name to the template cache array which is defined at the very beginning of each vb file

BarBeQue
04-02-2004, 06:10 PM
Cool!

Well the 1 line static ip that Chen posted worked fine for me but i rather have a cookie (specially for my dyn ip co-admin).

But i can't seem to turn the debug on. Whenever i click the Toggle Debugmode i get a message saying "Debug cookie set". But it's not there.....
When i click it again i get the same message, but it it was really set the first time i should get the deleted cookie message, so it's not setting the debug mode.

In this code:

require_once('./global.php');
if ($_COOKIE['bbadmindebugcookie'] == 'enabled')
{
vbsetcookie('admindebugcookie', '', 0);
echo 'Debug cookie deleted';
}
else
{
vbsetcookie('admindebugcookie', 'enabled', 1);
echo 'Debug cookie set';
}
?>

Why is it called bbadmindebugcookie first and then admindebugcookie later? (not that changing all to bbadmindebugcookie matters/helps anything)

oh and in vb3 gold this line isn't there:
if ($index !== false)

instead it's:
if ($index == 0 AND $index !== false)

dunno if that matters any?

Xenon
04-02-2004, 09:14 PM
the bb is added because of the standart cookieprefix of vb3

if you have set up another prefix, you have to change the bb as well here.

BarBeQue
04-03-2004, 07:02 AM
Ah sweet!

Yes i did use a different cookie prefix, changed it and that fixed the problem :D
Works fine now, nice hack.

* BarBeQue clicks install

I just wonder, why is the cookie prefix hardcoded? I mean i often see table prefix variables used in hacks to add the table prefix code to a table name. Isn't there a cookie prefix variable that can be used here instead of hardcoding the prefix?

Xenon
04-03-2004, 06:21 PM
Good, we could fix it :)

hmm, good question, why the prefix variable is not used, it seems i just forgot about it.


I'll change it when i update the hack next time :)

Natch
07-21-2004, 07:01 AM
To include this, you need to move the test for the cookie down to below the definition of the $cookieprefix...

dwh
01-22-2005, 06:52 PM
This looks nice, does it still work for 3.06?

Xenon
01-23-2005, 02:50 PM
Yep, it will work for any vb3 versions