織夢增加欄目縮略圖、欄目圖片功能的方法

網(wǎng)站每個(gè)欄目都有不同的banner大圖,為了方便客戶可以直接在后臺欄目處添加和更換這個(gè)欄目圖片,我們需要給dedecms二次開發(fā),增加欄目圖片上傳選項(xiàng)。

在成都網(wǎng)站制作、成都做網(wǎng)站過程中,需要針對客戶的行業(yè)特點(diǎn)、產(chǎn)品特性、目標(biāo)受眾和市場情況進(jìn)行定位分析,以確定網(wǎng)站的風(fēng)格、色彩、版式、交互等方面的設(shè)計(jì)方向。創(chuàng)新互聯(lián)建站還需要根據(jù)客戶的需求進(jìn)行功能模塊的開發(fā)和設(shè)計(jì),包括內(nèi)容管理、前臺展示、用戶權(quán)限管理、數(shù)據(jù)統(tǒng)計(jì)和安全保護(hù)等功能。

織夢欄目添加banner大圖上傳選項(xiàng)

1.先給數(shù)據(jù)庫中的dede_arctype表增加一個(gè)字段

后臺 - 系統(tǒng) - 系統(tǒng)設(shè)置 - SQL命令行工具

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

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

name="typename"

在它的</tr>下面加入

<script?language='javascript'?src="js/main.js"></script>
<tr?id="pictable">
<td?height="24"?colspan="6">
<table?border="0"?cellspacing="0"?cellpadding="0">
<tr>
<td?width="158">?&nbsp;圖片地址:</td>
<td?width="560">
<table?width="100%"?border="0"?cellspacing="1"?cellpadding="1">
<tr>
<td?height="30">
<input?name="typebigpic"?type="text"?id="picname"??value=""?/>
<input?type="button"?name="Submit2"?value="站內(nèi)選擇"??onClick="SelectImage('form1.picname','');"?class='np?coolbg'/>
</td>
</tr>
</table>
</td>
<td?width="270">
<style>
.divpre,.divpre?img{height:50px;}
</style>
<img?src="images/pview.gif"?width="100"?height="50"?id="picview"?name="picview">
</td>
</tr>
</table>
</td>
</tr>

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

name="typename"

在它的</tr>下面加入

<script?language='javascript'?src="js/main.js"></script>
<tr?id="pictable">
<td?height="24"?colspan="6">
<table?border="0"?cellspacing="0"?cellpadding="0">
<tr>
<td?width="158">?&nbsp;圖片地址:</td>
<td?width="560">
<table?width="100%"?border="0"?cellspacing="1"?cellpadding="1">
<tr>
<td?height="30">
<input?name="typebigpic"?type="text"?id="picname"??value="<?php?echo?$myrow['typebigpic']?>"?/>
<input?type="button"?name="Submit2"?value="站內(nèi)選擇"??onClick="SelectImage('form1.picname','');"?class='np?coolbg'/>
</td>
</tr>
</table>
</td>
<td?width="270">
<style>
.divpre,.divpre?img{height:50px;}
</style>
<img?src="<?php?if($myrow['typebigpic']!="")?echo?$myrow['typebigpic'];?else?echo?"images/pview.gif";?>"?width="100"?height="50"?id="picview"?name="picview">
</td>
</tr>
</table>
</td>
</tr>

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

繼續(xù)搜索

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

注意:這個(gè)文件有4處都需要改

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

typedir

改成

typedir,typebigpic

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

//設(shè)置環(huán)境變量

在它下面添加

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

后臺欄目效果

織夢增加欄目縮略圖、欄目圖片功能的方法

前臺模板中調(diào)用標(biāo)簽

{dede:channelartlist}{dede:field.typebigpic/}{/dede:channelartlist}

{dede:channel}[field:typebigpic/]{/dede:channel}

{dede:type}[field:typebigpic/]{/dede:type}

欄目列表頁單獨(dú)調(diào)用

{dede:field.typebigpic/}

分享標(biāo)題:織夢增加欄目縮略圖、欄目圖片功能的方法
分享路徑:http://bm7419.com/article22/pphscc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動網(wǎng)站建設(shè)云服務(wù)器、外貿(mào)建站域名注冊、網(wǎng)站策劃網(wǎng)站設(shè)計(jì)公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

商城網(wǎng)站建設(shè)