Aurora.歆 Aurora.歆
Aurora.歆

关于Robes主题出现留言板自定义页面500,评论不显示的解决办法

1.自定义页面500

2026-07-21T11:40:44.png
留言板自定义页面添加完出现500 Database Query Error
解决方法:
打开/data/config.inc.php文件
在最下方添加一行

define('__TYPECHO_DEBUG__', true);

开启调试模式
一般情况报错内容如下:
2026-07-21T11:45:38.png
打开/data/usr/theme/robes/guestbook.php
将第42-51行替换为

 $topCommentersQuery = $db->select(
    'author', 
    array('ANY_VALUE(mail)' => 'mail'),   // 这里将 mail 用 ANY_VALUE 包裹
    array('COUNT(coid)' => 'cnt')
    )
    ->from($prefix . 'comments')
    ->where('status = ?', 'approved')
    ->group('author')      // 分组保持不变
    ->order('cnt', \Typecho\Db::SORT_DESC)
    ->limit(5);

保存即可使用

2.发评论后不显示评论

解决办法:
打开/data/usr/theme/robes/comments.php
在最上方插入这行:

    <?php
if (isset($_GET['error'])) {
    echo '<div style="color:red;">错误代码:' . htmlspecialchars($_GET['error']) . '</div>';
}
?>

刷新即可显示

留言板也适用于这个方法
上一篇 好可爱~ 下一篇 分享一下我这两年做音乐人的心得

检测到2条评论

按Ctrl + Enter 发送喵
    1. robes Lv1

      去下载新版覆盖就好了

      回复 Android · Chrome
    2. Aurora.歆Official 站长喵 Lv1

      图床在想办法修了qwq

      回复 Windows · Firefox
Copyright ©2023-2026 槐序网络科技工作室
萌ICP备20262038号
Theme by Robes