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

Zen Cart 源代码 class.products_viewed_counter.php




下载文件

文件名: class.products_viewed_counter.php
文件类型: PHP文件
文件大小: 1016 Bytes
MD5: 57b3eca551fff83959c9262ffe127b1a

class.products_viewed_counter.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package plugins
  4.  * @copyright Copyright 2003-2012 Zen Cart Development Team
  5.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  6.  * @version GIT: $Id: Author: DrByte  Tue Aug 28 14:21:34 2012 -0400 New in v1.5.1 $
  7.  *
  8.  * Designed for v1.5.1
  9.  */
  10.  
  11. class products_viewed_counter extends base {
  12.  
  13.   function __construct() {
  14.     $this->attach($this, array('NOTIFY_PRODUCT_VIEWS_HIT_INCREMENTOR'));
  15.   }
  16.  
  17.   function update(&$class, $eventID, $paramsArray = array())
  18.   {
  19.     if ($eventID == 'NOTIFY_PRODUCT_VIEWS_HIT_INCREMENTOR')
  20.     {
  21.       if (defined('LEGACY_PRODUCTS_VIEWED_COUNTER') && LEGACY_PRODUCTS_VIEWED_COUNTER == 'on')
  22.       {
  23.         global $db;
  24.         $sql = "update " . TABLE_PRODUCTS_DESCRIPTION . "
  25.                set        products_viewed = products_viewed+1
  26.                where      products_id = '" . (int)$paramsArray . "'
  27.                and        language_id = '" . (int)$_SESSION['languages_id'] . "'";
  28.         $res = $db->Execute($sql);
  29.       }
  30.     }
  31.   }
  32. }
  33.