今天把Typecho的版本升级到了1.2.1,然后出现一系列错误:
经过排查,这个错误是由CateFilter插件导致的,需要修改插件的实现部分,改为下面即可:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
public static function filter($obj, $select){ $path_info = strtolower($_SERVER['REQUEST_URI']); // 使用 $_SERVER['REQUEST_URI'] 获取路径信息 if('/feed' == $path_info || '/feed/' == $path_info) return $select; $CateIds = Typecho_Widget::widget('Widget_Options')->plugin('CateFilter')->CateId; if(!$CateIds) return $select; //没有写入值,则直接返回 $select = $select->select('table.contents.cid', 'table.contents.title', 'table.contents.slug', 'table.contents.created', 'table.contents.authorId','table.contents.modified', 'table.contents.type', 'table.contents.status', 'table.contents.text', 'table.contents.commentsNum', 'table.contents.order','table.contents.template', 'table.contents.password', 'table.contents.allowComment', 'table.contents.allowPing', 'table.contents.allowFeed','table.contents.parent')->join('table.relationships','table.relationships.cid = table.contents.cid','right')->join('table.metas','table.relationships.mid = table.metas.mid','right')->where('table.metas.type=?','category'); $CateIds = explode(',', $CateIds); $CateIds = array_unique($CateIds); //去除重复值 foreach ($CateIds as $k => $v) { $select = $select->where('table.relationships.mid != '.intval($v))->group('cid');//确保每个值都是数字;排除重复文章 } return $select; } |

马春杰杰



最新评论
站长您好,亚马逊云咨询推广资源,望建立联系,可邮件,谢谢。
换友情链接吗?
看你的站做的挺不错的
恭喜!!太强了,硕博连读啊
雁过留毛,人过留名。
看不懂但大受震撼
每天都在战争,希望2026和平.
ZeroTier 看过多篇帖子,目前群辉、飞牛os、win11 、安卓、ubuntu ≥18.04 顺利通过,这篇相对于简单 实用、特来感谢 🙄