您现在的位置是:首页 > cms教程 > DedeCMS教程DedeCMS教程

织梦cms更新列表页提示Fatal error: Call to a member function Get

问兰2023-09-25DedeCMS教程已有人查阅

导读今天在做一个站时用到了自定义模型,遇到了些问题,在更新列表页时提示:
Fatal error: Call to a member function Get

今天在做一个站时用到了自定义模型,遇到了些问题,在更新列表页时提示:
Fatal error: Call to a member function GetInnerText() on a non-object in E:\www\include\taglib\channel\img.lib.php on line 51
这个错误提示会在更新自定义模型栏目列表的时候出现,修复此问题方法很简单。
编辑打开 /inculde/taglib/channel/img.lib.php
找到51行所在的代码,将其替换为
$innerTmp = ($arcTag=="") ? trim($arcTag) : trim($arcTag->GetInnerText());
保存即可。
然后列表页就正常了。
源代码:
<?php  
if(!defined('DEDEINC'))  
{  
exit( "Request Error!");  
}  
/**  
* 图像标签   
*   
* @version $Id:img.lib.php 1 9:33 2010年7月8日Z tianya $   
* @package DedeCMS.Taglib   
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.   
* @license http://help.dedecms.com/usersguide/license.html  
* @link http://www.dedecms.com  
*/   
 
function ch_img($fvalue,&$arcTag,&$refObj,$fname='')  
{  
global $cfg_album_width,$cfg_album_row,$cfg_album_col,$cfg_album_pagesize,$cfg_album_style,$cfg_album_ddwidth,$cfg_basehost,$cfg_multi_site;   
$dtp = new DedeTagParse();   
$dtp- >LoadSource($fvalue);  
if(!is_array($dtp- >CTags))  
{   
$dtp- >Clear();  
return "无图片信息!";  
}   
$pagestyle = $cfg_album_style;   
$maxwidth = $cfg_album_width;   
$ddmaxwidth = $cfg_album_ddwidth;   
$pagepicnum = $cfg_album_pagesize;   
$row = $cfg_album_row;   
$icol = $cfg_album_col;   
$ptag = $dtp- >GetTag('pagestyle');  
if(is_object($ptag))   
{   
$pagestyle = $ptag- >GetAtt('value');  
$maxwidth = $ptag- >GetAtt('maxwidth');  
$ddmaxwidth = $ptag- >GetAtt('ddmaxwidth');  
$pagepicnum = $ptag- >GetAtt('pagepicnum');  
$irow = $ptag- >GetAtt('row');  
$icol = $ptag- >GetAtt('col');  
if(emptyempty($maxwidth))   
{   
$maxwidth = $cfg_album_width;   
}   
}   
 
//遍历图片信息  
$mrow = 0;  
$mcol = 0;   
$images = array();   
$innerTmp = $arcTag- >GetInnerText();  
if(trim($innerTmp)=='')   
{   
$innerTmp = GetSysTemplets( "channel_article_image.htm");  
}   
 
if($pagestyle==1)  
{  
$pagesize = $pagepicnum;   
}   
else if($pagestyle==2)   
{   
$pagesize = 1;   
}   
else   
{   
$pagesize = $irow * $icol;   
}   
 
if(is_object($arcTag) && $arcTag->GetAtt('pagesize') > 0)  
{  
$pagesize = $arcTag- >GetAtt('pagesize');  
}   
if(emptyempty($pagesize))   
{   
$pagesize = 12;   
}   
$aid = $refObj- >ArcID;  
$row = $refObj- >dsql->GetOne("SELECT title FROM `ddmx_archives` WHERE `id` = '$aid';");  
$title = $row['title'];   
$revalue = '';   
$GLOBAL['photoid'] = 0;   
foreach($dtp- >CTags as $ctag)  
{   
if($ctag- >GetName()=="img")  
{   
$fields = $ctag- >CAttribute->Items;  
$fields['text'] = str_replace( "'","",$ctag->GetAtt('text'));  
$fields['title'] = $title;   
$fields['imgsrc'] = trim($ctag- >GetInnerText());  
$fields['imgsrctrue'] = $fields['imgsrc'];   
if(emptyempty($fields['ddimg']))   
{   
$fields['ddimg'] = $fields['imgsrc'];   
}   
if($cfg_multi_site=='Y')   
{   
//$cfg_basehost)   
if( !preg_match('#^http:#i', $fields['imgsrc']) ) {   
$fields['imgsrc'] = $cfg_basehost.$fields['imgsrc'];   
}   
if( !preg_match('#^http:#i', $fields['ddimg']) ) {   
$fields['ddimg'] = $cfg_basehost.$fields['ddimg'];   
}   
}   
if(emptyempty($fields['width']))   
{   
$fields['width'] = $maxwidth;   
}   
//if($fields['text']=='')   
//{   
//$fields['text'] = '图片'.($GLOBAL['photoid']+1);   
/

本文标签:

很赞哦! ()

相关源码

  • (自适应)简繁双语响应式服装服饰西装工装校服定制pbootcms模板本模板基于PbootCMS内核开发,为服装服饰行业量身打造,尤其适合西装定制、工装生产、校服订制等服装类企业使用。模板采用响应式布局设计,确保在手机、平板、电脑查看源码
  • (自适应响应式)英文外贸汽车零配件五金机械网站模板为汽车零部件制造商与五金机械出口企业打造的响应式网站模板,内置多语言切换功能,支持产品参数表、OEM能力展示等外贸场景需求。通过结构化数据展示帮助海外买家快速理解产品规格。查看源码
  • 帝国cms7.5个人博客资讯文章模板下载本模板简洁个人博客网站设计开发,采用帝国CMS内核构建,只需替换文字图片即可快速搭建专业网站。自适应手机端设计,数据实时同步,操作简单便捷。PHP程序确保安全稳定运行,帮助您以较低成本获取持续业务。查看源码
  • (自适应HTML5)响应式智能设备人工智能机器pbootcms源码免费下载这款基于PbootCMS开发的网站模板为人工智能和智能设备行业设计,采用现代化科技风格,突出产品的智能特性和技术创新。模板架构合理,功能完善,能够有效展示各类智能产品的核心功能和解决方案。查看源码
  • (自适应响应式)HTML5磁电机械设备蓝色营销型网站pbootcms模板本模板为磁电设备行业设计,采用蓝色营销风格,突出工业设备的专业性和技术感。模板结构清晰,能够有效展示磁电设备的技术参数、应用场景和企业实力,帮助客户快速了解产品特点和公司服务。查看源码
  • (自适应)绿色农业大型机械设备展示网站模板下载基于PbootCMS内核深度定制开发的农业机械行业专用模板。针对农机设备展示、产品参数说明等需求优化设计,突出农业机械行业特性查看源码
分享笔记 (共有 篇笔记)
验证码:

本栏推荐