Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 帖子排序+后台设置(16/2最后更新)

[复制链接]
hklcf 发表于 2006-2-12 23:12:37 | 显示全部楼层 |阅读模式
适用版本:Discuz! 4.x
插件名称:帖子排序+后台设置
作  者:hklcf / HkDz (HKLCF)
数据升级:cdb_forums
修改文件:forumdisplay.php, admin/forums.inc.php
修改模板:admincp.lang.php
安装难度:易
最后更新:2006-02-16
技术支持:discuz.dismall.com
功能简述:可在后台设置各板块的帖子排序方式

修改步骤
1. 数据库升级
  1. ALTER TABLE `cdb_forums` ADD `topiclist` VARCHAR(10) DEFAULT 'lastpost' ;
复制代码


2. 打开 forumdisplay.php 找
  1. isset($orderby) && in_array($orderby, array('dateline', 'replies', 'views')) ? $forumdisplayadd .= "&orderby=$orderby" : $orderby = 'lastpost';
复制代码

改为
  1. isset($orderby) && in_array($orderby, array('lastpost', 'dateline', 'replies', 'views')) ? $forumdisplayadd .= "&orderby=$orderby" : $orderby = $forum['topiclist'];
复制代码


3. 打开 admin/forums.inc.php 找
  1. $checkrules = array($forum['alloweditrules'] => 'checked');
复制代码

在下面加上
  1. $checktopiclist = array($forum['topiclist'] => 'checked');
复制代码


再找
  1. 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']);
复制代码

在下面加上
  1. 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']);
复制代码


再找
  1. alloweditrules='$alloweditrulesnew',
复制代码

在后面加上
  1. topiclist='$topiclistnew',
复制代码


4. 打开 admincp.lang.php 语言包找
  1. 'forums_edit_edit_rules_comment' => '设置是否允许超级版主和版主通过系统设置修改本版规则',
复制代码

在下面加上
  1. 'forums_edit_topiclist' => '主题排序方式:',
  2.         'forums_edit_topiclist_last' => '按最后回复时间',
  3.         'forums_edit_topiclist_date' => '按发布时间',
  4.         'forums_edit_topiclist_rep' => '按回复数量',
  5.         'forums_edit_topiclist_hit' => '按浏览次数',
  6.         'forums_edit_autoclose' => '主题自动关闭:',
  7.         'forums_edit_topiclist_comment' => '设置使用那种排序方式',
复制代码


------完成------

=================================
# 16/2 10:05am 修正了前台无法给会员使用按最后回覆排序
16/2 10:05am前安装过的请按以下方法修正
打开 forumdisplay.php 找
  1. isset($orderby) && in_array($orderby, array('dateline', 'replies', 'views')) ? $forumdisplayadd .= "&orderby=$orderby" : $orderby = $forum['topiclist'];
复制代码

更改为
  1. isset($orderby) && in_array($orderby, array('lastpost', 'dateline', 'replies', 'views')) ? $forumdisplayadd .= "&orderby=$orderby" : $orderby = $forum['topiclist'];
复制代码


[ 本帖最后由 hklcf 于 2006-2-16 10:11 编辑 ]
魔焰男孩 发表于 2006-2-12 23:13:55 | 显示全部楼层
晕!
睡觉前还拿了一个沙发
回复

使用道具 举报

741147 发表于 2006-2-12 23:14:25 | 显示全部楼层
跟着
回复

使用道具 举报

 楼主| hklcf 发表于 2006-2-12 23:15:07 | 显示全部楼层
原帖由 魔焰男孩 于 2006-2-12 23:13 发表
晕!
睡觉前还拿了一个沙发

MJJ..........
回复

使用道具 举报

魔焰男孩 发表于 2006-2-12 23:15:37 | 显示全部楼层
竟然发了2帖, 怕别人不看啊~~
MJJ就是MJJ……
回复

使用道具 举报

fishleong 发表于 2006-2-12 23:16:23 | 显示全部楼层
原帖由 魔焰男孩 于 2006-2-12 23:15 发表
竟然发了2帖, 怕别人不看啊~~
MJJ就是MJJ……

我是说 我抢了个沙发 https://discuz.dismall.com/viewth ... &extra=page%3D1
回复

使用道具 举报

 楼主| hklcf 发表于 2006-2-12 23:19:56 | 显示全部楼层
原帖由 魔焰男孩 于 2006-2-12 23:15 发表
竟然发了2帖, 怕别人不看啊~~
MJJ就是MJJ……

汗...不关我的事
我连这里慢得很,发了5分钟才发出来
回复

使用道具 举报

5988143 发表于 2006-2-12 23:24:02 | 显示全部楼层
终于解决了老大问题了,谢谢!
回复

使用道具 举报

 楼主| hklcf 发表于 2006-2-12 23:32:33 | 显示全部楼层
原帖由 5988143 于 2006-2-12 23:24 发表
终于解决了老大问题了,谢谢!

嗯嗯
回复

使用道具 举报

5988143 发表于 2006-2-12 23:40:04 | 显示全部楼层
这样的帖子,应该精华吧!
再支持一下子!
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-18 12:22 , Processed in 0.107554 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表