元素模板为您解答
修改方法
首先修改 message.php 文件,将下面代码
修改为:if($rows['id_value']){$sql_goods = "SELECT goods_name FROM ".$GLOBALS['ecs']->table('goods');$sql_goods .= "WHERE goods_id= ".$rows['id_value'];$goods_res = $GLOBALS['db']->getRow($sql_goods);$msg[$rows['msg_time']]['goods_name'] = $goods_res['goods_name'];$msg[$rows['msg_time']]['goods_url'] = build_uri('goods', array('gid' => $rows['id_value']), $goods_res['goods_name']);}
if($rows['id_value']){$sql_goods = "SELECT goods_name,goods_thumb FROM ".$GLOBALS['ecs']->table('goods');$sql_goods .= "WHERE goods_id= ".$rows['id_value'];$goods_res = $GLOBALS['db']->getRow($sql_goods);$msg[$rows['msg_time']]['goods_name'] = $goods_res['goods_name'];$msg[$rows['msg_time']]['goods_url'] = build_uri('goods', array('gid' => $rows['id_value']), $goods_res['goods_name']);$msg[$rows['msg_time']]['goods_thumb'] = get_image_path($row['id_value'], $goods_res['goods_thumb'], true);}
然后再继续修改模板文件,这里以默认模板为例,打开 /themes/default/library/message_list.lbi 文件在
这样就可以了,刷新一下就能看到效果了,注意上面的缩略图大小是默认的设置,如果你修改了商品的缩略图大小,请修改为你设置的值,不然图片显示可能有异常!