Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 62
  1. #11
    Join Date
    Apr 2004
    Location
    vienna
    Posts
    198
    Plugin Contributions
    9

    Default Re: template switch

    Quote Originally Posted by mimi78 View Post
    What is the init_templates when I paste it in the override folder the site goes blank.
    the only difference to the original file, are the lines 38..50
    PHP Code:
    /**
     * The actual template directory to use
     */           
     
    $template_dir 'classic'
       if(isset(
    $_GET['template_switch_id'])){
        
    zen_setcookie("zctemplate"$_GET['template_switch_id'], time()+(60*60*24*365));
        
    $template_dir $_GET['template_switch_id'];
      } else {
          if(isset(
    $_COOKIE["zctemplate"])){
            
    $template_dir $_COOKIE["zctemplate"];
            
    zen_setcookie("zctemplate"$_COOKIE["zctemplate"], time()+(60*60*24*365)); 
          }
      } 
    remove the closing
    Code:
    ?>
    at file-end; maybe there are chars after

  2. #12
    Join Date
    Mar 2009
    Posts
    78
    Plugin Contributions
    0

    Default Re: template switch

    Thanks Hugo for answering. I removed the ?> from the end but the page stays blank.

    Here is the entire init_template code.
    PHP Code:
    <?php
    /**
     * initialise template system variables
     * see {@link  http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.
     *
     * Determines current template name for current language, from database<br />
     * Then loads template-specific language file, followed by master/default language file<br />
     * ie: includes/languages/classic/english.php followed by includes/languages/english.php
     *
     * @package initSystem
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: init_templates.php 316 2008-06-06 15:00:05Z hugo13 $
     */
      
    if (!defined('IS_ADMIN_FLAG')) {
       die(
    'Illegal Access');
      }

    /*
     * Determine the active template name
     */
      
    $template_dir "";
      
    $sql "select template_dir
                from " 
    TABLE_TEMPLATE_SELECT "
                where template_language = 0"
    ;
      
    $template_query $db->Execute($sql);
      
    $template_dir $template_query->fields['template_dir'];

      
    $sql "select template_dir
                from " 
    TABLE_TEMPLATE_SELECT "
                where template_language = '" 
    $_SESSION['languages_id'] . "'";
      
    $template_query $db->Execute($sql);
      if (
    $template_query->RecordCount() > 0) {
        
    $template_dir $template_query->fields['template_dir'];
      }

    /**
     * The actual template directory to use
     */           
     
    $template_dir 'classic'
       if(isset(
    $_GET['template_switch_id'])){
        
    zen_setcookie("zctemplate"$_GET['template_switch_id'], time()+(60*60*24*365));
        
    $template_dir $_GET['template_switch_id'];
      } else {
          if(isset(
    $_COOKIE["zctemplate"])){
            
    $template_dir $_COOKIE["zctemplate"];
            
    zen_setcookie("zctemplate"$_COOKIE["zctemplate"], time()+(60*60*24*365)); 
          }
      }
     
      
    define('DIR_WS_TEMPLATE'DIR_WS_TEMPLATES $template_dir '/');
      
    // r.l. hook for smarty      
      
      
    if('Yes' == ACTIVATE_SMARTY){
        
    $smarty = new Smarty_Template();
      }         
      
    /**
     * The actual template images directory to use
     */
      
    define('DIR_WS_TEMPLATE_IMAGES'DIR_WS_TEMPLATE 'images/');
    /**
     * The actual template icons directory to use
     */
      
    define('DIR_WS_TEMPLATE_ICONS'DIR_WS_TEMPLATE_IMAGES 'icons/');

    /**
     * Load the appropriate Language files, based on the currently-selected template
     */

      
    if (file_exists(DIR_WS_LANGUAGES $template_dir '/' $_SESSION['language'] . '.php')) {
        
    $template_dir_select $template_dir '/';
      
    /**
       * include the template language overrides
       */
          
    include_once(DIR_WS_LANGUAGES $template_dir_select $_SESSION['language'] . '.php');
      } else {
        
    $template_dir_select '';
          
    //  include_once(DIR_WS_LANGUAGES . $template_dir_select . $_SESSION['language'] . '.php');
      
    }
    /**
     * include the template language master (to catch all items not defined in the override file).
     * The intent here is to: load the override version to catch preferencial changes; 
     * then load the original/master version to catch any defines that didn't get set into the override version during upgrades, etc.
     */
    // THE FOLLOWING MIGHT NEED TO BE DISABLED DUE TO THE EXISTENCE OF function() DECLARATIONS IN MASTER ENGLISH.PHP FILE
    // THE FOLLOWING MAY ALSO SEND NUMEROUS ERRORS IF YOU HAVE ERROR_REPORTING ENABLED, DUE TO REPETITION OF SEVERAL DEFINE STATEMENTS
      
    include_once(DIR_WS_LANGUAGES .  $_SESSION['language'] . '.php');


    /**
     * send the content charset "now" so that all content is impacted by it
     */
      
    header("Content-Type: text/html; charset=" CHARSET);

    /**
     * include the extra language definitions
     */
      
    include(DIR_WS_MODULES 'extra_definitions.php');

  3. #13
    Join Date
    Apr 2004
    Location
    vienna
    Posts
    198
    Plugin Contributions
    9

    Default Re: template switch

    Quote Originally Posted by mimi78 View Post
    Thanks Hugo for answering. I removed the ?> from the end but the page stays blank.
    template_switch works only with the 1.3.x series

    please use :: http://www.zen-cart.com/index.php?ma...roducts_id=860

  4. #14
    Join Date
    Mar 2009
    Posts
    78
    Plugin Contributions
    0

    Default Re: template switch

    I am using this version zen-cart-v1.3.8-full-fileset-11302007. I'll check this link you gave me, thank you.

  5. #15
    Join Date
    Mar 2009
    Posts
    78
    Plugin Contributions
    0

    Default Re: template switch

    I'm not sure how to run the debug. I installed it on my server and went to my home page, nothing shows on my cache it is set to writable. So I installed it on my pc and this came on the cache folder.
    I'm not sure what I am supposed to do once installing the debug.

    This came out:

    [16-Jun-2009 11:06:53] PHP Warning: require(includes/templates/template_default/common/tpl_header.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in C:\xampp\htdocs\testing\includes\templates\template_default\common\tpl_main_page .php on line 73

    [16-Jun-2009 11:06:53] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/templates/template_default/common/tpl_header.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\testing\includes\templates\template_default\common\tpl_main_page .php on line 73

    On my site the default template shows and although all the side boxes are ON they don't show.

    http://onwrapcreations.com/shop/

  6. #16
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: template switch

    If you remove the closing ?> from a php file, you are creating a bigger error than you started out with. Never remove those characters, but you can check if there are spaces after them and remove the spaces.
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

  7. #17
    Join Date
    Apr 2004
    Location
    vienna
    Posts
    198
    Plugin Contributions
    9

    Default Re: template switch

    do you see the file includes/templates/template_default/common/tpl_header.php
    compare your template_default with the downloaded source



    Quote Originally Posted by afo View Post
    If you remove the closing ?> from a php file, you are creating a bigger error than you started out with. Never remove those characters, but you can check if there are spaces after them and remove the spaces.
    Appendix B. Zend Framework Coding Standard for PHP
    B.2. PHP File Formatting
    B.2.1. General
    For files that contain only PHP code, the closing tag ("?>") is never permitted.
    It is not required by PHP, and omitting it prevents the accidental injection of trailing white space into the response.
    == http://framework.zend.com/manual/en/...atting.general == Programmers Reference Guide

  8. #18
    Join Date
    Mar 2009
    Posts
    78
    Plugin Contributions
    0

    Default Re: template switch

    I don't know why something so simple is not working for me. Is there anyone willing to install it for me? I'd pay of course.

  9. #19
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: template switch

    I don't know why something so simple is not working for me.
    I am due back LATE tonight Sunday....PM me with your details
    Zen-Venom Get Bitten

  10. #20
    Join Date
    Sep 2008
    Posts
    220
    Plugin Contributions
    0

    Default Re: template switch

    Quote Originally Posted by charmedbytina2 View Post
    You need to edit the templates.txt and you need to make sure the sidebox files are added to ALL of your templates.

    Tina
    In which path is this templates.txt file uploaded to?

    Thanks

 

 
Page 2 of 7 FirstFirst 1234 ... LastLast

Similar Threads

  1. v151 Title tag on my template pages missing - cannot switch to default template
    By mrcastle in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 6 Aug 2014, 12:00 AM
  2. Lose my template style when I switch to my URL
    By ak6000 in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 19 Jun 2012, 04:30 PM
  3. Template overide/switch for one category
    By Davx in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 12 Sep 2011, 06:15 PM
  4. trying to install and switch to another template
    By sdpamperin in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 7 Sep 2009, 09:32 PM
  5. Fatal Error in UK Switch/Maesto cc_uk addon
    By hutting in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 16 May 2006, 10:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR