• 河南网站建设-郑州网站设计-郑州网站建设-手机建站-郑州建站-上海建站

  • 专注网站建设 服务热线: 13061801310

当前位置:好东东网 > 近期动态 > 网站建设观点 > 正文

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

发布时间:2021-04-30 | 发布者: 东东工作室 | 浏览次数:
今天在用织梦模板做的网站后台生成栏目页时出现如下错误:
 
Fatal error: Using $this when not in object context in D:\www\meinvtup\include\taglib\mynews.lib.php on line 40
 
或者是在织梦模板中的首页调用站内新闻后提示如下错误:
 
Fatal error: Using $this when not in object context in D:\www\meinvtup\include\taglib\mynews.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)."' ";
 
 
现在就可以生成栏目和显示调用的新闻了的,但是这样显示的新闻只能显示栏目的站内新闻, 不过问题总算还是解决了。
 

转载请标注:东东工作室——织梦错误Fatal error: Using $this when not in object context