View Single Post
  #4  
Old 02-01-2005, 10:41 PM
  Stephen Hatton's Avatar 
Stephen Hatton Stephen Hatton is offline
 

Senior Member
  
Join Date: Mar 2004
Location: Melbourne, Australia
Posts: 182
 

Default Comments in templates and php files

Hi Daniel


I comment a .tpl file with "open curly bracket" "star" Put Your Comment Here or to disable a line of the template file "star" " close curly bracket"

eg:
{* Modified by SWH on 050127 *}
{* //skin1/customer/main/register.tpl *}
{* Original Version embedded in comments after the modified lines labelled SWH *}

If you wish to comment out multiple lines:
{*
Line 1
Line 2
Line 3
*}

Make sure that there are no {* or *} (other comments) inside your commented area. Otherwise it will run everything from *} to the last *}.

I also put a marker on the lines I have changed in the .tpl files - I use:
{* SWH *}

That way I can find changes quickly inside the files and from outside the files.

Note - any changes to the files will give issues in upgrades (if that file requires upgrading). See my post for further help:
http://forum.x-cart.com/viewtopic.php?t=14640


**********************************************
For .php files I use the following method to comment files:

/* Modified by SWH 041222 */
/* yoursite/include/func.php file being modified */
/* Original Version embedded in comments after the modified lines labelled SWH */

I then comment at the end of lines with
// SWH
for the lines I have modified.
If you wish you can put a
# at the start of the line to comment out the whole line (eg. disable a line of code).

For program line codes make sure that you have a semicolon terminating the line with no spaces after it (or you will get a blank screen & php errors).


I hope this helps you and others. Remember to backup often and keep a copy of the original file to use for restoring (in case Murphy should visit!).

Regards
Ing. Stephen Hatton
__________________
Apache Linux V1.3.33
PERL version: 5.8.0
PHP version: 4.3.11
MySQL version: 4.0.22-standard
X-cart V4.0.17: Addons: X-PConfig, X-Giftreg, X-Fancycat, X-AOM
Reply With Quote