用过Dedecms的都知道,当显示文章的时候,如果该文章没有添加缩略图,那么会显示系统默认的缩略图 /images/defaultpic.gif (Dedecms无缩略图)
如果我们需要根据不同栏目显示不同的无缩略图的话。就需要对标签函数做出修改。
一、动态:
动态一般是在plus文件夹下显示。对应的文件是/plus/list.PHP和/include/arc.listview.class.PHP
动态页里面的{dede:list 标签就要修改arc.listview.class.PHP文件,找到defaultpic.gif:
在function GetArcList函数里:
TypeID==121){ $row['litpic'] = $GLOBALS['cfg_cmspath'].'/images/default_course.gif'; }else if($this->TypeID==48 || $this->TypeID==51 || $this->TypeID==52){ $row['litpic'] = $GLOBALS['cfg_cmspath'].'/images/default_teacher.gif'; }else if($this->TypeID==122){ $row['litpic'] = $GLOBALS['cfg_cmspath'].'/images/default_resume.gif'; }else{ $row['litpic'] = $GLOBALS['cfg_cmspath'].'/images/defaultpic.gif'; } }
二、静态:
找到/include/arc.archives.class.PHP
在function ParAddTable函数里:
Fields['litpic'] == '-' || $this->Fields['litpic'] == ''){ if($this->Fields['channel']==6){ $this->Fields['litpic'] = $GLOBALS['cfg_cmspath'].'/images/default_course.gif'; }else{ if($this->Fields['typeid']==48 || $this->Fields['typeid']==51 || $this->Fields['typeid']==52){ $this->Fields['litpic'] = $GLOBALS['cfg_cmspath'].'/images/default_teacher.gif'; }else{ $this->Fields['litpic'] = $GLOBALS['cfg_cmspath'].'/images/defaultpic.gif'; } } }原文链接:https://www.f2er.com/dedecms/403800.html