vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Administrative and Maintenance Tools - ZH - Debug Mode (https://vborg.vbsupport.ru/showthread.php?t=133034)

Ziki 12-01-2006 10:00 PM

ZH - Debug Mode
 
This modification was brought to you by
KXDesign
http://www.kxdesign.com/


~Hack name
Debug Mode

~Hack description
Enables debug mode in admincp/modcp and forums

~Hack options
  • Turn on/off in forums
  • Turn on/off in admincp
  • Turn on/off in modcp
  • Turn on/off in archive

~Hack info
File uploads: 0
Template edits: 0
File edits: 0
Plugins: 4
SQL Queries: 0
Phrases: 9
Settings: 4

Install time: 2 sec
Install level: Easy

~Hack installation
Step 1: Import product



~Hack screenshots
None


~Hack copyright
This may not be distributed,released or claimed as your work without author's permission.

New version here,with explain feature :) http://www.kxdesign.com/plugins/53-kx-debug-mode.html

Ziki 12-02-2006 03:45 PM

Reserved

Barakat 12-03-2006 12:36 AM

thanks ziki

Ziki 12-03-2006 10:51 AM

No problem.I think this should be vb default

ninjamaster 12-04-2006 06:57 PM

thanks ;)

KW802 12-05-2006 05:00 PM

Thanks. :) Being able to debug only in ACP makes life easier.

gldtn 01-03-2007 05:11 PM

Quote:

Originally Posted by Ziki (Post 1130667)
No problem.I think this should be vb default

Works great, thanks for the hack ;)

Indeed, it should be vBs default!

Ziki 01-06-2007 09:22 PM

Yes to make developer life easier :p

polly977 01-06-2007 09:59 PM

Explain SQL statements is not working in ACP if ACP debug flag is enabled with this modification.

Ziki 01-06-2007 10:02 PM

What do you expect it to do?

BigJimTheLug 01-10-2007 04:27 PM

Can I get an explanation of what this does.

Please give an explanation that is more in-depth than, "This mod enables debug mode."

Thank you.

Ziki 01-10-2007 04:35 PM

If you don't understand please refer to vbulletin manual.THis is for developers mostly

Logikos 01-24-2007 06:30 AM

Same thing here: http://www.vbhackers.com/f76/vbdebug-options-2921/

The problem with this is you can't use the explain option because the statement is executed after the global.php include. At least this is the problem I had with my hack.

bjohnson045 04-10-2007 07:07 PM

yah doesnt work

Ziki 04-11-2007 11:44 AM

Yes I know that is known thing.

UltimateOreo! 06-04-2007 01:13 AM

Fantastic, it works perfectly on the newest version of VB. Installed!

albibak 10-28-2007 07:15 PM

Great hack Ziki, very usefull.
Find in attachment the french translation ;)

testebr 12-06-2007 07:16 PM

Any idea how to enable option "explain" with this mod?

Ziki 12-07-2007 04:01 AM

Not possible with a plugin,for that you have to edit the files

REVHEAD 02-10-2008 09:13 AM

this mod is great thanyou.

Andreas 02-10-2008 09:23 AM

Quote:

Originally Posted by Ziki (Post 1396607)
Not possible with a plugin,for that you have to edit the files

Believe me, it is (to some great extend - the only query you miss is datastore setup) - i've already done this:
  • Create a plugin with execution order = 1 on init_startup
  • Check if explain=1, otherweise done
  • Copy the Resouce ID # o fthe mySQL connection and all other stuff you need from $db
  • Require class_database_explain.php
  • Unset $db, create a new object of class vB_Database_Explain and set the properties

And you're done :)

Sample Code

PHP Code:

if ($condition_to_activate_explain)
{

    switch (
strtolower($vbulletin->config['Database']['dbtype']))
    {
        
// load standard MySQL class
        
case 'mysql':
        case 
'':
        {
            require_once(
DIR '/includes/class_database_explain.php');
            
$newdb =& new vB_Database_Explain($vbulletin);
            break;
        }
    
        
// load MySQLi class
        
case 'mysqli':
        {
            require_once(
DIR '/includes/class_database_explain.php');
            
$newdb =& new vB_Database_MySQLi_Explain($vbulletin);
            break;
        }
    }
    if (!empty(
$newdb))
    {
        
$newdb->appname $db->appname;
        
$newdb->appshortname $db->appshortname;
        
$newdb->database $db->database;
        
$newdb->connection_master $db->connection_master;
        
$newdb->connection_slave =& $newdb->connection_master;
        
$newdb->connection_recent $db->connection_recent;
        
$newdb->multiserver $db->multiserver;
        
$newdb->shutdownqueries $db->shutdownqueries;
        
$newdb->sql $db->sql;
        
$newdb->reporterror $db->reporterror;
        
$newdb->error $db->error;
        
$newdb->errno $db->errno;
        
$newdb->maxpacket $db->maxpacket;
        
$newdb->locked $db->locked;
        
$newdb->querycount $db->querycount;
        
$db $newdb;
        
$vbulletin->db =& $db;
    } 



Ziki 09-15-2008 09:24 AM

New version here,with explain feature :) http://www.kxdesign.com/plugins/53-kx-debug-mode.html


All times are GMT. The time now is 05:49 PM.

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