zencart 1.5.1 英文原版,未改动, 先看源码:
1 <?php 2 /** 3 * Common Template - tpl_main_page.php 4 * 5 * Governs the overall layout of an entire page<br /> 6 * Normally consisting of a header, left side column. center column. right side column and footer<br /> 7 * For customizing, this file can be copied to /templates/your_template_dir/pagename<br /> 8 * example: to override the privacy page<br /> 9 * - make a directory /templates/my_template/privacy<br /> 10 * - copy /templates/templates_defaults/common/tpl_main_page.php to /templates/my_template/privacy/tpl_main_page.php<br /> 11 * <br /> 12 * to override the global settings and turn off columns un-comment the lines below for the correct column to turn off<br /> 13 * to turn off the header and/or footer uncomment the lines below<br /> 14 * Note: header can be disabled in the tpl_header.php<br /> 15 * Note: footer can be disabled in the tpl_footer.php<br /> 16 * <br /> 17 * $flag_disable_header = true;<br /> 18 * $flag_disable_left = true;<br /> 19 * $flag_disable_right = true;<br /> 20 * $flag_disable_footer = true;<br /> 21 * <br /> 22 * // example to not display right column on main page when Always Show Categories is OFF<br /> 23 * <br /> 24 * if ($current_page_base == 'index' and $cPath == '') {<br /> 25 * $flag_disable_right = true;<br /> 26 * }<br /> 27 * <br /> 28 * example to not display right column on main page when Always Show Categories is ON and set to categories_id 3<br /> 29 * <br /> 30 * if ($current_page_base == 'index' and $cPath == '' or $cPath == '3') {<br /> 31 * $flag_disable_right = true;<br /> 32 * }<br /> 33 * 34 * @package templateSystem 35 * @copyright Copyright 2003-2007 Zen Cart Development Team 36 * @copyright Portions Copyright 2003 osCommerce 37 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 38 * @version $Id: tpl_main_page.php 7085 2007-09-22 04:56:31Z ajeh $ 39 */ 40 41 // the following IF statement can be duplicated/modified as needed to set additional flags 42 if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) { 43 $flag_disable_right = true; 44 } 45 46 47 $header_template = 'tpl_header.php'; 48 $footer_template = 'tpl_footer.php'; 49 $left_column_file = 'column_left.php'; 50 $right_column_file = 'column_right.php'; 51 $body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']); 52 ?> 53 <body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' οnlοad="'.$zv_onload.'"'; ?>> 54 <?php 55 if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) { 56 if ($banner->RecordCount() > 0) { 57 ?> 58 <div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> 59 <?php 60 } 61 } 62 ?> 63 64 <div id="mainWrapper"> 65 <?php 66 /** 67 * prepares and displays header output 68 * 69 */ 70 if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_HEADER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) { 71 $flag_disable_header = true; 72 } 73 require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?> 74 75 <table width="100%" border="0" cellspacing="0" cellpadding="0" id="contentMainWrapper"> 76 <tr> 77 <?php 78 if (COLUMN_LEFT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) { 79 // global disable of column_left 80 $flag_disable_left = true; 81 } 82 if (!isset($flag_disable_left) || !$flag_disable_left) { 83 ?> 84 85 <td id="navColumnOne" class="columnLeft" style="width: <?php echo COLUMN_WIDTH_LEFT; ?>"> 86 <?php 87 /** 88 * prepares and displays left column sideboxes 89 * 90 */ 91 ?> 92 <div id="navColumnOneWrapper" style="width: <?php echo BOX_WIDTH_LEFT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_left.php')); ?></div></td> 93 <?php 94 } 95 ?> 96 <td valign="top"> 97 <!-- bof breadcrumb --> 98 <?php if (DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ) { ?> 99 <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div> 100 <?php } ?> 101 <!-- eof breadcrumb --> 102 103 <?php 104 if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) { 105 if ($banner->RecordCount() > 0) { 106 ?> 107 <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> 108 <?php 109 } 110 } 111 ?> 112 113 <!-- bof upload alerts --> 114 <?php if ($messageStack->size('upload') > 0) echo $messageStack->output('upload'); ?> 115 <!-- eof upload alerts --> 116 117 <?php 118 /** 119 * prepares and displays center column 120 * 121 */ 122 require($body_code); ?> 123 124 <?php 125 if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) { 126 if ($banner->RecordCount() > 0) { 127 ?> 128 <div id="bannerFour" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> 129 <?php 130 } 131 } 132 ?></td> 133 134 <?php 135 //if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' && $_SESSION['customers_authorization'] != 0)) { 136 if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) { 137 // global disable of column_right 138 $flag_disable_right = true; 139 } 140 if (!isset($flag_disable_right) || !$flag_disable_right) { 141 ?> 142 <td id="navColumnTwo" class="columnRight" style="width: <?php echo COLUMN_WIDTH_RIGHT; ?>"> 143 <?php 144 /** 145 * prepares and displays right column sideboxes 146 * 147 */ 148 ?> 149 <div id="navColumnTwoWrapper" style="width: <?php echo BOX_WIDTH_RIGHT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_right.php')); ?></div></td> 150 <?php 151 } 152 ?> 153 </tr> 154 </table> 155 156 <?php 157 /** 158 * prepares and displays footer output 159 * 160 */ 161 if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_FOOTER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) { 162 $flag_disable_footer = true; 163 } 164 require($template->get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php'); 165 ?> 166 167 </div> 168 <!--bof- parse time display --> 169 <?php 170 if (DISPLAY_PAGE_PARSE_TIME == 'true') { 171 ?> 172 <div class="smallText center">Parse Time: <?php echo $parse_time; ?> - Number of Queries: <?php echo $db->queryCount(); ?> - Query Time: <?php echo $db->queryTime(); ?></div> 173 <?php 174 } 175 ?> 176 <!--eof- parse time display --> 177 <!--bof- banner #6 display --> 178 <?php 179 if (SHOW_BANNERS_GROUP_SET6 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET6)) { 180 if ($banner->RecordCount() > 0) { 181 ?> 182 <div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> 183 <?php 184 } 185 } 186 ?> 187 <!--eof- banner #6 display --> 188 </body>
说明:
文件位置:includes\templates\template_default\common\tpl_main_page.php
文件功能:公共模板文件,网站整体布局页面,用于包含头部、脚部、左栏、右栏和内容区域。