View Single Post
  #4  
Old 10-12-2002, 01:59 PM
 
syddos syddos is offline
 

eXpert
  
Join Date: Sep 2002
Location: London, England, UK
Posts: 259
 

Default

Quote:
Originally Posted by Matt
By newly "compiled templates" do you mean newly created, modified or both?

Also when you say it clears the old templates, which ones do you mean?

Hi Matt,

I think I need to explain how XCart works.
[list=1][*]Lets start with the "customer/home.tpl". This template file is ran every time a user clicks on Any Menu Link. "customer/home.tpl" contains the Layout <HTML>, <HEAD>, <TITLE>, <BODY> tags, and the main <TABLE> for the page layout (LEFT column, CENTER column, RIGHT column) <TR><TD> tags.

All the other templates (.tpl) files e.g. "main/register.tpl", "news.tpl", "help.tpl" etc are included in "customer/home.tpl" (v3.1.x) in "customer/main_home.tpl" (v3.2.x )[*] When a customer connects to xcart, Smarty gets All the template files, required to produce that page.
  1. Smarty then complies COPIES of all the templates required to produce that page, and stores the complied templates in the template_c directory for future use.
  2. Smarty also monitors changes to the "skin1/any_file_name.tpl files, and will re-compile the changed .tpl file, and store it in the template_c directory.
  3. Smarty can deliver the "Complied files" much faster to the users computer. Complied files also means the users Browser has less work to do, so the pages loads much faster on their monitor.
[*]If you are making a lot of changes to template files, it's good pratice to run cleanup.php from your browser (www.your_website.com/xcart/cleanup.php), to remove the existing compiled templates, and force Smarty to compile a new fresh set of template files. This makes sure that only the most recent .tpl files are in the "templates_c" directory. [*]If a template file has an HTML error in the code, smarty will still compile the template, if it has a php error, smarty will NOT compile the template, and will produce one or more error messages on your monitor. [*]If you are upgrading, and want to delete the old xcart installation, you MUST run "cleanup.php" FIRST to delete the compiled files in the "templates_c" directory. These files are HIDDEN and LOCKED by Smarty, to protect them from being written to or deleted, by any other person or program, other than Smarty.

I know some people in this forum have had problems, when deleting xcart from their servers, they always find that the template_c directory remains after all the other files have been deleted (depending on what file permissions you have changed). Some have found that their Hosting Site support staff cannot delete the template_c directory.

If this has happened to you, and you need the space, and you used the control panel to delete the files on your server, you will need to do several things in the following order
  1. Method A: If you have already installed the a new version of xcart, you would have RENAMED the old xcart folder which still has the old "templates_c" directory inside it.
  2. STEP 1. RENAME the NEW xcart directory to whatever you like.
  3. STEP 2. RENAME the OLD xcart directory BACK TO "XCART".
  4. STEP 3. Using your CP RESTORE the template_c directory (should be in the TRASHCAN directory of your server)
  5. STEP 4. COPY "cleanup.php" FROM your new xcart installation to the RESTORED xcart ROOT directory.
  6. STEP 5. Access the "cleanup.php" file using your BROWSER (see #3 above) This will remove ALL the compiled files in "template_c", and allow you to delete all the directories belonging to the old installation.
  7. STEP 6. RENAME your NEW xcart installation BACK to xcart.
  1. NOTE: If you do not have another installation of xcart on your server, but still have the UN-Deleted "xcart/templates_c" directory from a PREVIOUS install on your server, RESTORE and RENAME this old installation (if it's in the TRASHCAN). Next INSTALL your new copy or upgrade version of xcart, then follow the above steps to remove the OLD installation of xcart with the "un-deleted templates_c" directory..
[/list:cb91256480]

Regards,
__________________
Syddos

Nothing is impossible, We just don't know how to do it ........Yet!

Xcart 4.1.X PRO (Testing Platform: winXP Pro)
Perl 5.8.7 (win32)
WINAMP 1.6.3 (win32 server package. Includes the following)
- phpMyAdmin v2.8.03
- MySql 5.0.21
- Apache 2.0.55 (win32)
- php 5.1.4
- SQLitemanager 1.2.0
Reply With Quote