[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 init_templates.php

Zen Cart 源代码 init_templates.php




下载文件

文件名: init_templates.php
文件类型: PHP文件
文件大小: 3.15 KiB
MD5: 15b58c6651e9029175382d93137f9103

init_templates.php - 关闭高亮
  1. <?php
  2. /**
  3.  * initialise template system variables
  4.  * see {@link  http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.
  5.  *
  6.  * Determines current template name for current language, from database<br />
  7.  * Then loads template-specific language file, followed by master/default language file<br />
  8.  * ie: includes/languages/classic/english.php followed by includes/languages/english.php
  9.  *
  10.  * @package initSystem
  11.  * @copyright Copyright 2003-2006 Zen Cart Development Team
  12.  * @copyright Portions Copyright 2003 osCommerce
  13.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  14.  * @version $Id: init_templates.php 3123 2006-03-06 23:36:46Z drbyte $
  15.  */
  16.   if (!defined('IS_ADMIN_FLAG')) {
  17.    die('Illegal Access');
  18.   }
  19.  
  20. /*
  21.  * Determine the active template name
  22.  */
  23.   $template_dir = "";
  24.   $sql = "select template_dir
  25.            from " . TABLE_TEMPLATE_SELECT . "
  26.            where template_language = 0";
  27.   $template_query = $db->Execute($sql);
  28.   $template_dir = $template_query->fields['template_dir'];
  29.  
  30.   $sql = "select template_dir
  31.            from " . TABLE_TEMPLATE_SELECT . "
  32.            where template_language = '" . $_SESSION['languages_id'] . "'";
  33.   $template_query = $db->Execute($sql);
  34.   if ($template_query->RecordCount() > 0) {
  35.     $template_dir = $template_query->fields['template_dir'];
  36.   }
  37.  
  38. /**
  39.  * The actual template directory to use
  40.  */
  41.   define('DIR_WS_TEMPLATE', DIR_WS_TEMPLATES . $template_dir . '/');
  42. /**
  43.  * The actual template images directory to use
  44.  */
  45.   define('DIR_WS_TEMPLATE_IMAGES', DIR_WS_TEMPLATE . 'images/');
  46. /**
  47.  * The actual template icons directory to use
  48.  */
  49.   define('DIR_WS_TEMPLATE_ICONS', DIR_WS_TEMPLATE_IMAGES . 'icons/');
  50.  
  51. /**
  52.  * Load the appropriate Language files, based on the currently-selected template
  53.  */
  54.  
  55.   if (file_exists(DIR_WS_LANGUAGES . $template_dir . '/' . $_SESSION['language'] . '.php')) {
  56.     $template_dir_select = $template_dir . '/';
  57.   /**
  58.    * include the template language overrides
  59.    */
  60.       include_once(DIR_WS_LANGUAGES . $template_dir_select . $_SESSION['language'] . '.php');
  61.   } else {
  62.     $template_dir_select = '';
  63.       //  include_once(DIR_WS_LANGUAGES . $template_dir_select . $_SESSION['language'] . '.php');
  64.   }
  65. /**
  66.  * include the template language master (to catch all items not defined in the override file).
  67.  * The intent here is to: load the override version to catch preferencial changes;
  68.  * then load the original/master version to catch any defines that didn't get set into the override version during upgrades, etc.
  69.  */
  70. // THE FOLLOWING MIGHT NEED TO BE DISABLED DUE TO THE EXISTENCE OF function() DECLARATIONS IN MASTER ENGLISH.PHP FILE
  71. // THE FOLLOWING MAY ALSO SEND NUMEROUS ERRORS IF YOU HAVE ERROR_REPORTING ENABLED, DUE TO REPETITION OF SEVERAL DEFINE STATEMENTS
  72.   include_once(DIR_WS_LANGUAGES .  $_SESSION['language'] . '.php');
  73.  
  74.  
  75. /**
  76.  * send the content charset "now" so that all content is impacted by it
  77.  */
  78.   header("Content-Type: text/html; charset=" . CHARSET);
  79.  
  80. /**
  81.  * include the extra language definitions
  82.  */
  83.   include(DIR_WS_MODULES . 'extra_definitions.php');
  84. ?>