Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Private Debug Console

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 06-20-2007, 04:22 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default 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";
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #2  
Old 09-08-2007, 09:56 PM
 
DoctorEspresso.com DoctorEspresso.com is offline
 

Member
  
Join Date: Jul 2007
Posts: 13
 

Default Re: Private Debug Console

Does anybody know how to do this in X-Cart version 4.0.19?
__________________
Thanks,
DoctorEspresso.com
X-Cart version 4.0.19
Reply With Quote
  #3  
Old 09-12-2007, 05:46 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default 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
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #4  
Old 09-12-2007, 08:30 AM
 
DoctorEspresso.com DoctorEspresso.com is offline
 

Member
  
Join Date: Jul 2007
Posts: 13
 

Default Re: Private Debug Console

Thanks for the reply shan, I found another post with a simple wrap around the debug tpl's.
__________________
Thanks,
DoctorEspresso.com
X-Cart version 4.0.19
Reply With Quote
  #5  
Old 02-07-2009, 04:53 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default 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}
__________________
xcartmods.co.uk
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:47 PM.

   

 
X-Cart forums © 2001-2020