紅蓮默示錄 寫:心靈捕手 寫:To 紅蓮默示錄:
建議您:
貼出修改後的該段程式碼.
// query
$sql = "SELECT topic_id, topic_title, topic_poster, topic_views, topic_replies, topic_last_post_id, f.forum_id, forum_name
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE t.forum_id = f.forum_id
AND topic_moved_id = '0'
AND f.forum_id != '+ 管理員討論專區'
$auth_forums_top5
ORDER BY $sortby DESC LIMIT 0, $MAX_TOPICS";
真抱歉,我沒想到要貼出來Orz
您的語法有誤!
'+ 管理員討論專區' 是指 'forum_name', 也就是 '版面名稱'.
我並不知道您的論壇 '+ 管理員討論專區' 的 'forum_id' 是多少?
以您的論壇, 假使要將
其他版面設定為例外的話,
'好站介紹' 的 'forum_id' = '27'
'優良讀物' 的 'forum_id' = '39'
'意見反應' 的 'forum_id' = '29'
參考上面
bu 大大回文, 可以試試下列語法:
代碼: 選擇全部
// query
$sql = "SELECT topic_id, topic_title, topic_poster, topic_views, topic_replies, topic_last_post_id, f.forum_id, forum_name
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE t.forum_id = f.forum_id
AND topic_moved_id = '0'
AND f.forum_id != '27'
AND f.forum_id != '39'
AND f.forum_id != '29'
$auth_forums_top5
ORDER BY $sortby DESC LIMIT 0, $MAX_TOPICS";
另外, 您也可以試試以下的語法:
// 設定例外版面 id (以逗號分隔)
$except_forum_id = '27,39,29';
// query
$sql = "SELECT topic_id, topic_title, topic_poster, topic_views, topic_replies, topic_last_post_id, f.forum_id, forum_name
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE t.forum_id = f.forum_id
AND topic_moved_id = '0'
AND t.forum_id NOT IN (" . $except_forum_id . ")
$auth_forums_top5
ORDER BY $sortby DESC LIMIT 0, $MAX_TOPICS";