|
轉存自原來的discuz官方論壇:
最近有不少人www.55bbs.com那種首頁分版是怎么實現的,其實實現方法很簡單,只要簡單對index.php做簡單修改就可以實現,方法如下
打開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";
復制代碼 改成:
- $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";
復制代碼 中的數字可以改成你要顯示的板塊的fid,這個數字你可以根據你的需要改變,數字之間用,隔開。
這些都做完后,把index.php另存為你需要的分區名稱,例如sh.php然后用戶訪問sh.php就可以看到相應的分區了,如果想做成和www.55bbs.com一致的話,只要在模板里面添加相應的代碼就可以了。
小技巧:如果你是最新的RCFINAL版本,相應的鏈接代碼可以加在首頁的廣告代碼中,很方便的實現首頁分版的功能。
|
|