沭阳web

沭阳web

discuz X 帖子列表页,显示摘要

2016-04-26 17:14| 发布者: 沭阳网站建设| 查看: 1815

打开后台文件\source\module\forum\forum_forumdisplay.php//搜索foreach($threadlist as $thread) {//在其上面添加foreach($threadlist as $v){$tids=$v;}$strtids=join(',',$tids);$msginfos=DB::fetch_all("SEL ...
打开后台文件\source\module\forum\forum_forumdisplay.php

//搜索foreach($threadlist as $thread) {
//在其上面添加
foreach($threadlist as $v){
$tids[]=$v['tid'];
}
$strtids=join(',',$tids);
$msginfos=DB::fetch_all("SELECT tid,message FROM %t WHERE tid IN($strtids)",array('forum_post'));
if(!function_exists('messagecutstr')){
require_once libfile('function/post');
}
foreach($msginfos as $v){
$cutmsginfos[$v['tid']]=messagecutstr($v['message'],200);
}

//在其下面添加
$thread['cutmsg']=$cutmsginfos[$thread['tid']];

前台用$thread['cutmsg']就可以获取。
来源『沭阳web』,转载请保留出处:https://www.shuyangweb.com/article-76-1.html