Discuz 首页图文列表实现
<div id="shoucang"> <!--{eval $list_count=0;}--> <!--{loop $threadlist $thread}--> <!--{eval $list_count+=1;}--> <div class="scitem scitemimage show"{if $list_count%3==0}style="margin-right: 0px;"{/if}> <!--{eval $syaidtable='forum_attachment_'.$thread[tid]%10;}--> <!--{eval $fujian=DB::result_first("SELECT `attachment` FROM ".DB::table($syaidtable)." WHERE tid=$thread[tid] AND isimage=1");}--> <!--{if $fujian}--> <!--{eval $iconurl='data/attachment/forum/'.$fujian}--> <!--{else}--> <!--{eval $iconurl='static/image/common/nophotosmall.gif'}--> <!--{/if}--> <a style="text-decoration:underline;color: #000" class="simage" href="forum.php?mod=viewthread&tid=$thread[tid]" target="_blank"> <img style="width: 290px;height:180px" src="$iconurl" onerror='this.src="template/iscwo_design_2013/img/nophoto.gif"' border='0' /> <div class="simagemask"> <p> $thread[subject]{echo messagecutstr(strip_tags($thread['post']['message']), 200);} </p> </div> </a> <div class="simgbody"> <div class="simgh"> <a href="forum.php?mod=viewthread&tid=$thread[tid]" class="simgtitle" target="_blank">$thread[subject]</a> <!--{eval $syaidtable='forum_attachment_'.$thread[tid]%10;}--> <!--{eval $fujian=DB::result_first("SELECT `aid` FROM ".DB::table($syaidtable)." WHERE tid=$thread[tid] AND isimage=0");}--> <!--{if $fujian}--> <a href="forum.php?mod=viewthread&tid=$thread[tid]" class="sylist_fj" title="有附件" hidefocus="true"></a> <!--{else}--> <a href="forum.php?mod=viewthread&tid=$thread[tid]" class="sylist_blank" title="新窗口打开" hidefocus="true" target="_blank"></a> <!--{/if}--> </div> <div class="clear"> </div> <!--<a href="/" target="_blank">视觉设计</a>--> </p> <div class="clear"> </div> <div class="simgfoot"> <div> <span class="simgdate"></span><span>2013-07-18</span> </div> <script type="text/javascript" src="{$_G['setting']['jspath']}forum_viewthread.js?{VERHASH}"></script> <p class="itemfoot"> <a href="" class="yyicon2 yy2dian"></a><span class="iftxt">$thread[views]</span> <a href="" class="yyicon2 yy2dian"></a><span class="iftxt">$thread[replies]</span> <!--{if ($_G['group']['allowrecommend'] || !$_G['uid']) && $_G['setting']['recommendthread']['status']}--> <!--{if !empty($_G['setting']['recommendthread']['addtext'])}--> <a id="recommend_add$list_count" class="yyicon2 yy2xiaoxin" hidefocus="true" href="forum.php?mod=misc&action=recommend&do=add&tid=$thread[tid]&hash={FORMHASH}" {if $_G['uid']}onclick="ajaxmenu(this, 3000, 1, 0, '43', 'recommendupdate({$_G['group']['allowrecommend']})');return false;"{else} onclick="showWindow('login', this.href)"{/if} onmouseover="this.title = $('recommendv_add{$list_count}').innerHTML + ' {lang activity_member_unit}喜欢'"><span class="ftishi">添加到我喜欢</span></a> <span class="iftxt">$thread[recommend_add]</span> <!--{/if}--> <!--{/if}--> </p> </div> </div> <div class="clear"> </div> </div> <!--{/loop}-->
<div style="margin-top:20px;" class="wp1024 mbw cl">
<p class="{if $lastpage && $nextpage}fd_page2{else}fd_page1{/if}">
<!--{if $lastpage}--><a class="fd_last" href="forum.php?page=$lastpage"></a><!--{/if}-->
<!--{if $nextpage}--><a class="fd_next" href="forum.php?page=$nextpage"></a><!--{/if}-->
</p>
</div>