| reddrake |
2008-05-06 00:35 |
在各大网站上发现,有很多分日期的排行榜,比如迅雷的影视排行榜 [attachment=17972] 演示页面:http://movie.xunlei.com/
单找遍PHP168的功能栏,标签栏,实在没发现能实现这个功能的。
所以自己DIY下,花了两天的时间终于弄出来了。
在自己网站上测试通过。
下面介绍修改方法,再次提醒在修改前,请备份好你目前的文件。
首先 1. 修改文件/admin/template/label/article.htm
找到:
<input type="radio" name="asc" value="ASC" $ascdb[ASC]> 升序</td> </tr>
在下面添加
<tr bgcolor="#FFFFFF"> <td width="24%">发布时间范围:</td> <td width="76%"><select name="timearea"> <option value="none" $timeareadb["none"]>不设置</option> <option value="oneD" {$timeareadb["oneD"]}>一天</option> <option value="oneW" {$timeareadb["oneW"]}>一周</option> <option value="oneM" {$timeareadb["oneM"]}>一个月</option> <option value="threeM" {$timeareadb["threeM"]}>三个月</option> <option value="sixM" {$timeareadb["sixM"]}>六个月</option> <option value="oneY" {$timeareadb["oneY"]}>一年</option> </select></td> </tr> 这样你就在你修改标签内容的地方多出来发布时间范围的选项。 [attachment=17973] 2. 修改文件/admin/inc/label/article.php
找到
/*判断是否是显示图片类型*/ if($stype=="rollpic"||strstr($postdb[tplpart_1code],'$picurl')||strstr($postdb[tplpart_2code],'$picurl')) { $SQL.=" AND A.ispic=1 "; }
在下面插入:
/*实现发布时间范围分类*/ $oneday = 3600*24; $oneweek = 3600*24*7; $onemonth = 3600*24*30; $threemonth = 3600*24*30*3; $sixmonth = 3600*24*30*6; $oneyear = 3600*24*30*12;
if($timearea=='oneD'){ $timelond=time()-$oneday; } elseif($timearea=='oneW'){ $timelond=time()-$oneweek; } elseif($timearea=='oneM'){ $timelond=time()-$onemonth; } elseif($timearea=='threeM'){ $timelond=time()-$threemonth; } elseif($timearea=='sixM'){ $timelond=time()-$sixmonth; } elseif($timearea=='oneY'){ $timelond=time()-$oneyear; } else{ $timelond=0; } $SQL.=" AND posttime >= '$timelond' ";
保存上传两个文件到服务器上,更改你想选定发布时间范围的标签设置。
没成功的看看:
修改文件:/admin/inc/label/article.php 找到
$postdb[order]=$order;
后面插入$postdb[timearea]=$timearea;
找到$orderdb[$order]=" selected ";
后面插入$timeareadb[$timearea]=" selected ";
如有问题请在后跟帖。
如觉得不错。就给我送个IP 菊花茶女性网http://www.jhcbest.com
演示地址http://post.jhcbest.com 右下角 |
|