?? forum.inc.php
字號(hào):
<?php
/*
[DISCUZ!] wap/include/forum.inc.php - thread list via wap
This is NOT a freeware, use is subject to license terms
Version: 4.0.0
Web: http://www.comsenz.com
Copyright: 2001-2005 Comsenz Technology Ltd.
Last Modified: 2005-2-28 10:15
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$discuz_action = 192;
if(isset($fup)) {
$forums = $subforums = array();
foreach($_DCACHE['forums'] as $fid => $forum) {
if($forum['type'] != 'group' && $forum['fup'] == $fup) {
$forums[$fid] = $forum;
} elseif($forum['type'] == 'sub' && $_DCACHE['forums'][$forum['fup']]['fup'] == $fup) {
$subforums[$forum['fup']]++;
}
}
echo "<p>\n";
foreach($forums as $fid => $forum) {
echo "<a href=\"index.php?action=forum&fid=$fid\">".dhtmlspecialchars($forum['name'])."</a>".
($subforums[$fid] ? "<br /> +[<a href=\"index.php?action=forum&fup=$fid\">$subforums[$fid]$lang[sub_forums]</a>]" : '')."<br />\n";
}
echo "</p>\n";
} elseif(!empty($fid)) {
require_once DISCUZ_ROOT.'./include/forum.func.php';
if(empty($forum)) {
wapmsg('forum_nonexistence');
}
if(($forum['viewperm'] && !forumperm($forum['viewperm']) && !$forum['allowview']) || $forum['redirect'] || $forum['password']) {
wapmsg('forum_nopermission');
}
$page = empty($page) || !ispage($page) ? 1 : $page;
$start_limit = $number = ($page - 1) * $waptpp;
$query = $db->query("SELECT * FROM {$tablepre}threads
WHERE fid='$fid' AND displayorder>='0'
ORDER BY displayorder DESC, lastpost DESC LIMIT $start_limit, $waptpp");
while($thread = $db->fetch_array($query)) {
$thread['prefix'] = $thread['displayorder'] > 0 ? $lang['forum_thread_sticky'] : ($thread['digest'] ? $lang['forum_thread_digest'] : '');
echo "<p><a href=\"index.php?action=thread&tid=$thread[tid]\">#".++$number." $thread[prefix]".cutstr($thread['subject'], 30)."</a><br />\n".
" <small>".gmdate("$wapdateformat $timeformat", $thread['lastpost'] + $timeoffset * 3600)."<br />\n".
" $thread[lastposter]</small></p>\n";
}
echo "<p><br />$lang[page] $page ".
($start_limit + $waptpp < $forum['threads'] ? "<a href=\"index.php?action=forum&fid=$fid&page=".($page + 1)."\">>>$lang[next_page]</a>" : $lang['end'])."<br />\n".
($discuz_uid ? "<a href=\"index.php?action=post&do=newthread&fid=$fid\">$lang[post_new]</a><br />\n" : '').
"<br />$lang[forum]:<a href=\"index.php?action=forum&fid=$fid\">".dhtmlspecialchars(cutstr(strip_tags($forum['name']), 20))."</a></p>\n";
}
?>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -