[ 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/ -> specials_index.php (source)

   1  <?php
   2  /**

   3   * specials_index module

   4   *

   5   * @package modules

   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: specials_index.php 4629 2006-09-28 15:29:18Z ajeh $

  10   */
  11  if (!defined('IS_ADMIN_FLAG')) {
  12    die('Illegal Access');
  13  }
  14  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
  15    $specials_index_query = "select p.products_id, p.products_image, pd.products_name
  16                             from (" . TABLE_PRODUCTS . " p
  17                             left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id
  18                             left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
  19                             where p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1' and s.status = 1 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
  20  } else {
  21    $specials_index_query = "select distinct p.products_id, p.products_image, pd.products_name
  22                             from (" . TABLE_PRODUCTS . " p
  23                             left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id
  24                             left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id ), " .
  25    TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
  26    TABLE_CATEGORIES . " c
  27                             where p.products_id = p2c.products_id
  28                             and p2c.categories_id = c.categories_id
  29                             and c.parent_id = '" . (int)$new_products_category_id . "'
  30                             and p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1' and s.status = '1' and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
  31  
  32  }
  33  $specials_index = $db->ExecuteRandomMulti($specials_index_query, MAX_DISPLAY_SPECIAL_PRODUCTS_INDEX);
  34  
  35  $row = 0;
  36  $col = 0;
  37  $list_box_contents = array();
  38  $title = '';
  39  
  40  $num_products_count = $specials_index->RecordCount();
  41  // show only when 1 or more

  42  if ($num_products_count > 0) {
  43    if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS == 0 ) {
  44      $col_width = floor(100/$num_products_count);
  45    } else {
  46      $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS);
  47    }
  48  
  49    $list_box_contents = array();
  50    while (!$specials_index->EOF) {
  51  
  52      $products_price = zen_get_products_display_price($specials_index->fields['products_id']);
  53  
  54      $specials_index->fields['products_name'] = zen_get_products_name($specials_index->fields['products_id']);
  55      $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsSpecials centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
  56      'text' => (($specials_index->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'products_id=' . (int)$specials_index->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $specials_index->fields['products_image'], $specials_index->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'products_id=' . $specials_index->fields['products_id']) . '">' . $specials_index->fields['products_name'] . '</a><br />' . $products_price);
  57  
  58      $col ++;
  59      if ($col > (SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS - 1)) {
  60        $col = 0;
  61        $row ++;
  62      }
  63      $specials_index->MoveNextRandom();
  64    }
  65  
  66    if ($specials_index->RecordCount() > 0) {
  67      $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')) . '</h2>';
  68      $zc_show_specials = true;
  69    }
  70  }
  71  ?>


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