X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Private Debug Console (https://forum.x-cart.com/showthread.php?t=31962)

shan 06-20-2007 04:22 AM

Private Debug Console
 
Heres a mod i use all the time so that when im using the debug console its not shown to anyone else but me.

Its done on 4.1.x but you could adjust to work with other versions too.

It basically compares your IP address with an IP address that you set in config

WARNING : If you like to use webmaster mode etc this will probably not help and may well break it. Only use this if you know what your doing

I add the following to the database

ADD YOUR IP IN PLACE OF ##.##.##.## in this sql command

Code:

INSERT INTO `xcart_config` ( `name` , `comment` , `value` , `category` , `orderby` , `type` , `defvalue` , `variants` )
VALUES (
'enable_debug_console_ip', 'Only show debug to this IP', '##.##.##.##', 'General', '610', 'text', '', ''
);


then edit the

/init.php

file as follows ....

find .....
Code:

        #
        # Include webmaster mode
        #
        @include_once($xcart_dir."/include/webmaster.php");

        if($config["General"]["enable_debug_console"]=="Y" || $editor_mode=='editor')
                $smarty->debugging=true;

replace with

Code:


        #
        # Include webmaster mode
        #
        @include_once($xcart_dir."/include/webmaster.php");

        if($config["General"]["enable_debug_console"]=="Y" || $editor_mode=='editor') {
               
#
# SHAN ONLY SHOW DEBUG TO MY IP
#

                if ($config["General"]["enable_debug_console_ip"] == $_SERVER['REMOTE_ADDR']) {
                        $smarty->debugging=true;
                } ;
        } ;



I usually edit the way the debug console looks too by editing

/smarty.php

find ...
Code:

$smarty->debug_tpl = "file:debug_templates.tpl";
Replace with ....
Code:

$smarty->debug_tpl = "file:debug.tpl";

DoctorEspresso.com 09-08-2007 09:56 PM

Re: Private Debug Console
 
Does anybody know how to do this in X-Cart version 4.0.19?

shan 09-12-2007 05:46 AM

Re: Private Debug Console
 
its not gonna be far off from how this works.

if you follow the notes and refer to your own version you should be able to suss it

DoctorEspresso.com 09-12-2007 08:30 AM

Re: Private Debug Console
 
Thanks for the reply shan, I found another post with a simple wrap around the debug tpl's.

PhilJ 02-07-2009 04:53 AM

Re: Private Debug Console
 
Very useful mod, you can use the following code to get your IP address...

In skin1/single/home.tpl

Before </html> insert...
Code:

{php}
 $ip = getenv('REMOTE_ADDR');
 echo "<p align=\"center\"><b>IP: $ip</b></p>";
{/php}



All times are GMT -8. The time now is 11:14 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.