- 積分
- 127
- 金幣
- 15 個(gè)
- 社區(qū)幣
- 0 元
漸入佳境
- 貢獻(xiàn)
- 0 點(diǎn)
- 金幣
- 15 個(gè)

|
轉(zhuǎn)存自原來的discuz官方論壇:
最近有不少人www.55bbs.com那種首頁分版是怎么實(shí)現(xiàn)的,其實(shí)實(shí)現(xiàn)方法很簡(jiǎn)單,只要簡(jiǎn)單對(duì)index.php做簡(jiǎn)單修改就可以實(shí)現(xiàn),方法如下
打開index.php找到:
- $sql = !empty($accessmasks)?
- "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, ff.description, ff.moderators, ff.icon, ff.viewperm, a.allowview FROM {$tablepre}forums f
- LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid
- LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid
- WHERE f.status='1' ORDER BY f.type, f.displayorder"
- : "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, ff.description, ff.moderators, ff.icon, ff.viewperm FROM {$tablepre}forums f
- LEFT JOIN {$tablepre}forumfields ff USING(fid)
- WHERE f.status='1' ORDER BY f.type, f.displayorder";
復(fù)制代碼 改成:
- $id='15,16,17,18';
- $sql = !empty($accessmasks)?
- "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, ff.description, ff.moderators, ff.icon, ff.viewperm, a.allowview FROM {$tablepre}forums f
- LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid
- LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid
- WHERE f.status='1' AND f.fid IN ($id) ORDER BY f.type, f.displayorder"
- : "SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, f.inheritedmod, ff.description, ff.moderators, ff.icon, ff.viewperm FROM {$tablepre}forums f
- LEFT JOIN {$tablepre}forumfields ff USING(fid)
- WHERE f.status='1' AND f.fid IN ($id) ORDER BY f.type, f.displayorder";
復(fù)制代碼 中的數(shù)字可以改成你要顯示的板塊的fid,這個(gè)數(shù)字你可以根據(jù)你的需要改變,數(shù)字之間用,隔開。
這些都做完后,把index.php另存為你需要的分區(qū)名稱,例如sh.php然后用戶訪問sh.php就可以看到相應(yīng)的分區(qū)了,如果想做成和www.55bbs.com一致的話,只要在模板里面添加相應(yīng)的代碼就可以了。
小技巧:如果你是最新的RCFINAL版本,相應(yīng)的鏈接代碼可以加在首頁的廣告代碼中,很方便的實(shí)現(xiàn)首頁分版的功能。
|
|