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

Zen Cart 源代码 tpl_categories.php




下载文件

文件名: tpl_categories.php
文件类型: PHP文件
文件大小: 4.43 KiB
MD5: 521e70ea0d99f8abc8eac3fc7da1a91c

tpl_categories.php - 关闭高亮
  1. <?php
  2. /**
  3.  * Side Box Template
  4.  *
  5.  * @package templateSystem
  6.  * @copyright Copyright 2003-2006 Zen Cart Development Team
  7.  * @copyright Portions Copyright 2003 osCommerce
  8.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  9.  * @version $Id: tpl_categories.php 4162 2006-08-17 03:55:02Z ajeh $
  10.  */
  11.   $content = "";
  12.  
  13.   $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
  14.   for ($i=0;$i<sizeof($box_categories_array);$i++) {
  15.     switch(true) {
  16. // to make a specific category stand out define a new class in the stylesheet example: A.category-holiday
  17. // uncomment the select below and set the cPath=3 to the cPath= your_categories_id
  18. // many variations of this can be done
  19. //      case ($box_categories_array[$i]['path'] == 'cPath=3'):
  20. //        $new_style = 'category-holiday';
  21. //        break;
  22.       case ($box_categories_array[$i]['top'] == 'true'):
  23.         $new_style = 'category-top';
  24.         break;
  25.       case ($box_categories_array[$i]['has_sub_cat']):
  26.         $new_style = 'category-subs';
  27.         break;
  28.       default:
  29.         $new_style = 'category-products';
  30.       }
  31.      if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
  32.         // skip if this is for the document box (==3)
  33.       } else {
  34.       $content .= '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
  35.  
  36.       if ($box_categories_array[$i]['current']) {
  37.         if ($box_categories_array[$i]['has_sub_cat']) {
  38.           $content .= '<span class="category-subs-parent">' . $box_categories_array[$i]['name'] . '</span>';
  39.         } else {
  40.           $content .= '<span class="category-subs-selected">' . $box_categories_array[$i]['name'] . '</span>';
  41.         }
  42.       } else {
  43.         $content .= $box_categories_array[$i]['name'];
  44.       }
  45.  
  46.       if ($box_categories_array[$i]['has_sub_cat']) {
  47.         $content .= CATEGORIES_SEPARATOR;
  48.       }
  49.       $content .= '</a>';
  50.  
  51.       if (SHOW_COUNTS == 'true') {
  52.         if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
  53.           $content .= CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX;
  54.         }
  55.       }
  56.  
  57.       $content .= '<br />' . "\n";
  58.     }
  59.   }
  60.  
  61.   if (SHOW_CATEGORIES_BOX_SPECIALS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true' or SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
  62. // display a separator between categories and links
  63.     if (SHOW_CATEGORIES_SEPARATOR_LINK == '1') {
  64.       $content .= '<hr id="catBoxDivider" />' . "\n";
  65.     }
  66.     if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
  67.       $show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
  68.       if ($show_this->RecordCount() > 0) {
  69.         $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . CATEGORIES_BOX_HEADING_SPECIALS . '</a>' . '<br />' . "\n";
  70.       }
  71.     }
  72.     if (SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true') {
  73.       // display limits
  74. //      $display_limit = zen_get_products_new_timelimit();
  75.       $display_limit = zen_get_new_date_range();
  76.  
  77.       $show_this = $db->Execute("select p.products_id
  78.                                 from " . TABLE_PRODUCTS . " p
  79.                                 where p.products_status = 1 " . $display_limit . " limit 1");
  80.       if ($show_this->RecordCount() > 0) {
  81.         $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_NEW) . '">' . CATEGORIES_BOX_HEADING_WHATS_NEW . '</a>' . '<br />' . "\n";
  82.       }
  83.     }
  84.     if (SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true') {
  85.       $show_this = $db->Execute("select products_id from " . TABLE_FEATURED . " where status= 1 limit 1");
  86.       if ($show_this->RecordCount() > 0) {
  87.         $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . CATEGORIES_BOX_HEADING_FEATURED_PRODUCTS . '</a>' . '<br />' . "\n";
  88.       }
  89.     }
  90.     if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
  91.       $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
  92.     }
  93.   }
  94.   $content .= '</div>';
  95. ?>


cron