时间:2021-07-21人气:-
<!--{eval $theuid = $_G[forum_thread][authorid];}--><!--{eval $lzthread = DB::fetch_all("SELECT `tid`,`subject` FROM ".DB::table('forum_thread')." WHERE authorid = $theuid and cover = 1 ORDER BY dateline DESC LIMIT 0,4 ");}--> <!--{loop $lzthread $thethread}--><li><a href="forum.php?mod=viewthread&tid={$thethread['tid']}" target="_blank"><!--{eval $thethread['coverpath'] = getthreadcover($thethread['tid'], 1);}--><img src="$thethread['coverpath']"/></a></li><!--{/loop}-->复制代码在完全不懂这代码情况下,修改了下:1.不限制于图片主题列表,即删掉了cover = 1,这样还使会员发布的主题也可以显示其最新帖子,不知原因。2.图片加title和alt。
<!--{eval $theuid = $_G[forum_thread][authorid];}--><!--{eval $lzthread = DB::fetch_all("SELECT `tid`,`subject` FROM ".DB::table('forum_thread')." WHERE authorid = $theuid ORDER BY dateline DESC LIMIT 0,4 ");}--><!--{loop $lzthread $thethread}--><li><a href="forum.php?mod=viewthread&tid={$thethread['tid']}" target="_blank"><!--{eval $thethread['coverpath'] = getthreadcover($thethread['tid'], 1);}--><img src="$thethread['coverpath']" title="$thethread[subject]" alt="$thethread[subject]"/></a></li><!--{/loop}-->其实最终想要的结果是调用作者最新主题,不限制板块和板块模式,判断帖子是否含图,无图则不显示。测试{if $thethread[cover]}判断的是当前页主题所在板块是否开启了图片列表,这不是我想要的。测试{if $thread[attachment] = 1}图片数量=1 ???不知,这个也不成。目前状态是畸形的,要么全调用图片,要么全调用标题,既无法混合调用,也做不了是否含图判断。