博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
zencart首页index.php打开,index.php
阅读量:6643 次
发布时间:2019-06-25

本文共 4833 字,大约阅读时间需要 16 分钟。

/**

* index.php represents the hub of the Zen Cart MVC system

*

* Overview of flow

*

*

Load application_top.php - see {@tutorial initsystem}

*

Set main language directory based on $_SESSION['language']

*

Load all *header_php.php files from includes/modules/pages/PAGE_NAME/

*

Load html_header.php (this is a common template file)

*

Load main_template_vars.php (this is a common template file)

*

Load on_load scripts (page based and site wide)

*

Load tpl_main_page.php (this is a common template file)

*

Load application_bottom.php

*

*

* @package general

* @copyright Copyright 2003-2005 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: index.php 2942 2006-02-02 04:41:23Z drbyte $

*/

/**

* Load common library stuff

*/

require('includes/application_top.php');

$language_page_directory = DIR_WS_LANGUAGES . $_SESSION['language'] . '/';

$directory_array = $template->get_template_part($code_page_directory, '/^header_php/');

foreach ($directory_array as $value) {

/**

* We now load header code for a given page.

* Page code is stored in includes/modules/pages/PAGE_NAME/directory

* 'header_php.php' files in that directory are loaded now.

*/

require($code_page_directory . '/' . $value);

}

/** START SEO-PRODUCT-TYPE-PATCH

*

* Modification to look up product type and adjust templates accordingly

* @author Andrew Ballanger

*/

if($current_page_base == FILENAME_PRODUCT_INFO) {

// Retrieve the product type handler from the database

$type = $db->Execute(

'SELECT pt.type_handler ' .

'FROM ' . TABLE_PRODUCTS . ' AS p ' .

'LEFT JOIN ' . TABLE_PRODUCT_TYPES . ' AS pt ON pt.type_id = p.products_type ' .

'WHERE p. products_id = \'' . (int)$_GET['products_id'] . '\' LIMIT 1'

);

if(!$type->EOF) {

$current_page_base = $type->fields['type_handler'] . '_info';

}

}

// END SEO-PRODUCT-TYPE-PATCH

/**

* We now load the html_header.php file. This file contains code that would appear within the HTML

code

* it is overridable on a template and page basis.

* In that a custom template can define its own common/html_header.php file

*/

require($template->get_template_dir('html_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/html_header.php');

/**

* Define Template Variables picked up from includes/main_template_vars.php unless a file exists in the

* includes/pages/{page_name}/directory to overide. Allowing different pages to have different overall

* templates.

*/

require($template->get_template_dir('main_template_vars.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/main_template_vars.php');

/**

* Read the "on_load" scripts for the individual page, and from the site-wide template settings

* NOTE: on_load_*.js files must contain just the raw code to be inserted in the

tag in the on_load="" parameter.

* Looking in "/includes/modules/pages" for files named "on_load_*.js"

*/

$directory_array = $template->get_template_part(DIR_WS_MODULES . 'pages/' . $current_page_base, '/^on_load_/', '.js');

foreach ($directory_array as $value) {

$onload_file = DIR_WS_MODULES . 'pages/' . $current_page_base . '/' . $value;

$read_contents='';

$lines = @file($onload_file);

foreach($lines as $line) {

$read_contents .= $line;

}

$za_onload_array[] = $read_contents;

}

/**

* now read "includes/templates/TEMPLATE/jscript/on_load/on_load_*.js", which would be site-wide settings

*/

$directory_array=array();

$tpl_dir=$template->get_template_dir('.js', DIR_WS_TEMPLATE, 'jscript/on_load', 'jscript/on_load_');

$directory_array = $template->get_template_part($tpl_dir ,'/^on_load_/', '.js');

foreach ($directory_array as $value) {

$onload_file = $tpl_dir . '/' . $value;

$read_contents='';

$lines = @file($onload_file);

foreach($lines as $line) {

$read_contents .= $line;

}

$za_onload_array[] = $read_contents;

}

// set $zc_first_field for backwards compatibility with previous version usage of this var

if (isset($zc_first_field) && $zc_first_field !='') $za_onload_array[] = $zc_first_field;

$zv_onload = "";

if (isset($za_onload_array) && count($za_onload_array)>0) $zv_οnlοad=implode(';',$za_onload_array);

//ensure we have just one ';' between each, and at the end

$zv_onload = str_replace(';;',';',$zv_onload.';');

// ensure that a blank list is truly blank and thus ignored.

if (trim($zv_onload) == ';') $zv_οnlοad='';

/**

* Define the template that will govern the overall page layout, can be done on a page by page basis

* or using a default template. The default template installed will be a standard 3 column layout. This

* template also loads the page body code based on the variable $body_code.

*/

require($template->get_template_dir('tpl_main_page.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_main_page.php');

?>

/**

* Load general code run before page closes

*/

?>

一键复制

编辑

Web IDE

原始数据

按行查看

历史

转载地址:http://jbevo.baihongyu.com/

你可能感兴趣的文章
HiWorkV1.3版震撼公布,今日起正式公开測试!
查看>>
(七)Thymeleaf的 th:* 属性之—— th: ->设值& 遍历迭代& 条件判断
查看>>
linux 线程切换效率与进程切换效率相差究竟有多大?
查看>>
Tensorflow一些常用基本概念与函数
查看>>
2014中国民营企业500强在京津冀经济区、珠江三角洲、长江三角洲分布
查看>>
【JEECG技术博文】JEECG 简单实例解说权限控制
查看>>
如果想从jenkins直接生成docker镜像,并推送到harbor中,最简单的脚本如何实现?...
查看>>
条件随机场CRF(二) 前向后向算法评估标记序列概率
查看>>
codecombat之边远地区的森林1-11关及地牢38关代码分享
查看>>
小米2S电池电量用尽充电无法开机解决方法
查看>>
确定性这剂毒药,你喝过没
查看>>
GODOT 3.0 开发进度汇报 #6
查看>>
c#简单写售票系统
查看>>
简单RPC框架-业务线程池
查看>>
Swift iOS tableView static cell动态计算高度
查看>>
POJ - 3164 Command Network(朱刘算法)
查看>>
phalcon:官方多模块支models层,mode数据库配置
查看>>
Java并发编程:Callable、Future和FutureTask
查看>>
【日常学习】【IDA*】codevs2449 骑士精神题解
查看>>
[C#]非阻塞监听键盘输入
查看>>