Back to vBulletin 3.7 Add-ons

Enable VB Debug Mode without hacking config.php
Mod Version: 1.00, by MrEyes

This modification is in the archives.
vB Version: 3.7.0 Rating: (0 vote - 0 average) Installs: 7
Released: 02 May 2008 Last Update: Never Downloads: 2
Not Supported Code Changes Re-usable Code Translations  

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:
  • http://www.mysite.com/forum/index.php?debugmode=XXX
  • http://www.mysite.com/forum/forumdisplay.php?f=2&debugmode=XXX

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.

Download

No files for download.

Similar Mods

Administrative and Maintenance Tools Enable/Disable Debug Mode vBulletin 3.7 Add-ons

vblts.ru supports vBulletin®, 2022-2024