适用版本:Discuz! 4.x
插件名称:帖子排序+后台设置
作 者:hklcf / HkDz (HKLCF)
数据升级:cdb_forums
修改文件:forumdisplay.php, admin/forums.inc.php
修改模板:admincp.lang.php
安装难度:易
最后更新:2006-02-16
技术支持:discuz.dismall.com
功能简述:可在后台设置各板块的帖子排序方式
修改步骤
1. 数据库升级
- ALTER TABLE `cdb_forums` ADD `topiclist` VARCHAR(10) DEFAULT 'lastpost' ;
复制代码
2. 打开 forumdisplay.php 找
- isset($orderby) && in_array($orderby, array('dateline', 'replies', 'views')) ? $forumdisplayadd .= "&orderby=$orderby" : $orderby = 'lastpost';
复制代码
改为
- isset($orderby) && in_array($orderby, array('lastpost', 'dateline', 'replies', 'views')) ? $forumdisplayadd .= "&orderby=$orderby" : $orderby = $forum['topiclist'];
复制代码
3. 打开 admin/forums.inc.php 找
- $checkrules = array($forum['alloweditrules'] => 'checked');
复制代码
在下面加上
- $checktopiclist = array($forum['topiclist'] => 'checked');
复制代码
再找
- showsetting('forums_edit_edit_rules', '', '', '<input type="radio" name="alloweditrulesnew" value="0" '.$checkrules[0].'> '.$lang['forums_edit_edit_rules_html_none'].'<br><input type="radio" name="alloweditrulesnew" value="1" '.$checkrules[1].'> '.$lang['forums_edit_edit_rules_html_no'].'<br><input type="radio" name="alloweditrulesnew" value="2" '.$checkrules[2].'> '.$lang['forums_edit_edit_rules_html_yes']);
复制代码
在下面加上
- showsetting('forums_edit_topiclist', '', '', '<input type="radio" name="topiclistnew" value="lastpost" '.$checktopiclist[lastpost].'> '.$lang['forums_edit_topiclist_last'].'<br><input type="radio" name="topiclistnew" value="dateline" '.$checktopiclist[dateline].'> '.$lang['forums_edit_topiclist_date'].'<br><input type="radio" name="topiclistnew" value="replies" '.$checktopiclist[replies].'> '.$lang['forums_edit_topiclist_rep'].'<br><input type="radio" name="topiclistnew" value="views" '.$checktopiclist[views].'> '.$lang['forums_edit_topiclist_hit']);
复制代码
再找
- alloweditrules='$alloweditrulesnew',
复制代码
在后面加上
- topiclist='$topiclistnew',
复制代码
4. 打开 admincp.lang.php 语言包找
- 'forums_edit_edit_rules_comment' => '设置是否允许超级版主和版主通过系统设置修改本版规则',
复制代码
在下面加上
- 'forums_edit_topiclist' => '主题排序方式:',
- 'forums_edit_topiclist_last' => '按最后回复时间',
- 'forums_edit_topiclist_date' => '按发布时间',
- 'forums_edit_topiclist_rep' => '按回复数量',
- 'forums_edit_topiclist_hit' => '按浏览次数',
- 'forums_edit_autoclose' => '主题自动关闭:',
- 'forums_edit_topiclist_comment' => '设置使用那种排序方式',
复制代码
------完成------
=================================
# 16/2 10:05am 修正了前台无法给会员使用按最后回覆排序
16/2 10:05am前安装过的请按以下方法修正
打开 forumdisplay.php 找
- isset($orderby) && in_array($orderby, array('dateline', 'replies', 'views')) ? $forumdisplayadd .= "&orderby=$orderby" : $orderby = $forum['topiclist'];
复制代码
更改为
- isset($orderby) && in_array($orderby, array('lastpost', 'dateline', 'replies', 'views')) ? $forumdisplayadd .= "&orderby=$orderby" : $orderby = $forum['topiclist'];
复制代码
[ 本帖最后由 hklcf 于 2006-2-16 10:11 编辑 ] |