Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Enable VB Debug Mode without hacking config.php Details »»
Enable VB Debug Mode without hacking config.php
Version: 1.00, by MrEyes MrEyes is offline
Developer Last Online: May 2017 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.7.0 Rating:
Released: 05-01-2008 Last Update: Never Installs: 7
Re-useable Code Code Changes Translations  
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-02-2008, 04:21 PM
Lizard King Lizard King is offline
 
Join Date: Jan 2005
Location: Mersin
Posts: 907
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showthread.php?t=176700" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=176700</a>
Reply With Quote
  #3  
Old 07-05-2008, 06:01 AM
sockwater's Avatar
sockwater sockwater is offline
 
Join Date: Apr 2008
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lizard King View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05997 seconds
  • Memory Usage 2,212KB
  • Queries Executed 16 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete