让 Discuz! 帖子列表支持倒序排序

Discuz! 虽然能够在后台修改帖子的排序方式,但却不能选择是倒序还是顺序排序。

为解决这个问题,可采用以下修改办法:
修改文件 source/module/forum/forum_forumdisplay.php,找到 457 行:

1
$_GET['ascdesc'] = isset($_G['cache']['forums'][$_G['fid']]['ascdesc']) ? $_G['cache']['forums'][$_G['fid']]['ascdesc'] : 'DESC';

在下方加入:

1
2
3
4
// Modified by kookxiang @ 2014-4-8 13:05:07
if($_GET['forceasc']) $_GET['ascdesc'] = 'ASC';
if($_GET['forcedesc']) $_GET['ascdesc'] = 'DESC';
// Ending of modification

这样便能通过 URL 参数 forceasc 和 forcedesc 控制排序了

让 Discuz! 帖子列表支持倒序排序

https://kk.sb/2014/add-parameter-to-sort-threads-in-discuz.htm

Author

kookxiang

Posted on

2014-04-08

Updated on

2014-04-08

Licensed under

Comments