[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 源代码 index.php

Zen Cart 源代码 index.php




下载文件

文件名: index.php
文件类型: PHP文件
文件大小: 5.18 KiB
MD5: 673249150c769b8f5e8c0745b91c23d9

index.php - 关闭高亮
  1. <?php
  2. /**
  3.  * index.php represents the hub of the Zen Cart MVC system
  4.  *
  5.  * Overview of flow
  6.  * <ul>
  7.  * <li>Load application_top.php - see {@tutorial initsystem}</li>
  8.  * <li>Set main language directory based on $_SESSION['language']</li>
  9.  * <li>Load all *header_php.php files from includes/modules/pages/PAGE_NAME/</li>
  10.  * <li>Load html_header.php (this is a common template file)</li>
  11.  * <li>Load main_template_vars.php (this is a common template file)</li>
  12.  * <li>Load on_load scripts (page based and site wide)</li>
  13.  * <li>Load tpl_main_page.php (this is a common template file)</li>
  14.  * <li>Load application_bottom.php</li>
  15.  * </ul>
  16.  *
  17.  * @package general
  18.  * @copyright Copyright 2003-2005 Zen Cart Development Team
  19.  * @copyright Portions Copyright 2003 osCommerce
  20.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  21.  * @version $Id: index.php 2942 2006-02-02 04:41:23Z drbyte $
  22.  */
  23. /**
  24.  * Load common library stuff
  25.  */
  26.   require('includes/application_top.php');
  27.  
  28.   $language_page_directory = DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
  29.   $directory_array = $template->get_template_part($code_page_directory, '/^header_php/');
  30.   foreach ($directory_array as $value) {
  31. /**
  32.  * We now load header code for a given page.
  33.  * Page code is stored in includes/modules/pages/PAGE_NAME/directory
  34.  * 'header_php.php' files in that directory are loaded now.
  35.  */
  36.     require($code_page_directory . '/' . $value);
  37.   }
  38.  
  39. /** START SEO-PRODUCT-TYPE-PATCH
  40.  *
  41.  * Modification to look up product type and adjust templates accordingly
  42.  * @author Andrew Ballanger
  43.  */
  44. if($current_page_base == FILENAME_PRODUCT_INFO) {
  45.     // Retrieve the product type handler from the database
  46.     $type = $db->Execute(
  47.         'SELECT pt.type_handler ' .
  48.         'FROM ' . TABLE_PRODUCTS . ' AS p ' .
  49.         'LEFT JOIN ' . TABLE_PRODUCT_TYPES . ' AS pt ON pt.type_id = p.products_type ' .
  50.         'WHERE p. products_id = \'' . (int)$_GET['products_id'] . '\' LIMIT 1'
  51.     );
  52.     if(!$type->EOF) {
  53.         $current_page_base = $type->fields['type_handler'] . '_info';
  54.     }
  55. }
  56. // END SEO-PRODUCT-TYPE-PATCH
  57.  
  58. /**
  59.  * We now load the html_header.php file. This file contains code that would appear within the HTML <head></head> code
  60.  * it is overridable on a template and page basis.
  61.  * In that a custom template can define its own common/html_header.php file
  62.  */
  63.   require($template->get_template_dir('html_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/html_header.php');
  64. /**
  65.  * Define Template Variables picked up from includes/main_template_vars.php unless a file exists in the
  66.  * includes/pages/{page_name}/directory to overide. Allowing different pages to have different overall
  67.  * templates.
  68.  */
  69.   require($template->get_template_dir('main_template_vars.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/main_template_vars.php');
  70. /**
  71.  * Read the "on_load" scripts for the individual page, and from the site-wide template settings
  72.  * NOTE: on_load_*.js files must contain just the raw code to be inserted in the <body> tag in the on_load="" parameter.
  73.  * Looking in "/includes/modules/pages" for files named "on_load_*.js"
  74.  */
  75.   $directory_array = $template->get_template_part(DIR_WS_MODULES . 'pages/' . $current_page_base, '/^on_load_/', '.js');
  76.   foreach ($directory_array as $value) {
  77.     $onload_file = DIR_WS_MODULES . 'pages/' . $current_page_base . '/' . $value;
  78.     $read_contents='';
  79.     $lines = @file($onload_file);
  80.     foreach($lines as $line) {
  81.       $read_contents .= $line;
  82.     }
  83.   $za_onload_array[] = $read_contents;
  84.   }
  85. /**
  86.  * now read "includes/templates/TEMPLATE/jscript/on_load/on_load_*.js", which would be site-wide settings
  87.  */
  88.   $directory_array=array();
  89.   $tpl_dir=$template->get_template_dir('.js', DIR_WS_TEMPLATE, 'jscript/on_load', 'jscript/on_load_');
  90.   $directory_array = $template->get_template_part($tpl_dir ,'/^on_load_/', '.js');
  91.   foreach ($directory_array as $value) {
  92.     $onload_file = $tpl_dir . '/' . $value;
  93.     $read_contents='';
  94.     $lines = @file($onload_file);
  95.     foreach($lines as $line) {
  96.       $read_contents .= $line;
  97.     }
  98.     $za_onload_array[] = $read_contents;
  99.   }
  100.  
  101.   // set $zc_first_field for backwards compatibility with previous version usage of this var
  102.   if (isset($zc_first_field) && $zc_first_field !='') $za_onload_array[] = $zc_first_field;
  103.  
  104.   $zv_onload = "";
  105.   if (isset($za_onload_array) && count($za_onload_array)>0) $zv_onload=implode(';',$za_onload_array);
  106.  
  107.   //ensure we have just one ';' between each, and at the end
  108.   $zv_onload = str_replace(';;',';',$zv_onload.';');
  109.  
  110.   // ensure that a blank list is truly blank and thus ignored.
  111.   if (trim($zv_onload) == ';') $zv_onload='';
  112. /**
  113.  * Define the template that will govern the overall page layout, can be done on a page by page basis
  114.  * or using a default template. The default template installed will be a standard 3 column layout. This
  115.  * template also loads the page body code based on the variable $body_code.
  116.  */
  117.   require($template->get_template_dir('tpl_main_page.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_main_page.php');
  118. ?>
  119. </html>
  120. <?php
  121. /**
  122.  * Load general code run before page closes
  123.  */
  124. ?>
  125. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


cron