Discuz! 官方站

找回密码
立即注册

QQ登录

只需一步,快速开始

发新帖
童虎      

0

收听

44

听众

71

主题
发表于 2005-12-12 04:06:32 | 查看: 58087| 回复: 105
最近有不少人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版本,相应的链接代码可以加在首页的广告代码中,很方便的实现首页分版的功能
ad.gif
发表于 2005-12-12 04:16:37
这个功能不错 准备用

回复 显示全部楼层 道具 举报

karl907      
发表于 2005-12-12 04:26:17
免費D4插件...稱下場面...支持下!!

回复 显示全部楼层 道具 举报

发表于 2005-12-12 04:49:33
这个支持~~很实用的功能~~

回复 显示全部楼层 道具 举报

eghawk      
发表于 2005-12-12 06:07:06
很实用的,谢谢

回复 显示全部楼层 道具 举报

发表于 2005-12-12 08:28:10
用不上

回复 显示全部楼层 道具 举报

发表于 2005-12-12 08:59:59
童虎大哥还真快啊,插件都上来了

回复 显示全部楼层 道具 举报

发表于 2005-12-12 09:05:39
支持

回复 显示全部楼层 道具 举报

wsry      
发表于 2005-12-12 09:07:25
谢谢还不错支持你了

回复 显示全部楼层 道具 举报

发表于 2005-12-12 09:08:27
支持童虎哥哥!

回复 显示全部楼层 道具 举报

您需要登录后才可以回帖 登录 | 立即注册

Archiver|手机版|北京康盛新创科技有限责任公司 ( 京ICP证110024号|京网文[2011]0019-007号   

GMT+8, 2012-5-23 14:18 , Processed in 0.097400 second(s), 13 queries , Gzip On, Memcache On.

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部