本帖最后由 ryhbgs 于 2009-9-12 15:53 编辑
安装littlehz的代码:
SELECT * FROM cdb_threads t,cdb_attachments a,cdb_posts p WHERE t.tid = a.tid AND a.isimage =1 AND p.tid = t.tid AND p.first = 1 GROUP BY t.tid ORDER BY t.dateline DESC LIMIT 0 , 30
实现了首页调用论坛一个主题一张图片的想法,但是图片缺不显示了,如下图:
下面是调用数据的代码,不知道是不是哪里错了:
<!--{if !empty($_SBLOCK['bbspicnew'])}-->
<!--{loop $_SBLOCK['bbspicnew'] $value}-->
<li><a target="_blank" href="$value[url]"><img title="$value[subjectall]" src="$value[attachment]" /> <p>$value[subject]</p></a></li>
<!--{/loop}-->
<!--{/if}-->
</ul>
<script type="text/javascript">new dk_slideplayer("#pub_slideplay",{width:"320px",height:"240px",fontsize:"12px",time:"5000"});</script>
谢谢! |