主页 > 网站建设 > 建站知识 > 织梦更新列表页提示Fatal error: Call to a member func

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

POST TIME:2017-11-13 00:49

今天在做一个站时用到了自定义模型,遇到了些问题,在更新列表页时提示:

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());

保存即可。

然后列表页就正常了。

源代码:
  1. <?php
  2. if(!defined('DEDEINC'))
  3. {
  4. exit("RequestError!");
  5. }
  6. /**
  7. *图像标签
  8. *
  9. *@version$Id:img.lib.php19:332010年7月8日Ztianya$
  10. *@packageDedeCMS.Taglib
  11. *@copyrightCopyright(c)2007-2010,DesDev,Inc.
  12. *@licensehttp://help.dedecms.com/usersguide/license.html
  13. *@linkhttp://www.dedecms.com
  14. */
  15. functionch_img($fvalue,&$arcTag,&$refObj,$fname='')
  16. {
  17. global$cfg_album_width,$cfg_album_row,$cfg_album_col,$cfg_album_pagesize,$cfg_album_style,$cfg_album_ddwidth,$cfg_basehost,$cfg_multi_site;
  18. $dtp=newDedeTagParse();
  19. $dtp->LoadSource($fvalue);
  20. if(!is_array($dtp->CTags))
  21. {
  22. $dtp->Clear();
  23. return"无图片信息!";
  24. }
  25. $pagestyle=$cfg_album_style;
  26. $maxwidth=$cfg_album_width;
  27. $ddmaxwidth=$cfg_album_ddwidth;
  28. $pagepicnum=$cfg_album_pagesize;
  29. $row=$cfg_album_row;
  30. $icol=$cfg_album_col;
  31. $ptag=$dtp->GetTag('pagestyle');
  32. if(is_object($ptag))
  33. {
  34. $pagestyle=$ptag->GetAtt('value');
  35. $maxwidth=$ptag->GetAtt('maxwidth');
  36. $ddmaxwidth=$ptag->GetAtt('ddmaxwidth');
  37. $pagepicnum=$ptag->GetAtt('pagepicnum');
  38. $irow=$ptag->GetAtt('row');
  39. $icol=$ptag->GetAtt('col');
  40. if(emptyempty($maxwidth))
  41. {
  42. $maxwidth=$cfg_album_width;
  43. }
  44. }
  45. //遍历图片信息
  46. $mrow=0;
  47. $mcol=0;
  48. $images=array();
  49. $innerTmp=$arcTag->GetInnerText();
  50. if(trim($innerTmp)=='')
  51. {
  52. $innerTmp=GetSysTemplets("channel_article_image.htm");
  53. }
  54. if($pagestyle==1)
  55. {
  56. $pagesize=$pagepicnum;
  57. }
  58. elseif($pagestyle==2)
  59. {
  60. $pagesize=1;
  61. }
  62. else
  63. {
  64. $pagesize=$irow*$icol;
  65. }
  66. if(is_object($arcTag)&&$arcTag->GetAtt('pagesize')>0)
  67. {
  68. $pagesize=$arcTag->GetAtt('pagesize');
  69. }
  70. if(emptyempty($pagesize))
  71. {
  72. $pagesize=12;
  73. }
  74. $aid=$refObj->ArcID;
  75. $row=$refObj->dsql->GetOne("SELECTtitleFROM`ddmx_archives`WHERE`id`='$aid';");
  76. $title=$row['title'];
  77. $revalue='';
  78. $GLOBAL['photoid']=0;
  79. foreach($dtp->CTagsas$ctag)
  80. {
  81. if($ctag->GetName()=="img")
  82. {
  83. $fields=$ctag->CAttribute->Items;
  84. $fields['text']=str_replace("'","",$ctag->GetAtt('text'));
  85. $fields['title']=$title;
  86. $fields['imgsrc']=trim($ctag->GetInnerText());
  87. $fields['imgsrctrue']=$fields['imgsrc'];
  88. if(emptyempty($fields['ddimg']))
  89. {
  90. $fields['ddimg']=$fields['imgsrc'];
  91. }
  92. if($cfg_multi_site=='Y')
  93. {
  94. //$cfg_basehost)
  95. if(!preg_match('#^http:#i',$fields['imgsrc'])){
  96. $fields['imgsrc']=$cfg_basehost.$fields['imgsrc'];
  97. }
  98. if(!preg_match('#^http:#i',$fields['ddimg'])){
  99. $fields['ddimg']=$cfg_basehost.$fields['ddimg'];
  100. }
  101. }
  102. if(emptyempty($fields['width']))
  103. {
  104. $fields['width']=$maxwidth;
  105. }
  106. //if($fields['text']=='')
  107. //{
  108. //$fields['text']='图片'.($GLOBAL['photoid']+1);
  109. /


收缩
  • 微信客服
  • 微信二维码
  • 电话咨询

  • 400-1100-266