LayCenter用户中心关闭后,在原始后台无法发布文章?

提问者:话说很安逸 问题分类:插件
回答数量1
浏览量278
1 个回答
满意答案
花晨月夕
花晨月夕 管理员
程序猿一枚,专注web相关开发,可开发网站、小程序、app、cms系统、erp系统、oa系统等等

因为LayCenter插件在post表中增加了几个longtext类型的字段,但mysql无法为longtext类型的字段配置默认值,所以在LayCenter禁用后,zblog向数据库插入数据时没有提供这些字段数据,导致无法正常插入到数据库。

两种解决方法:

1、如果以后不打算使用LayCenter,可在LayCenter配置中的其他配置页面中,勾选“卸载清空数据”,然后停用LayCenter即可删除post中新增的字段。(注意:这一操作会删除所有LayCenter所有相关数据,如果仅是临时停用,请使用下一方法)

2、在主题或任意插件的include.php文件结尾中增加以下代码:

$zbp->datainfo['Post'] = array_merge($zbp->datainfo['Post'], array(
    'LayCenter_BuyContent'     => array('log_LayCenter_BuyContent', 'string', '', ''),
    'LayCenter_VipContent'     => array('log_LayCenter_VipContent', 'string', '', ''),
    'LayCenter_LoginContent'   => array('log_LayCenter_LoginContent', 'string', '', ''),
    'LayCenter_SendContent'    => array('log_LayCenter_SendContent', 'string', '', ''),
));

如果文件结尾是?>代码,那么需要放在该代码的上一行。

如果重新启用了LayCenter,需要删掉这些增加的代码。

发布于:2个月前 (10-07) IP属地:江苏省
我来回答

优惠购买

本站和李洋个人博客达成合作,两站同时购买主题或插件可有优惠,详情咨询客服
欢迎QQ/微信咨询我