[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/includes/init_includes/ -> init_add_crumbs.php (source)

   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-2005 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 4355 2006-09-02 23:04:12Z ajeh $

  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  // might need isset($_GET['cPath']) later ... right now need $cPath or breaks breadcrumb from sidebox etc.

  20  if (isset($cPath_array) && isset($cPath)) {
  21    for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
  22      $categories_query = "select categories_name
  23                             from " . TABLE_CATEGORIES_DESCRIPTION . "
  24                             where categories_id = '" . (int)$cPath_array[$i] . "'
  25                             and language_id = '" . (int)$_SESSION['languages_id'] . "'";
  26  
  27      $categories = $db->Execute($categories_query);
  28  //echo 'I SEE ' . (int)$cPath_array[$i] . '<br>';

  29      if ($categories->RecordCount() > 0) {
  30        $breadcrumb->add($categories->fields['categories_name'], zen_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
  31      } else {
  32        break;
  33      }
  34    }
  35  }
  36  /**

  37   * add get terms (e.g manufacturer, music genre, record company or other user defined selector) to breadcrumb

  38   */
  39  $sql = "select *
  40          from " . TABLE_GET_TERMS_TO_FILTER;
  41  $get_terms = $db->execute($sql);
  42  while (!$get_terms->EOF) {
  43      if (isset($_GET[$get_terms->fields['get_term_name']])) {
  44          $sql = "select " . $get_terms->fields['get_term_name_field'] . "
  45                  from " . constant($get_terms->fields['get_term_table']) . "
  46                  where " . $get_terms->fields['get_term_name'] . " =  " . (int)$_GET[$get_terms->fields['get_term_name']];
  47          $get_term_breadcrumb = $db->execute($sql);
  48      if ($get_term_breadcrumb->RecordCount() > 0) {
  49        $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']]));
  50      }
  51      }
  52      $get_terms->movenext();
  53  }
  54  /**

  55   * add the products model to the breadcrumb trail

  56   */
  57  if (isset($_GET['products_id'])) {
  58    $productname_query = "select products_name
  59                     from " . TABLE_PRODUCTS_DESCRIPTION . "
  60                     where products_id = '" . (int)$_GET['products_id'] . "'
  61               and language_id = '" . $_SESSION['languages_id'] . "'";
  62  
  63    $productname = $db->Execute($productname_query);
  64  
  65    if ($productname->RecordCount() > 0) {
  66      $breadcrumb->add($productname->fields['products_name'], zen_href_link(zen_get_info_page($_GET['products_id']), 'cPath=' . $cPath . '&products_id=' . $_GET['products_id']));
  67    }
  68  }
  69  ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics