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

返回列表 發帖
查看: 1642|回復: 1

童虎:論壇首頁分版最簡單實現方法(轉存)

5

主題

103

回帖

127

積分

漸入佳境

貢獻
0 點
金幣
15 個
QQ
樓主
發表于 2023-10-5 12:50:29 | 只看樓主 |倒序瀏覽 |閱讀模式
轉存自原來的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版本,相應的鏈接代碼可以加在首頁的廣告代碼中,很方便的實現首頁分版的功能。

回復

使用道具 舉報

5

主題

83

回帖

97

積分

漸入佳境

貢獻
0 點
金幣
7 個
沙發
發表于 2024-1-26 21:22:04 | 只看Ta
學習!?。。。。。。。。。。。。。。。?!
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

  • 關注公眾號
  • 有償服務微信
  • 有償服務QQ

手機版|小黑屋|Discuz! 官方交流社區 ( 皖ICP備16010102號 |皖公網安備34010302002376號 )|網站地圖|star

GMT+8, 2025-9-19 00:49 , Processed in 0.077223 second(s), 29 queries .

Powered by Discuz! W1.0 Licensed

Copyright © 2001-2025 Discuz! Team.

關燈 在本版發帖
有償服務QQ
有償服務微信
返回頂部
快速回復 返回頂部 返回列表