在 discuz 模板的帖子列表循环中,调用摘要,有两个简单的方法。
方法一:
- <!--{eval require_once(DISCUZ_ROOT."./source/function/function_post.php");}-->
- <!--{echo messagecutstr(DB::result_first('SELECT `message` FROM '.DB::table('forum_post').' WHERE `tid` ='.$thread[tid].' AND `first` =1'),200);}-->
方法二:
- <!--{eval $threadlist_message = DB::result(DB::query("SELECT message FROM ".DB::table('forum_post')." WHERE `tid` = $thread[tid] AND `first` =1"));}-->
- <!--{echo cutstr($threadlist_message,300)}-->
方法二选其一,放在需要展示的地方即可。
完毕!
评论 (0)