ECshop 点击人气排行榜

点击人气排行榜。。。。hacks by xoao.com
hacks by xoao.com
两部分。index.php和lib_goods.php
关于涉及到index.dwt的,请将按销量排行的改为from = top_hots_all
index.php增加
$smarty->assign(’top_hots_all’,       get_top10_hot(0));           // 全部人气排行
/**
 
lib_goods.php lib库增加函数(children取得子类产品id)
* 调用当前人气排行榜
*按点击排列 i<10 显示10个
* @access  public
* @param   string  $cats   查询的分类
* @return  array
*/
 
function get_top10_hot($cats)
{
if (empty($cats))
{
  $children = ”;
}
   else
{
    $children =  "WHERE ".get_children($cats);
}
  $sql = ‘SELECT * ‘ .
            ’ FROM ‘ . $GLOBALS['ecs']->table(’goods’) .’ [...]


阅读完整的文章... admin on 01月 20th, 2008 | File Under PHP | 5 Comments -

利用ecshop的flash,在产品页下面(或当前产品页),轮番显示产品库的图片代码分享

利用ecshop的flash,在产品页下面(或当前产品页),轮番显示产品库的图片代码分享
* Hacks by xoao.com
<?php
/**
* ECSHOP 轮播显示当前产品图片程序
*修改自ecshop 原幻灯片轮番程序
*/
 
define(’IN_ECS’, true);
define(’INIT_NO_USERS’, true);
define(’INIT_NO_SMARTY’, true);
require(’./includes/init.php’);
header(’Content-Type: application/xml; charset=utf-8′);
header(’Cache-Control: no-cache, must-revalidate’);
header(’Expires: Thu, 27 Mar 1975 07:38:00 GMT’);
header(’Last-Modified: ‘ . date(’r'));
header(’Pragma: no-cache’);
 
$goods_id = isset($_REQUEST['id'])  ? intval($_REQUEST['id']) : 0;
$sql = ‘SELECT img_id, img_desc, thumb_url, img_url’.
       ‘ FROM ‘ .$ecs->table(’goods_gallery’).
       " WHERE goods_id = ‘$goods_id’ ORDER BY img_id";
$img_list = $db->getAll($sql);
$img_count = [...]


阅读完整的文章... admin on 01月 20th, 2008 | File Under PHP | No Comments -