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

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

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

織夢欄目添加banner大圖上傳選項

1.先給數據庫中的dede_arctype表增加一個字段

后臺 - 系統(tǒng) - 系統(tǒng)設置 - 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="站內選擇"??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="站內選擇"??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

注意:這個文件有4處都需要改

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

typedir

改成

typedir,typebigpic

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

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

在它下面添加

$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/}

分享標題:織夢增加欄目縮略圖、欄目圖片功能的方法
分享路徑:http://muchs.cn/article22/pphscc.html

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

廣告

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

商城網站建設