Helpful Information
 
 
Category: vBulletin 3.0
Debug variable in URL

open your global.php and go to the end of it....

Insert:


if ($_REQUEST['debug'] > 0) {
$debug = 1;
}

Now just add &debug=1 at the end of any URL to be able to see those debugging stats

If anybody else did this already just kill this thread... Just wanted to add this kind of info to my articles page and came up with this code.

Ah... excellent ;)

One change that I can think of:

if ($_REQUEST['debug'] > 0 AND ($permissions['adminpermissions'] & CANCONTROLPANEL))
{
$debug = 1;
}

That way you have to be able to access the Admin CP to do this.

Ah... excellent ;)

One change that I can think of:

if ($_REQUEST['debug'] > 0 AND ($permissions['adminpermissions'] & CANCONTROLPANEL))
{
$debug = 1;
}

That way you have to be able to access the Admin CP to do this.
That wouldn't work because the $permission array won't be initialized in config.php yet.

That wouldn't work because the $permission array won't be initialized in config.php yet.
He said to put this in global.php where it would work... if you wanted it in config.php or even init.php, you'd have to use $_COOKIE.

He said to put this in global.php where it would work... if you wanted it in config.php or even init.php, you'd have to use $_COOKIE.
Ahh, where are my glasses!

If you want only admins to be able to see it, I suggest you change

This part:
if ($_REQUEST['debug'] > 0) {

to something hidden like if ($_REQUEST['zebrapants'] > 0) {

then in the URL instead of using &debug=1 use &zebrapants=1

If you want only admins to be able to see it, I suggest you change

This part:
if ($_REQUEST['debug'] > 0) {

to something hidden like if ($_REQUEST['zebrapants'] > 0) {

then in the URL instead of using &debug=1 use &zebrapants=1Instead of having to type something that long, why wouldn't you jsut add a conditional to either check permissions or usergroup of the user? not only that, there's always the potential that someone would find out what the variable is and without any kind of usergroup/permission check, they can use it.

Screenshot of what it would look like when you debug it?

it's the VB built in Debug screen which tells you time to create page, what templates used, queries.

Hello,
The code worked as suspected,but then it caused an error claiming that header can't be sent,they already were. I am running VB3 gold, all the newest mysql,apache,etc. I debugged,and returned to my normal forum. All was fine until I tried to read a post. Thats when the errors jumped. Naturally,I removed the code from my global and everything was fine again. (Yes,I placed the code where it states to do so.)

Woah! this is an excellent modification ;) i used your second suggestion... so that I can only know the password for the debug :) thanks krohnathlonman

@iguanairs: you probably left a blank space on global.php after the ?> closing tag










privacy (GDPR)