將调用浏览历史改成图片
C:\ECSHOP-EXP\wwwroot\ecshop\includes\lib_insert.php
將调用浏览历史改成以下便成,有用的就試一下吧....
/**
* 调用浏览历史
*
* @access public
* @return string
*/
function insert_history()
{
$str = '';
if (!empty($_COOKIE['ECS']['history']))
{
$where = db_create_in($_COOKIE['ECS']['history'], 'goods_id');
$sql = 'SELECT goods_id, goods_name, goods_thumb FROM ' . $GLOBALS['ecs']->table('goods') .
" WHERE $where AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0";
$query = $GLOBALS['db']->query($sql);
$res = array();
while ($row = $GLOBALS['db']->fetch_array($query))
{
$res[$row['goods_id']] = $row;
}
$tureorder = explode(',', $_COOKIE['ECS']['history']);
foreach ($tureorder AS $key => $val)
{
$goods_name = htmlspecialchars($res[$val]['goods_name']);
$goods_thumb = htmlspecialchars($res[$val]['goods_thumb']);
if ($goods_name)
{
$short_name = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($goods_name, $GLOBALS['_CFG']['goods_name_length']) : $goods_name;
$str .= '<li><a href="' . build_uri('goods', array('gid' => $val), $goods_name). '" title="' . $goods_name . '"><img src="'.$goods_thumb.'"height="60"><br>'. $short_name . '</a></li>';
}
}
}
return $str;
}
附件
-
Image5.gif
(19.15 KB)
-
2007-10-31 04:35