RT!演示:
http://www.bbswap.com/bbs
安装方法:安装好首页四格后的朋友可以直接修改。无需上传附件.
简易程度:相当简单。
可按以下方法直接
第一步:修改index.php(修改前请先做好备份,以防万一)
查找
复制内容到剪贴板
代码:
$rsshead = $rssstatus在其上的代码前会有一段标识:
复制内容到剪贴板
代码:
/ /----首页多格代码开始 //----首页多格代码结束在 //----首页多格代码结束 前加入
复制内容到剪贴板
代码:
//今日发贴排行
$tomonth=date(n);
$todate=date(j);
$toyear=date(Y);
$time=mktime(0,0,0,$tomonth,$todate,$toyear);
$query=$db->query("select count(pid) as num,authorid,author from $tablepre"."posts where dateline>=$time group by authorid order by num desc limit 0,10");
while($result=$db->fetch_array($query)){
$poststar.="<a href=space.php?uid=".$result[authorid].">".cutstr($result[author],10)."</a> <font color=red>[".$result[num]."]</font> ";
}我的四格是在index.php 里引用index_four.php文件。和我相同的朋友可以编辑index_four.php文件
在
复制内容到剪贴板
代码:
writetocache("showother", '', $curdata);前加入:
复制内容到剪贴板
代码:
//今日发贴排行
$tomonth=date(n);
$todate=date(j);
$toyear=date(Y);
$time=mktime(0,0,0,$tomonth,$todate,$toyear);
$query=$db->query("select count(pid) as num,authorid,author from $tablepre"."posts where dateline>=$time group by authorid order by num desc limit 0,10");
while($result=$db->fetch_array($query)){
$poststar.="<a href=space.php?uid=".$result[authorid].">".cutstr($result[author],10)."</a> <font color=red>[".$result[num]."]</font> ";
}第二步:修改templates/你使用模板目录下/discuz.htm文件:
找到:
复制内容到剪贴板
代码:
</table>
</div>
<!-- 首页多格代码结束 -->在之前加入:
复制内容到剪贴板
代码:
<tr>
<td colspan=4>今日发贴TOP10:$poststar</td>
</tr>安装完成!
————————————————————————————————————————————————————————
如果希望在四格下加入三行发贴排行展示的朋友可把
第一步加入代码换成
1.
复制内容到剪贴板
代码:
//今日发贴排行
$tomonth=date(n);
$todate=date(j);
$toyear=date(Y);
$time=mktime(0,0,0,$tomonth,$todate,$toyear);
$query=$db->query("select count(pid) as num,authorid,author from $tablepre"."posts where dateline>=$time group by authorid order by num desc limit 0,10");
while($result=$db->fetch_array($query)){
$poststar.="<a href=space.php?uid=".$result[authorid].">".cutstr($result[author],10)."</a> <font color=red>[".$result[num]."]</font> ";
}
//本月发贴排行
$tomonth=date(n);
$toyear=date(Y);
$time=mktime(0,0,0,$tomonth,0,$toyear);
$query=$db->query("select count(pid) as num,authorid,author from $tablepre"."posts where dateline>=$time group by authorid order by num desc limit 0,10");
while($result=$db->fetch_array($query)){
$monthpoststar.="<a href=space.php?uid=".$result[authorid].">".cutstr($result[author],10)."</a> <font color=red>[".$result[num]."]</font> ";
}
//当年发贴排行
$toyear=date(Y);
$time=mktime(0,0,0,0,0,$toyear);
$query=$db->query("select count(pid) as num,authorid,author from $tablepre"."posts where dateline>=$time group by authorid order by num desc limit 0,10");
while($result=$db->fetch_array($query)){
$yearpoststar.="<a href=space.php?uid=".$result[authorid].">".cutstr($result[author],6)."</a> <font color=red>[".$result[num]."]</font> ";
}同时把
第二步加入代码换成
复制内容到剪贴板
代码:
<tr>
<td colspan=4>今日发贴TOP10:$poststar</td>
</tr>
<tr>
<td colspan=4>本月发贴TOP10:$monthpoststar</td>
</tr>
<tr>
<td colspan=4>当年发贴TOP10:$yearpoststar</td>
</tr>更新缓存!
——————————————————————————————————————
有问题可以PM我。或Q我80155
贴内我给出的是针对不同情况的2种方法,请做修改的时候仔细按步骤来。
[
本帖最后由 keigo583 于 2007-12-13 05:54 编辑 ]