[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.07 KiB
MD5: 9366f568d8f8611bae3e6d653aa15c60

upcoming_products.php - 关闭高亮
  1. <?php
  2. /**
  3.  * upcoming_products module
  4.  *
  5.  * @package modules
  6.  * @copyright Copyright 2003-2008 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 8730 2008-06-28 01:31:22Z drbyte $
  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. $limit_clause = "  order by " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . "
  22.                   limit " . MAX_DISPLAY_UPCOMING_PRODUCTS;
  23.  
  24. 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') ) {
  25.   $expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected, p.master_categories_id
  26.                     from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
  27.                     where p.products_id = pd.products_id
  28.                     and p.products_status = 1
  29.                     and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
  30.                      $display_limit .
  31.                      $limit_clause;
  32. } else {
  33.   // get all products and cPaths in this subcat tree
  34.   $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);
  35.  
  36.   if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
  37.     // build products-list string to insert into SQL query
  38.     foreach($productsInCategory as $key => $value) {
  39.       $list_of_products .= $key . ', ';
  40.     }
  41.     $list_of_products = substr($list_of_products, 0, -2); // remove trailing comma
  42.  
  43.     $expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected, p.master_categories_id
  44.                       from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
  45.                       where p.products_id = pd.products_id
  46.                       and p.products_id in (" . $list_of_products . ")
  47.                       and p.products_status = 1
  48.                       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
  49.                        $display_limit .
  50.                        $limit_clause;
  51.   }
  52. }
  53.  
  54. if ($expected_query != '') $expected = $db->Execute($expected_query);
  55. if ($expected_query != '' && $expected->RecordCount() > 0) {
  56.   while (!$expected->EOF) {
  57.     if (!isset($productsInCategory[$expected->fields['products_id']])) $productsInCategory[$expected->fields['products_id']] = zen_get_generated_category_path_rev($expected->fields['master_categories_id']);
  58.     $expectedItems[] = $expected->fields;
  59.     $expected->MoveNext();
  60.   }
  61.   require($template->get_template_dir('tpl_modules_upcoming_products.php', DIR_WS_TEMPLATE, $current_page_base,'templates'). '/' . 'tpl_modules_upcoming_products.php');
  62. }
  63. ?>