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

Zen Cart 源代码 upcoming_products.php




下载文件

文件名: upcoming_products.php
文件类型: PHP文件
文件大小: 3.16 KiB
MD5: 4301baa6a569dbd3316b347f77a9a2ab

upcoming_products.php - 关闭高亮
  1. <?php
  2. /**
  3.  * upcoming_products module
  4.  *
  5.  * @package modules
  6.  * @copyright Copyright 2003-2011 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: upcoming_products.php 18923 2011-06-13 03:40:09Z wilt $
  10.  */
  11. if (!defined('IS_ADMIN_FLAG')) {
  12.   die('Illegal Access');
  13. }
  14.  
  15. // initialize vars
  16. $categories_products_id_list = '';
  17. $list_of_products = '';
  18. $expected_query = '';
  19.  
  20. $display_limit = zen_get_upcoming_date_range();
  21.  
  22. $limit_clause = "  order by " . (EXPECTED_PRODUCTS_FIELD == 'date_expected' ? 'date_expected' : 'products_name') . " " . (EXPECTED_PRODUCTS_SORT == 'asc' ? 'asc' : 'desc') . "
  23.                   limit " . (int)MAX_DISPLAY_UPCOMING_PRODUCTS;
  24.  
  25. if ( (($manufacturers_id > 0 && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > 0 || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) {
  26.   $expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected, p.master_categories_id
  27.                     from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
  28.                     where p.products_id = pd.products_id
  29.                     and p.products_status = 1
  30.                     and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
  31.                      $display_limit .
  32.                      $limit_clause;
  33. } else {
  34.   // get all products and cPaths in this subcat tree
  35.   $productsInCategory = zen_get_categories_products_list( (($manufacturers_id > 0 && $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath), false, true, 0, $display_limit);
  36.  
  37.   if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
  38.     // build products-list string to insert into SQL query
  39.     foreach($productsInCategory as $key => $value) {
  40.       $list_of_products .= $key . ', ';
  41.     }
  42.     $list_of_products = substr($list_of_products, 0, -2); // remove trailing comma
  43.  
  44.     $expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected, p.master_categories_id
  45.                       from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
  46.                       where p.products_id = pd.products_id
  47.                       and p.products_id in (" . $list_of_products . ")
  48.                       and p.products_status = 1
  49.                       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
  50.                        $display_limit .
  51.                        $limit_clause;
  52.   }
  53. }
  54.  
  55. if ($expected_query != '') $expected = $db->Execute($expected_query);
  56. if ($expected_query != '' && $expected->RecordCount() > 0) {
  57.   while (!$expected->EOF) {
  58.     if (!isset($productsInCategory[$expected->fields['products_id']])) $productsInCategory[$expected->fields['products_id']] = zen_get_generated_category_path_rev($expected->fields['master_categories_id']);
  59.     $expectedItems[] = $expected->fields;
  60.     $expected->MoveNext();
  61.   }
  62.   require($template->get_template_dir('tpl_modules_upcoming_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_upcoming_products.php');
  63. }
  64.