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

织梦教程 强烈建议 2024-02-26 11:18 113 0

  今天在用织梦模板做的网站后台生成栏目页时出现如下错误:

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

  或者是在织梦模板中的首页调用站内新闻后提示如下错误:

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

  DEDECMS模板

  我们只需要找到mynews.lib.php的40行

  if($envs['typeid'] > 0) $idsql = " where typeid='".GetTopid($this->TypeID)."' "; DEDECMS模板

  改成

  if($envs['typeid'] > 0) $idsql = " where typeid='".GetTopid($envs->TypeID)."' ";

本站资源均来自互联网或会员发布,如果不小心侵犯了您的权益请与我们联系。我们将立即删除!谢谢!