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');
Bookmarks