Deprecated: Function get_magic_quotes_gpc() is deprecated in /www/wwwroot/xy.xinenw.com/xiunophp/xiunophp.php on line 20
: array('name'=>'');
$thread['forumname'] = $forum['name'];
if($thread['last_date'] == $thread['create_date']) {
//$thread['last_date'] = 0;
$thread['last_date_fmt'] = '';
$thread['lastuid'] = 0;
$thread['lastusername'] = '';
} else {
$lastuser = $thread['lastuid'] ? user_read_cache($thread['lastuid']) : array();
$thread['lastusername'] = $thread['lastuid'] ? $lastuser['username'] : lang('guest');
}
$thread['url'] = "thread-$thread[tid].htm";
$thread['user_url'] = "user-$thread[uid]".($thread['uid'] ? '' : "-$thread[firstpid]").".htm";
$thread['top_class'] = $thread['top'] ? 'top_'.$thread['top'] : '';
$thread['pages'] = ceil($thread['posts'] / $conf['postlist_pagesize']);
}
function thread_format_last_date(&$thread) {
if($thread['last_date'] != $thread['create_date']) {
$thread['last_date_fmt'] = humandate($thread['last_date']);
} else {
$thread['create_date_fmt'] = humandate($thread['create_date']);
}
}
function thread_count($cond = array()) {
$n = db_count('thread', $cond);
return $n;
}
function thread_maxid() {
$n = db_maxid('thread', 'tid');
return $n;
}
function thread_safe_info($thread) {
unset($thread['userip']);
if(!empty($thread['user'])) {
$thread['user'] = user_safe_info($thread['user']);
}
return $thread;
}
function thread_get_level($n, $levelarr) {
foreach($levelarr as $k=>$level) {
if($n <= $level) return $k;
}
return $k;
}
// 对 $threadlist 权限过滤
function thread_list_access_filter(&$threadlist, $gid) {
global $conf, $forumlist;
if(empty($threadlist)) return;
foreach($threadlist as $tid=>$thread) {
if(empty($forumlist[$thread['fid']]['accesson'])) continue;
if($thread['top'] > 0) continue;
if(!forum_access_user($thread['fid'], $gid, 'allowread')) {
unset($threadlist[$tid]);
}
}
}
function thread_find_by_tids($tids, $order = array('lastpid'=>-1)) {
//$start = ($page - 1) * $pagesize;
//$tids = array_slice($tids, $start, $pagesize);
if(!$tids) return array();
$threadlist = db_find('thread', array('tid'=>$tids), $order, 1, 1000, 'tid');
if($threadlist) foreach($threadlist as &$thread) thread_format($thread);
return $threadlist;
}
// 查找 lastpid
function thread_find_lastpid($tid) {
$arr = db_find_one("post", array('tid'=>$tid), array('pid'=>-1), array('pid'));
$lastpid = empty($arr) ? 0 : $arr['pid'];
return $lastpid;
}
// 更新最后的 uid pid
function thread_update_last($tid) {
$lastpid = thread_find_lastpid($tid);
if(empty($lastpid)) return;
$lastpost = post__read($lastpid);
if(empty($lastpost)) return;
$r = thread__update($tid, array('lastpid'=>$lastpid, 'lastuid'=>$lastpost['uid'], 'last_date'=>$lastpost['create_date']));
return $r;
}
?>
Fatal error: Uncaught Error: Call to undefined function thread_find_by_fids() in /www/wwwroot/xy.xinenw.com/tmp/route_index.php:27
Stack trace:
#0 /www/wwwroot/xy.xinenw.com/tmp/index.inc.php(110): include()
#1 /www/wwwroot/xy.xinenw.com/index.php(52): include('/www/wwwroot/xy...')
#2 {main}
thrown in /www/wwwroot/xy.xinenw.com/tmp/route_index.php on line 27