zencart模板系统文件笔记1:html_header.php
(zencart建站vip内部交流俱乐部--体验)
文件名:html_header.php
文件隶属于:英文版zen-cart-v139h
文件路径:includes\templates\template_default\common/html_header.php
系统上隶属于:公共模板文件
主要功能:输出html页面的头部head标签的内容
主要包括:标题、meta信息[关键词、描述、...]、载入js、css等
<?php
/**
*Common Template
*
*outputs the html header.i,e,everything that comes before the\</head\>tag<br/>
*
*@package templateSystem
*@copyright Copyright2003-2010Zen Cart Development Team
*@copyright Portions Copyright2003osCommerce
*@license -cart/license/ GNU Public License V2.0
*@version$Id:html_header.php157612010-03-3119:31:27Z drbyte$
*/
/**
*load the module for generating page meta-tags
*/
require(DIR__get_module_directory('meta_tags.php'));//调用meta_tags.php
/**
*output main page HEAD tag and related headers/meta-tags,etc免费管理系统html模板
*/
?>
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML1.0Transitional//EN"
"/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="/1999/xhtml"<?php echo HTML_PARAMS;?>>
<head>
<title><?php echo META_TAG_TITLE;?></title>//输出定义的标题
<meta http-equiv="Content-Type"content="text/html;charset=<?php echo CHARSET;?>"/>//编码定义<meta name="keywords"content="<?php echo META_TAG_KEYWORDS;?>"/>//关键词内容
<meta name="description"content="<?php echo META_TAG_DESCRIPTION;?>"/>//描述内容
<meta http-equiv="imagetoolbar"content="no"/>
<meta name="author"content="The Zen Cart™Team and others"/>
<meta name="generator"content="shopping cart program by Zen Cart™,-cart eCommerce"/>
<?php if(defined('ROBOTS_PAGES_TO_SKIP')&&
in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP')))||
$current_page_base=='down_for_maintenance'||$robotsNoIndex===true){?>
<meta name="robots"content="noindex,nofollow"/>
<?php}?>//如定义ROBOTS_PAGES_TO_SKIP,页面维护检查,则noindex,nofollow
<?php if(defined('FA VICON')){?>
<link rel="icon"href="<?php echo FAVICON;?>"type="image/x-icon"/>
<link rel="shortcut icon"href="<?php echo FA VICON;?>"type="image/x-icon"/>
<?php}//endif FAVICON?>//快捷方式图标
<base href="<?php echo(($request_type=='SSL')?HTTPS_SERVER.DIR_WS_HTTPS_CATALOG: HTTP_SERVER.DIR_WS_CATALOG);?>"/>
<?php if(isset($canonicalLink)&&$canonicalLink!=''){?>
<link rel="canonical"href="<?php echo$canonicalLink;?>"/>
<?php}?>
<?php
/**************************************************************************************** *载入css样式文件
****************************************************************************************/ $directory_array=$template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'),'/^style/','.css');
while(list($key,$value)=each($directory_array)){
echo'<link rel="stylesheet"type="text/css"href="'.
$template->get_template_dir('.css',DIR_WS_TEMPLATE,$current_page_base,'css').'/'.$value.'"/>'."\n"; }
/**
给特定页面载入特定样式文件内容
*/
$manufacturers_id=(isset($_GET['manufacturers_id']))?$_GET['manufacturers_id']:'';
$tmp_products_id=(isset($_GET['products_id']))?(int)$_GET['products_id']:'';
$tmp_pagename=($this_is_home_page)?'index_home':$current_page_base;
if($current_page_base=='page'&&isset($ezpage_id))$tmp_pagename=$current_page_base.
(int)$ezpage_id;
$sheets_array=array('/'.$_SESSION['language'].'_stylesheet',
'/'.$tmp_pagename,
'/'.$_SESSION['language'].'_'.$tmp_pagename,
'/c_'.$cPath,
'/'.$_SESSION['language'].'_c_'.$cPath,
'/m_'.$manufacturers_id,
'/'.$_SESSION['language'].'_m_'.(int)$manufacturers_id,
'/p_'.$tmp_products_id,
'/'.$_SESSION['language'].'_p_'.$tmp_products_id
);
while(list($key,$value)=each($sheets_array)){
//echo"<!--looking for:$value-->\n";
$perpagefile=$template->get_template_dir('.css',DIR_WS_TEMPLATE,$current_page_base,'css'). $value.'.css';
if(file_exists($perpagefile))echo'<link rel="stylesheet"type="text/css"href="'.$perpagefile.'"/>'."\n"; }
/**
*载入打印css文件
*/
$directory_array=$template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'),'/^print/','.css');
sort($directory_array);
while(list($key,$value)=each($directory_array)){
echo'<link rel="stylesheet"type="text/css"media="print"href="'.
$template->get_template_dir('.css',DIR_WS_TEMPLATE,$current_page_base,'css').'/'.$value.'"/>'."\n"; }
/**
*从你的模板上载入js文件
*/
$directory_array=$template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'),'/^jscript_/','.js');
while(list($key,$value)=each($directory_array)){
echo'<script type="text/javascript"src="'.$template->get_template_dir('.js',DIR_WS_TEMPLATE, $cur
rent_page_base,'jscript').'/'.$value.'"></script>'."\n";
}
/**
**从你的模板上载入特定页面的js文件
*/
$directory_array=$template->get_template_part($page_directory,'/^jscript_/','.js');
while(list($key,$value)=each($directory_array)){
echo'<script type="text/javascript"src="'.$page_directory.'/'.$value.'"></script>'."\n";
}
/**
*load all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript,alphabetically
*/
$directory_array=$template->get_template_part($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript'),'/^jscript_/','.php');
while(list($key,$value)=each($directory_array)){
/**
*include content from all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically.
*These.PHP files can be manipulated by PHP when they're called,and are copied in-full to the browser page
*/
require($template->get_template_dir('.php',DIR_WS_TEMPLATE,$current_page_base,'jscript').'/'.$value); echo"\n";
}
/**
*include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
*/
$directory_array=$template->get_template_part($page_directory,'/^jscript_/');
while(list($key,$value)=each($directory_array)){
/**
*include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
*These.PHP files can be manipulated by PHP when they're called,and are copied in-full to the browser page
*/
require($page_directory.'/'.$value);echo"\n";
}
//DEBUG:echo'<!--I SEE cat:'.$current_category_id.'||vs cpath:'.$cPath.'||page:'.$current_page.'|| template:'.$current_template.'||main='.($this_is_home_page?'YES':'NO').'-->';
?>
</head>
<?php//NOTE:Blank line following is intended:?>
这是“外贸建站推广分享社区"zencart自主开发建站的系列免费体验教程,如你想自主建站,更深入地了解zencart建站仿站和定制,欢迎你加入我们的vip内部交流俱乐部.
《zencart模板系统文件笔记》是内部会员特权,只分享到第十篇
更多内容请:
©2012陈金凌-外贸建站推广分享社区.版权所有.
欢迎传阅,请勿修改版权信息,谢谢合作!

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。