⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 specials.php

📁 PHP 建站工具,CMS系统,类似与oscommerce
💻 PHP
字号:
<?php
/* -----------------------------------------------------------------------------------------
   $Id: specials.php,v 1.3 2004/03/16 14:59:01 oldpa Exp $   

   TWE-Commerce - community made shopping   http://www.oldpa.com.tw   Copyright (c) 2003 TWE-Commerce
   -----------------------------------------------------------------------------------------
   based on: 
   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
   (c) 2002-2003 osCommerce(specials.php,v 1.30 2003/02/10); www.oscommerce.com 
   (c) 2003	 nextcommerce (specials.php,v 1.10 2003/08/17); www.nextcommerce.org   
   (c) 2003	 xt-commerce  www.xt-commerce.com
   Released under the GNU General Public License 
---------------------------------------------------------------------------------------*/
$box_smarty = new smarty;
$box_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/'); 
$box_content='';
  // include needed functions
  require_once(DIR_FS_INC . 'twe_random_select.inc.php');
  require_once(DIR_FS_INC . 'twe_get_products_price.inc.php');

      //fsk18 lock
  $fsk_lock='';
  if ($_SESSION['customers_status']['customers_fsk18_display']=='0') {
  $fsk_lock=' and p.products_fsk18!=1';
  }
  if (GROUP_CHECK=='true') {
   $group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'";
  }
  if ($random_product = twe_random_select("select
                                           p.products_id,
                                           pd.products_name,
                                           p.products_price,
                                           p.products_tax_class_id,
                                           p.products_image,
                                           s.expires_date,
                                           s.specials_new_products_price
                                           from " . TABLE_PRODUCTS . " p,
                                           " . TABLE_PRODUCTS_DESCRIPTION . " pd,
                                           " . TABLE_SPECIALS .
                                           " s where p.products_status = '1'
                                           and p.products_id = s.products_id
                                           and pd.products_id = s.products_id ".$fsk_lock."
                                           and pd.language_id = '" . $_SESSION['languages_id'] . "'
                                           and s.status = '1'
                                           ".$group_check."
                                           order by s.specials_date_added
                                           desc limit " . MAX_RANDOM_SELECT_SPECIALS)) 
										   {

  }
    $box_smarty->assign('LINK',twe_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]));
    $box_smarty->assign('IMAGE',DIR_WS_THUMBNAIL_IMAGES . $random_product['products_image']);
    $box_smarty->assign('NAME',$random_product['products_name']);
    $box_smarty->assign('PRICE',twe_get_products_price($random_product['products_id'],$price_special=1,$quantity=1));
    $box_smarty->assign('EXPIRES',$random_product['expires_date']);

    $box_content='<a href="' . twe_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . twe_image(DIR_WS_THUMBNAIL_IMAGES . $random_product['products_image'], $random_product['products_name'], PRODUCT_IMAGE_THUMBNAIL_WIDTH, PRODUCT_IMAGE_THUMBNAIL_HEIGHT) . '</a><br><a href="' . twe_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>'.twe_get_products_price($random_product['products_id'],$price_special=1,$quantity=1);

    $box_smarty->assign('SPECIALS_LINK',twe_href_link(FILENAME_SPECIALS));


	$box_smarty->assign('language', $_SESSION['language']);
  if ($random_product["products_id"]!='') {
       	  // set cache ID
  if (USE_CACHE=='false') {
  $box_smarty->caching = 0;
  $box_specials= $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_specials.html');
  } else {
  $box_smarty->caching = 1;	
  $box_smarty->cache_lifetime=CACHE_LIFETIME;
  $box_smarty->cache_modified_check=CACHE_CHECK;
  $cache_id = $_SESSION['language'].$random_product["products_id"].$_SESSION['customers_status']['customers_status_name'];
  $box_specials= $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_specials.html',$cache_id);
  }
    $box_specials= $box_smarty->fetch(CURRENT_TEMPLATE.'/boxes/box_specials.html');
    $smarty->assign('box_SPECIALS',$box_specials);
   } 
    ?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -