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

Zen Cart 源代码 product_notifications.php




下载文件

文件名: product_notifications.php
文件类型: PHP文件
文件大小: 2.28 KiB
MD5: a096556296bd30932063008baaf15129

product_notifications.php - 关闭高亮
  1. <?php
  2. /**
  3.  * product_notifications sidebox - displays a box inviting the customer to sign up for notifications of updates to current 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: product_notifications.php 2993 2006-02-08 07:14:52Z birdbrain $
  10.  */
  11.  
  12. // test if box should show
  13.   $show_product_notifications = false;
  14.  
  15.   if (isset($_GET['products_id']) and zen_products_id_valid($_GET['products_id'])) {
  16.     if (isset($_SESSION['customer_id'])) {
  17.       $check_query = "select count(*) as count
  18.                      from " . TABLE_CUSTOMERS_INFO . "
  19.                      where customers_info_id = '" . (int)$_SESSION['customer_id'] . "'
  20.                      and global_product_notifications = '1'";
  21.  
  22.       $check = $db->Execute($check_query);
  23.  
  24.       if ($check->fields['count'] <= 0) {
  25.         $show_product_notifications= true;
  26.       }
  27.     } else {
  28.       $show_product_notifications= true;
  29.     }
  30.   }
  31.  
  32. if ($show_product_notifications == true) {
  33.   if (isset($_GET['products_id'])) {
  34.     if (isset($_SESSION['customer_id'])) {
  35.       $check_query = "select count(*) as count
  36.                      from " . TABLE_PRODUCTS_NOTIFICATIONS . "
  37.                      where products_id = '" . (int)$_GET['products_id'] . "'
  38.                      and customers_id = '" . (int)$_SESSION['customer_id'] . "'";
  39.  
  40.       $check = $db->Execute($check_query);
  41.  
  42.       $notification_exists = (($check->fields['count'] > 0) ? true : false);
  43.     } else {
  44.       $notification_exists = false;
  45.     }
  46.  
  47.     if ($notification_exists == true) {
  48.       require($template->get_template_dir('tpl_yes_notifications.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_yes_notifications.php');
  49.     } else {
  50.       require($template->get_template_dir('tpl_no_notifications.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_no_notifications.php');
  51.     }
  52.     $title =  BOX_HEADING_NOTIFICATIONS;
  53.     $box_id = 'productnotifications';
  54.     $title_link = false;
  55.     require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
  56.   }
  57. }
  58. ?>


cron