### 2. 修改数据库查询
为了随机排列主题,你需要在数据库查询中添加 `ORDER BY RAND()`。你可以在 `source/module/forum/forum_forumdisplay.php` 文件中找到相关的查询代码。
找到类似以下的代码:
$query = DB::query("SELECT * FROM ".DB::table('forum_thread')." WHERE fid='$fid' AND displayorder>='0' ORDER BY lastpost DESC LIMIT $start_limit, $tpp");
复制代码
将其修改为:
$query = DB::query("SELECT * FROM ".DB::table('forum_thread')." WHERE fid='$fid' AND displayorder>='0' ORDER BY RAND() LIMIT $start_limit, $tpp");