1)打开css_common模板,在最下面加上:
- <!--骨头帖子列表缩略图-->
- .gtsla a{width: 120px; height: 80px; float: left; margin: 0 10px 0 0;}.gtsla a img{height: 80px;width: 120px;}.gtsla{height:80px;margin:10px 0 6px 0}
复制代码
注:图片尺寸可以自由修改
2)打开forumdisplay模板,找到:
- <img src="images/attachicons/image_s.gif" alt="{lang attach_img}" class="attach" />
复制代码
替换为:
- <!--骨头帖子列表缩略图-->
- {eval $q2 = $db->query("SELECT * FROM cdb_attachments WHERE tid='".$thread[tid]."' AND isimage !=0 ORDER BY pid DESC LIMIT 0,4");}
- {eval $gtsla=Array();}
- {eval $i=0;}
- {eval while ($asdfgh=$db->fetch_array($q2)) $gtsla[$i++] = $asdfgh ; }
- {eval while ($asdfgh=$db->fetch_array($q2)) $q2[img]=$asdfgh[attachment];}
- <br />
- <div class="gtsla">
- <!--{loop $gtsla $thing}-->
- <a href="javascript:void(0);"><img src="http://你的论坛地址/attachments/$thing[attachment]"></a>
- <!--{/loop}-->
- </div>
- <!--骨头帖子列表缩略图end-->
复制代码
注:别漏了在http://你的论坛地址/attachments/$thing[attachment加上你的论坛地址哦!
文章来源:bone.joinbbs.net
|