[ 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/pages/specials/ -> main_template_vars.php (source)

   1  <?php
   2  /**

   3   * Specials

   4   *

   5   * @package page

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

  10   */
  11  
  12  if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0 ) {
  13    $specials_query_raw = "SELECT p.products_id, p.products_image, pd.products_name
  14                           FROM (" . TABLE_PRODUCTS . " p
  15                           LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id
  16                           LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
  17                           WHERE p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1'
  18                           AND s.status = 1
  19                           AND pd.language_id = :languagesID
  20                           ORDER BY s.specials_date_added DESC";
  21  
  22    $specials_query_raw = $db->bindVars($specials_query_raw, ':languagesID', $_SESSION['languages_id'], 'integer');
  23    $specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);
  24    $specials = $db->Execute($specials_split->sql_query);
  25    $row = 0;
  26    $col = 0;
  27    $list_box_contents = array();
  28    $title = '';
  29  
  30    $num_products_count = $specials->RecordCount();
  31    if ($num_products_count) {
  32      if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS==0 ) {
  33        $col_width = floor(100/$num_products_count);
  34      } else {
  35        $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS);
  36      }
  37  
  38      $list_box_contents = array();
  39      while (!$specials->EOF) {
  40  
  41        $products_price = zen_get_products_display_price($specials->fields['products_id']);
  42        $specials->fields['products_name'] = zen_get_products_name($specials->fields['products_id']);
  43        $list_box_contents[$row][$col] = array('params' => 'class="specialsListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
  44                                               'text' => '<a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'products_id=' . $specials->fields['products_id']) . '">' . (($specials->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : zen_image(DIR_WS_IMAGES . $specials->fields['products_image'], $specials->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>') . '<br /><a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'products_id=' . $specials->fields['products_id']) . '">' . $specials->fields['products_name'] . '</a><br />' . $products_price);
  45        $col ++;
  46        if ($col > (SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS - 1)) {
  47          $col = 0;
  48          $row ++;
  49        }
  50        $specials->MoveNext();
  51      }
  52      require($template->get_template_dir('tpl_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_specials_default.php');
  53    }
  54  }
  55  ?>


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