风云默示录剧情:Using $this when not in object context in C:\AppServ\www\site1\include\taglib\mynews.lib.php on line

来源:百度文库 编辑:九乡新闻网 时间:2024/04/28 02:54:27
在dedecms中安装了“站内新闻”模块后,更新到栏目的时候,出现错误提示:Using $this when not in object context in C:\AppServ\www\site1\include\taglib\mynews.lib.php on line 16。解决办法如下:

修改include\taglib\mynews.lib.php

第 16 行

if($envs['typeid'] > 0) $idsql = ” where typeid=’”.GetTopid($this->TypeID).”‘ “;
这行的$this 会报错,估计是写代码的疏忽照成的,将$this 改成$refObj  ,即 整行变为

if($envs['typeid'] > 0) $idsql = ” where typeid=’”.GetTopid($refObj->TypeID).”‘ “;

就可以解决此BUG。