求救啊!评论溢出!把中间推到下面去了!评论长就出错了
2016-07-07 16:08 来源:www.chinab4c.com 作者:ecshop专家
求救啊!评论溢出! 代码是 <div class="globalModule" id="brandList"> <h3><div id="list_t_l"><div id="list_t_r"><b>最新评论</b></div></div></h3> <div id="global_box"> <?php if(!function_exists("get_comments")){ function get_comments($num) { $sql = 'SELECT a.*,b.goods_id,b.goods_thumb,b.goods_name FROM '. $GLOBALS['ecs']->table('comment') . ' AS a,'. $GLOBALS['ecs']->table('goods') .'AS b WHERE a.status = 1 AND a.parent_id = 0 and a.comment_type=0 and a.id_value=b.goods_id '. ' ORDER BY a.add_time DESC'; if ($num > 0) { $sql .= ' LIMIT ' . $num; } //echo $sql; $res = $GLOBALS['db']->getAll($sql); $comments = array(); foreach ($res AS $idx => $row) { $comments[$idx]['add_time'] = local_date($GLOBALS['_CFG']['time_format'], $row['add_time']); $comments[$idx]['content'] = $row['content']; $comments[$idx]['id_value'] = $row['id_value']; $comments[$idx]['goods_thumb']= get_image_path($row['goods_id'], $row['goods_thumb'], true); $comments[$idx]['goods_name'] = $row['goods_name']; } return $comments; } } ?> <meta http-equiv="Content-Type" content="text/html; charset=gbk"> <!--数据调用-最新评论开始 --> <?php $this->assign('my_comments',get_comments(20)); // 数据条数 ?> <!--{foreach from=$my_comments item=comments}--> <table width="200" border="0" cellspacing="0" cellpadding="0" style=" border-bottom:1px #ccc dashed;"> <tr> <td width="200" align="left" valign="top"> <div style="height:3px; overflow:hidden;"> </div> <div><a href="goods.php?id={$comments.id_value}" target="_blank"><font style=" color:#FF0000;font-weight:bold;">{$comments.goods_name}</font></a></div> <div>{$comments.content|truncate:100:""}</div> <div style="color:#999999;">{$comments.add_time}</div> </td> </tr> </table> <!--{/foreach}--> <div style="clear: both;"> </div> <p class="more"> <a href="message.php"><img alt="" src="../images/bnt_more_1.gif"/> 更多>></a> </p> </div> </div> |
回答:
<div>{$comments.content|truncate:100:""}</div> 把上面这句改成: <div class="word">{$comments.content|truncate:100:""}</div> |
不是很懂哦 |
2楼是告诉你把评论的显示内容缩小控制在100字,这个字数由后面的数字直接控制 你可以根据需要随意改 |
最近更新
常用插件
- ecshop注册审核插件
ecshop插件介绍:ecshop会员注册审核插件,主要是在前台提供给注册的时候...
- ecshop订单聚合插件
ecshop订单聚合插件,主要是为了方便ecshop中订单产品到货情况的分析和...
- ecshop虚拟发货插件
ecshop虚拟发货插件介绍: ecshop虚拟发货插件,主要为了通过后台手动录...
- ecshop的oss插件
ecshop的oss插件免费共享了,oss,ecshoposs...
- ecshop没登陆情况下订单查
ecshop没登陆情况下订单查询插件,主要是针对ecshop在没有登陆的情况下...
ecshop热门问答
ecshop热门资料
ecshop正文
ecshop原理
ecshop包修
ecshop创业
ecshoppath
ecmall修改
ecshop搜狗
ecshop团队合作
ecshop数据库地址
ecshop您的购物车中没有商品
ecshop加法
ecshopFor
ecshop龌龊
ecshop品牌管理
ecshop特价商品
ecshop概况
ecshop令人堪忧
ecshop大额信用卡支付
ecshop童装批发
ecshop清楚
ecshop图片切换
ecshopLOGO更换不了
ecshop二次
ecshop新增语言项
ecshop_blank
ecshopidc
ecshop大姐
ecshop后台管理
ecshop商品批量修改
ecshopexport