dedecms
文本编辑器
打开文件夹templets这个目录,在里面新建一个文件夹typeimg,用于独立存放栏目缩略图
新加字段 typeimg后台执行SQL(前缀默认为dede_ 具体前缀根据自己网站修改):alter table `dede_arctype` add `typeimg` char(100) NOT NULL default '';
打开dede/catalog_add.php查找(ctrl+f):$queryTemplate = 'insert into `dede_arctype`1、将:(reid,topid,sortrank,typename,typedir,替换为:(reid,topid,sortrank,typename,typedir,typeimg,2、将:('~reid~','~topid~','~rank~','~typename~','~typedir~',替换为:('~reid~','~topid~','~rank~','~typename~','~typedir~','~typeimg~',
打开dede/catalog_edit.php查找(ctrl+f):$upquery = 'Update `dede_arctype` set在其下面新加一行:`typeimg`='$typeimg',
完成!添加或修改图片时在 栏目管理》高级选项上传即可。
打开\include\arc.archives.class.php查找(ctrl+f)下面代码:if($this->ChannelUnit->ChannelInfos['issystem']!=-1)将:$query = 'Select arc.*,tp.reid,tp.typedir,ch.addtable from `dede_archives` arc left join dede_arctype tp on tp.id=arc.typeid left join dede_channeltype as ch on arc.channel = ch.id where arc.id='$aid' '; $this->Fields = $this->dsql->GetOne($query);替换为:$query = 'Select arc.*,tp.reid,tp.typedir,tp.typeimg,ch.addtable from `dede_archives` arc left join dede_arctype tp on tp.id=arc.typeid left join dede_channeltype as ch on arc.channel = ch.id where arc.id='$aid' '; $this->Fields = $this->dsql->GetOne($query);
这样可以直接在文章内容也也调用栏目缩略图了。
如果复制的代码无效,请检查代码中的逗号和引号是否为英文样式