vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Administrative and Maintenance Tools - Enable VB Debug Mode without hacking config.php (https://vborg.vbsupport.ru/showthread.php?t=177853)

MrEyes 05-01-2008 10:00 PM

Enable VB Debug Mode without hacking config.php
 
Summary

As just about everybody knows you can enabled vBulletin debug mode by placing the following:

Code:

$config['Misc']['debug'] = true;
into the includes/config.php file. While the information this provides is extremely useful it has IMHO two major drawbacks:
  • Once added debug output is visible and enabled for all users of the forum.
  • You have to edit files on the server to enable debug mode. Yes this doesn't take long but it is still a pain.

The following hack go some way towards solving both of these drawbacks. In summary you make a single one time edit to the config.php file, once done you can enabled/disable debug mode via URL querystring arguments.

How do I use this?

Once installed, if you want to see debug output you simple add the following to the end of the URL you are viewing:

Code:

debug=XXX
for example:

Installation summary
Installation Time: < 1 minute
VB File Edits: 1

OK, so what do I have to do?
  1. First download a copy of your config.php file.
  2. Open this in your favourite text editor and scroll to the last line
  3. Directly above the "?>" paste in the following text:

    Code:

    if ($_GET["debugmode"] == "XXX")
    {
            $config['Misc']['debug'] = true;
    }

  4. Change the XXX part to some difficult to guess value (no spaces and only alphanumeric characters). If you prefer you can also change the "debugmode" query string key to something else to give a little extra security.
  5. Save and upload the config.php file.

Once uploaded you can now view debug output by adding the querystring arguments as described above to the URL you are viewing. No more config changes and debug info is only accessible to those who know you secret "XXX" key.

Gotchas!!

This does not work when submitting data, so for example if you enter debug mode for post reply, when you click the button and submit the fact that you were in debug mode on the submission page is not carried across, and as you cannot edit the post URL the resulting page does not display debug output.

I did attempt to rectify this by added a check value into "$_SESSION", however it would seem that VB's internal session handling does not allow this to be carried through.

So if anybody has any suggestions for this issue, feel free to post them.

Lizard King 05-02-2008 04:21 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=176700" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=176700</a>

sockwater 07-05-2008 06:01 AM

Quote:

Originally Posted by Lizard King (Post 1505901)

Well, these two mods are different in the approach, so I wouldn't call them dupes.

I will comment that I don't think it's prudent to open up debug mode to anyone browsing your forums by allowing anyone to turn it on via the URL.


All times are GMT. The time now is 07:30 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.01064 seconds
  • Memory Usage 1,724KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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