dedecms网站栏目增加缩略图的方法

前端之家收集整理的这篇文章主要介绍了dedecms网站栏目增加缩略图的方法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Dedecms/486.html" target="_blank">Dedecms 栏目增加缩略图功能方法


文件如下(注意备份):

复制代码
代码如下:
PHPcode16" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">
dede/catalog_add.PHP 
dede/catalog_edit.PHP
dede/templets/catalog_add.htm
dede/templets/catalog_edit.htm

文件夹templets这个目录,在里面新建一个文件夹typeimg,用于独立存放栏目缩略图

后台执行sql(前缀默认为dede_ 具体前缀根据自己网站修改):

复制代码
代码如下:
PHPcode17" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">
alter table `dede_arctype` add `typeimg` char(100) NOT NULL default '';
打开dede/catalog_add.PHP



复制代码
代码如下:
PHPcode18" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">
$queryTemplate = "insert into `dede_arctype`

复制代码
代码如下:
PHPcode19" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">
(reid,topid,sortrank,typename,typedir,


复制代码
代码如下:
PHPcode20" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,typeimg,

复制代码

代码如下:
PHPcode21" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">
('~reid~','~topid~','~rank~','~typename~','~typedir~',sans-serif;line-height:25px;white-space:normal;">
复制代码
代码如下:
PHPcode22" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,'~typeimg~',sans-serif;font-size:14px;white-space:normal;background-color:#F7FCFF;"> 打开dede/catalog_edit.PHP

复制代码
代码如下:
PHPcode23" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">
$upquery = "Update `dede_arctype` set


复制代码 代码如下:
PHPcode24" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">
`typeimg`='$typeimg',sans-serif;font-size:14px;white-space:normal;background-color:#F7FCFF;"> 打开dede/templets/catalog_add.htm 查找

复制代码
代码如下:
PHPcode25" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">

 

增加以下内容

复制代码 代码如下:

PHPcode26" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">
图片:  
 
(栏目模板里用{dede:field.typeimg /}调用


复制代码 代码如下:
PHPcode27" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">
 

内容:

复制代码 代码如下:

PHPcode28" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">
图片:  
 
(栏目模板里用{dede:field.typeimg /}调用

添加或修改图片时在 栏目管理》高级选项上传即可。

文章内容页调用打开\include\arc.archives.class.PHP 查找

复制代码
代码如下:
PHPcode29" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">
if($this->ChannelUnit->ChannelInfos['issystem']!=-1)


复制代码 代码如下:
PHPcode30" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,sans-serif;line-height:25px;white-space:normal;">
$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);

复制代码
代码如下:
PHPcode31" style="clear:both;border-right-color:#0099CC;border-right-width:1px;border-right-style:solid;padding:0px 3px;font-size:14px;background-color:#DDEDFB;margin:0px auto 3px;overflow:hidden;border-left-color:#0099CC;border-left-width:1px;border-left-style:solid;word-break:break-all;border-bottom-color:#0099CC;border-bottom-width:1px;border-bottom-style:solid;color:#444444;font-family:Tahoma,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);

增加缩略图方法就介绍到这了,有需要的朋友可以自行参考修改调整。
dedecms栏目增加图片

猜你在找的Dedecms相关文章