vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Debug variable in URL (https://vborg.vbsupport.ru/showthread.php?t=63976)

krohnathlonman 04-16-2004 10:00 PM

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.

rob_daemon 04-17-2004 07:18 AM

Ah... excellent ;)

One change that I can think of:

PHP Code:

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


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

AlexanderT 04-17-2004 09:21 AM

Quote:

Originally Posted by rob_daemon
Ah... excellent ;)

One change that I can think of:

PHP Code:

if ($_REQUEST['debug'] > 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.

rob_daemon 04-17-2004 03:39 PM

Quote:

Originally Posted by AlexanderT
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.

AlexanderT 04-17-2004 03:49 PM

Quote:

Originally Posted by rob_daemon
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!

krohnathlonman 04-17-2004 03:59 PM

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

Majik? 04-17-2004 10:44 PM

Quote:

Originally Posted by krohnathlonman
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

Instead 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.

GamerJunk.net 04-18-2004 02:51 AM

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

krohnathlonman 04-18-2004 03:12 AM

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

Rich 04-19-2004 10:24 PM

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

Polo 03-23-2005 04:02 PM

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


All times are GMT. The time now is 05:57 AM.

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.01560 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)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