將调用浏览历史改成图片

2016-07-07 15:07 来源:www.chinab4c.com 作者:ecshop专家

C:\ECSHOP-EXP\wwwroot\ecshop\includes\lib_insert.php
將调用浏览历史改成以下便成,有用的就試一下吧....


/**
* 调用浏览历史
*
* @accesspublic
* @returnstring
*/
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;
}

回答:
不错,顶
height="60" 最好是根据系统参数设
另外根据你的排版最好一行显示2个商品

支持啊MARK!

顶啊~~~~lz再出一些优化吧~~~

支持,,,多多分享,,,

在研究中, 如果加入官方模組就好了....

更新了~

http://bbs.ecshop.com/viewthread ... e%3D1&frombbs=1

你更新的这个怎么用啊?
调不到图片...

好东西!收藏一下!刚开始研究php 嘻嘻!都是老大!

这个东西有用,留下个脚印吧
^_^