[ 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/modules/sideboxes/ -> featured.php (source)

   1  <?php
   2  /**

   3   * featured sidebox - displays a random Featured Product

   4   *

   5   * @package templateSystem

   6   * @copyright Copyright 2003-2005 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: featured.php 2808 2006-01-06 17:17:32Z drbyte $

  10   */
  11  
  12  // test if box should display

  13    $show_featured= true;
  14  
  15    if ($show_featured == true) {
  16      $random_featured_products_query = "select p.products_id, p.products_image, pd.products_name
  17                             from (" . TABLE_PRODUCTS . " p
  18                             left join " . TABLE_FEATURED . " f on p.products_id = f.products_id
  19                             left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
  20                             where p.products_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
  21                             order by pd.products_name desc
  22                             limit " . MAX_RANDOM_SELECT_FEATURED_PRODUCTS;
  23  
  24      // randomly select ONE featured product from the list retrieved:

  25      $random_featured_product = zen_random_select($random_featured_products_query);
  26  
  27      if ($random_featured_product->RecordCount() > 0)  {
  28        $featured_box_price = zen_get_products_display_price($random_featured_product->fields['products_id']);
  29  
  30        require($template->get_template_dir('tpl_featured.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_featured.php');
  31        $title =  BOX_HEADING_FEATURED_PRODUCTS;
  32        $title_link = FILENAME_FEATURED_PRODUCTS;
  33        require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
  34      }
  35    }
  36  ?>


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