<!--{eval $tbid = DB::result(DB::query("SELECT tableid FROM ".DB::table('forum_attachment')." WHERE `tid`= '$thread[tid]'"));}-->
<!--{if $tbid}-->
<!--{eval $picount = DB::fetch_all("SELECT aid FROM ".DB::table('forum_attachment_'.$tbid.'')." WHERE `tid`= '$thread[tid]' AND `isimage`=1;");}-->
<!--{eval $picnum = count($picount);}-->
<!--{if $picnum < 3}-->
<!--{eval $litpicnum = '1';}-->
<!--{elseif $picnum > 2 && $picnum < 6}-->
<!--{eval $litpicnum = '3';}-->
<!--{elseif $picnum > 5}-->
<!--{eval $litpicnum = '6';}-->
<!--{/if}-->
<!--{eval $covers = DB::fetch_all("SELECT attachment,aid,description FROM ".DB::table('forum_attachment_'.$tbid.'')." WHERE `tid`= '$thread[tid]' AND `isimage`=1 LIMIT 0,$litpicnum;");}-->