我的知识记录

请问织梦错误 Fatal error: Using $this when not in object context

错误提示

Fatal error: Using $this when not in object context in D:wwwmeinvtupincludeaglibmynews.lib.php on line 40

原因

  • 在非对象上下文中使用了 $this 关键字。

解决方法

  1. 修改 mynews.lib.php 文件
    • 打开 include/aglib/mynews.lib.php 文件。
    • 找到第40行,将以下代码:
      if($envs['typeid'] > 0) $idsql = " where typeid='".GetTopid($this->TypeID)."' ";
    • 修改为:
      if($envs['typeid'] > 0) $idsql = " where typeid='".GetTopid($envs['typeid'])."' ";

 

标签:织梦currentstyle-安装织梦网站出现not found-安装织梦的时候出现dir-织梦cms为什么不维护了-织梦无法生成html-

更新时间:2025-04-10 23:32:30

上一篇:请问PbootCMS 6. 自定义标签

下一篇:请问宝塔面板安装fileinfo模块失败解决