当前位置:首页>记录>discuz 调用帖子内容摘要

discuz 调用帖子内容摘要

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

评论 (0)