dedecms织梦怎样根据不同栏目显示不同的默认缩略图
用过dedecms的都知道,当显示文章的时候,如果该文章没有添加缩略图,那么会显示系统默认的缩略图 /images/defaultpic.gif (dedecms无缩略图)如果我们需要根据不同栏目显示不同的无缩略图的话。就需要对标签函数做出修改。
一般情况下显示分为动态和静态。(文件不同)
一、动态:
动态一般是在plus文件夹下显示。对应的文件是/plus/list.php和/include/arc.listview.class.php
动态页里面的{dede:list 标签就要修改arc.listview.class.php文件,找到defaultpic.gif:
在function GetArcList函数里:
二、静态:if($row['litpic'] == '-' || $row['litpic'] == ''){if($this->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函数里:
if($this->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.dedexuexi.com/dedejiaocheng/eckf/820.html
本站部分文章搜集与网络,如有侵权请联系本站,转载请说明出处。