发新话题
打印

將调用浏览历史改成图片

將调用浏览历史改成图片

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

Image5.gif

TOP

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

TOP

支持啊MARK!

TOP

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

TOP

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

TOP

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

TOP

回复 #1 mark1 的帖子

TOP

回复 #7 mark1 的帖子

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

TOP

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

TOP

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

TOP

发新话题