600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 织梦DedeCMS增加栏目缩略图 栏目图片功能的方法

织梦DedeCMS增加栏目缩略图 栏目图片功能的方法

时间:2021-07-26 06:51:36

相关推荐

织梦DedeCMS增加栏目缩略图 栏目图片功能的方法

网站每个栏目都有不同的banner大图,为了方便客户可以直接在后台栏目处添加和更换这个栏目图片,需要给DedeCMS二次开发,增加栏目图片上传选项。

织梦栏目添加banner大图上传选项

1.先给数据库中的dede_arctype表增加一个字段

后台-系统-系统设置- SQL命令行工具

ALTER TABLE `dede_arctype` ADD `typebigpic` CHAR( 255 ) NOT NULL DEFAULT ”;

2.打开\dede\templets\catalog_add.htm搜索

name=”typename”

在它的下面加入

图片地址:

3.打开\dede\templets\catalog_edit.htm搜索

name=”typename”

在它的下面加入

.divpre,.divpre img{height:50px;}
图片地址:

4.打开\dede\catalog_add.php搜索

$in_query = “INSERT INTO `dede_arctype`(reid,topid,sortrank,typename

改成

$in_query = “INSERT INTO `dede_arctype`(reid,topid,sortrank,typename,typebigpic

继续搜索

VALUES(‘$reid’,’$topid’,’$sortrank’,’$typename’

改成

VALUES(‘$reid’,’$topid’,’$sortrank’,’$typename’,’$typebigpic’

5.打开\dede\catalog_edit.php搜索

`smalltypes`=’$smalltypes’

改成

`smalltypes`=’$smalltypes’,`typebigpic`=’$typebigpic’

6.打开\include\taglib\channelartlist.lib.php搜索

typedir

改成

typedir,typebigpic

7.打开\include\taglib\channel.lib.php搜索

typedir

改成

typedir,typebigpic

注意:这个文件有4处都需要改

8.打开\include\taglib\type.lib.php搜索

typedir

改成

typedir,typebigpic

9.\include\arc.listview.class.php搜索

//设置环境变量

在它下面添加

$this->Fields[‘typebigpic’] = $this->TypeLink->TypeInfos[‘typebigpic’];

后台栏目效果

前台模板中调用标签

{dede:channelartlist}{dede:field.typebigpic/}{/dede:channelartlist}{dede:channel}[field:typebigpic/]{/dede:channel}{dede:type}[field:typebigpic/]{/dede:type}

栏目列表页单独调用

{dede:field.typebigpic/}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。
<input name="typebigpic" type="text" value=""/>.divpre,.divpre img{height:50px;}<img src="/a/dedejq/" width="100" height="50" name="picview">