久久久久av_欧美日韩一区二区在线_国产精品三区四区_日韩中字在线

Discuz! 官方交流社區

標題: 童虎:論壇首頁分版最簡單實現方法(轉存) [打印本頁]

作者: myes    時間: 2023-10-5 12:50
標題: 童虎:論壇首頁分版最簡單實現方法(轉存)
本帖最后由 myes 于 2023-10-5 13:12 編輯
轉存自原來的discuz官方論壇:

最近有不少人www.55bbs.com那種首頁分版是怎么實現的,其實實現方法很簡單,只要簡單對index.php做簡單修改就可以實現,方法如下

打開index.php找到:


  1. $sql = !empty($accessmasks)?
  2.            "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
  3.             LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid
  4.             LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid
  5.             WHERE f.status='1' ORDER BY f.type, f.displayorder"
  6.          : "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
  7.             LEFT JOIN {$tablepre}forumfields ff USING(fid)
  8.             WHERE f.status='1' ORDER BY f.type, f.displayorder";
復制代碼
改成:

  1. $id='15,16,17,18';

  2. $sql = !empty($accessmasks)?
  3.          "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
  4.           LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid
  5.           LEFT JOIN {$tablepre}access a ON a.uid='$discuz_uid' AND a.fid=f.fid
  6.           WHERE f.status='1' AND f.fid IN ($id) ORDER BY f.type, f.displayorder"
  7.          : "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
  8.           LEFT JOIN {$tablepre}forumfields ff USING(fid)
  9.           WHERE f.status='1' AND f.fid IN ($id) ORDER BY f.type, f.displayorder";
復制代碼
其中的:

  1. $id='15,16,17,18';
復制代碼
中的數字可以改成你要顯示的板塊的fid,這個數字你可以根據你的需要改變,數字之間用,隔開。

這些都做完后,把index.php另存為你需要的分區名稱,例如sh.php然后用戶訪問sh.php就可以看到相應的分區了,如果想做成和www.55bbs.com一致的話,只要在模板里面添加相應的代碼就可以了。

小技巧:如果你是最新的RCFINAL版本,相應的鏈接代碼可以加在首頁的廣告代碼中,很方便的實現首頁分版的功能。


作者: YueChionLine    時間: 2024-1-26 21:22
學習?。。。。。。。。。。。。。。。。。?




歡迎光臨 Discuz! 官方交流社區 (http://www.9999xn.com/) Powered by Discuz! W1.0