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

Zen Cart 源代码 init_add_crumbs.php




下载文件

文件名: init_add_crumbs.php
文件类型: PHP文件
文件大小: 3.09 KiB
MD5: df91f10859cb05a2e914e63917022b33

init_add_crumbs.php - 关闭高亮
  1. <?php
  2. /**
  3.  * create the breadcrumb trail
  4.  * see {@link  http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.
  5.  *
  6.  * @package initSystem
  7.  * @copyright Copyright 2003-2010 Zen Cart Development Team
  8.  * @copyright Portions Copyright 2003 osCommerce
  9.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  10.  * @version $Id: init_add_crumbs.php 16607 2010-06-03 12:37:20Z drbyte $
  11.  */
  12. if (!defined('IS_ADMIN_FLAG')) {
  13.   die('Illegal Access');
  14. }
  15. $breadcrumb->add(HEADER_TITLE_CATALOG, zen_href_link(FILENAME_DEFAULT));
  16. /**
  17.  * add category names or the manufacturer name to the breadcrumb trail
  18.  */
  19. $robotsNoIndex = false;
  20. // might need isset($_GET['cPath']) later ... right now need $cPath or breaks breadcrumb from sidebox etc.
  21. if (isset($cPath_array) && isset($cPath)) {
  22.   for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
  23.     $categories_query = "select categories_name
  24.                           from " . TABLE_CATEGORIES_DESCRIPTION . "
  25.                           where categories_id = '" . (int)$cPath_array[$i] . "'
  26.                           and language_id = '" . (int)$_SESSION['languages_id'] . "'";
  27.  
  28.     $categories = $db->Execute($categories_query);
  29. //echo 'I SEE ' . (int)$cPath_array[$i] . '<br>';
  30.     if ($categories->RecordCount() > 0) {
  31.       $breadcrumb->add($categories->fields['categories_name'], zen_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
  32.     } elseif(SHOW_CATEGORIES_ALWAYS == 0) {
  33.       // if invalid, set the robots noindex/nofollow for this page
  34.       $robotsNoIndex = true;
  35.       break;
  36.     }
  37.   }
  38. }
  39. /**
  40.  * add get terms (e.g manufacturer, music genre, record company or other user defined selector) to breadcrumb
  41.  */
  42. $sql = "select *
  43.        from " . TABLE_GET_TERMS_TO_FILTER;
  44. $get_terms = $db->execute($sql);
  45. while (!$get_terms->EOF) {
  46.     if (isset($_GET[$get_terms->fields['get_term_name']])) {
  47.         $sql = "select " . $get_terms->fields['get_term_name_field'] . "
  48.                 from " . constant($get_terms->fields['get_term_table']) . "
  49.                 where " . $get_terms->fields['get_term_name'] . " =  " . (int)$_GET[$get_terms->fields['get_term_name']];
  50.         $get_term_breadcrumb = $db->execute($sql);
  51.     if ($get_term_breadcrumb->RecordCount() > 0) {
  52.       $breadcrumb->add($get_term_breadcrumb->fields[$get_terms->fields['get_term_name_field']], zen_href_link(FILENAME_DEFAULT, $get_terms->fields['get_term_name'] . "=" . $_GET[$get_terms->fields['get_term_name']]));
  53.     }
  54.     }
  55.     $get_terms->movenext();
  56. }
  57. /**
  58.  * add the products model to the breadcrumb trail
  59.  */
  60. if (isset($_GET['products_id'])) {
  61.   $productname_query = "select products_name
  62.                   from " . TABLE_PRODUCTS_DESCRIPTION . "
  63.                   where products_id = '" . (int)$_GET['products_id'] . "'
  64.             and language_id = '" . $_SESSION['languages_id'] . "'";
  65.  
  66.   $productname = $db->Execute($productname_query);
  67.  
  68.   if ($productname->RecordCount() > 0) {
  69.     $breadcrumb->add($productname->fields['products_name'], zen_href_link(zen_get_info_page($_GET['products_id']), 'cPath=' . $cPath . '&products_id=' . $_GET['products_id']));
  70.   }
  71. }
  72. ?>