1)、首先打开 /includes/lib_insert.php 文件
在文件末尾增加下面代码
function insert_goods_collect($arr)
{
$sql='select count(user_id) as ids '.'from '. $GLOBALS['ecs']->table('collect_goods')."as co "."where co.goods_id=".$arr['goods_id'];
$row=$GLOBALS['db']->GetRow($sql);
if($row)
{
$ids = intval($row['ids']);
}
else
{
$ids = 0;
}
return $ids;
}
2)、接着打开模板文件 /themes/default/goods.dwt ,这里以官方默认模板(2.7.2版)为例
在
<strong>{$lang.goods_rank}</strong> 上边添加
<strong>收藏人气:</strong>{insert name='goods_collect' goods_id=$id}人<br>