97久久国产亚洲精品超碰热,成人又色又爽的免费网站,色偷偷女人的天堂a,男女高潮喷水在线观看,国内精品一线二线三线区别在哪里

Discuz! 官方交流社區(qū)

標(biāo)題: 童虎:論壇首頁分版最簡單實(shí)現(xiàn)方法(轉(zhuǎn)存) [打印本頁]

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

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

打開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";
復(fù)制代碼
改成:

  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";
復(fù)制代碼
其中的:

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

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

小技巧:如果你是最新的RCFINAL版本,相應(yīng)的鏈接代碼可以加在首頁的廣告代碼中,很方便的實(shí)現(xiàn)首頁分版的功能。


作者: YueChionLine    時間: 2024-1-26 21:22
學(xué)習(xí)?。。。。。。。。。。。。。。。。?!




歡迎光臨 Discuz! 官方交流社區(qū) (http://r615.cn/) Powered by Discuz! X5.0