Re: The template names in the source code
Quote:
Originally Posted by carpeperdiem
very cool.
this should be stock... HOWEVER, there should be a "disable" switch so a visitor can't see or try to exploit this info.
I don't need visitors knowing paths and template names.
BUT - this is a great idea for newbies and stores in development.
Thanks for posting this!
|
Use the following code:
PHP Code:
function func_show_as_comment($string, $end=false) {
global $show_template_names;
$templates = array (
"buttons/go_image_menu.tpl",
"modules/Special_Offers/customer/cart_checkout_buttons.tpl",
"main/title_selector.tpl",
"modules/QuickBooks/orders.tpl",
"modules/UPS_OnLine_Tools/ups_currency.tpl",
"buttons/go_image.tpl",
"buttons/go_image_menu.tpl",
"main/image_property.tpl",
"main/include_js.tpl"
);
if (!in_array($string, $templates) && $show_template_names) {
echo "\n\n<!--";
if ($end) echo " / ";
echo "$string -->\n\n";
}
}
X-Cart will show the template names only for the URLs like 'home.php?cat=111&show_template_names=Y', i.e. with 'show_template_names' parameter.
__________________
Eugene Kaznacheev,
Evangelist/Product Manager at Ecwid: http://www.ecwid.com/ (since Sept 2009)
ex-Head of X-Cart Tech Support Department
ex- X-Cart Hosting Manager - X-Cart hosting
ex-X-Cart Technical Support Engineer
Note: For the official guaranteed tech support services please turn to the Customers HelpDesk.
|