怎樣實(shí)現(xiàn)給DEDE的欄目增加欄目圖片,織夢(mèng)文章
導(dǎo)讀:織夢(mèng)文章織夢(mèng)文章前兩天用DEDE做二次開發(fā)的時(shí)候,遇到一個(gè)問題,領(lǐng)導(dǎo)讓給每個(gè)欄目增加一個(gè)欄目圖片的功能,網(wǎng)上找了些東西,結(jié)合自己實(shí)際做的時(shí)候的方法,下面詳細(xì)描述下具體的實(shí)現(xiàn)方式織夢(mèng)模板修改dede會(huì)員中心模板。
前兩天用DEDE做二次開發(fā)的時(shí)候,遇到一個(gè)問題,領(lǐng)導(dǎo)讓給每個(gè)欄目增加一個(gè)欄目圖片的功能,網(wǎng)上找了些東西,結(jié)合自己實(shí)際做的時(shí)候的方法,下面詳細(xì)描述下具體的實(shí)現(xiàn)方式(只測(cè)試了V5.7版本,對(duì)低版本是否適用不太清楚)。
1. 首先,給欄目分類表`dede_arctype`表增加縮略圖字段`typeimgdede免費(fèi)校板下戰(zhàn)`,用phpMyAdmin或其他數(shù)據(jù)庫(kù)管理工具,直接在數(shù)據(jù)表中添加該字段,或者運(yùn)行下面的SQL語句:
alter table `dede_arctype` add `typeimg` char(100) NOT NULL default '';2. 修改頁面,在表單中添加相應(yīng)的字段,涉及到的頁面有:dede/catalog_add.phpdede/catalog_edit.phpdede/templets/catalog_add.htmdede/templets/catalog_edit.htm
2.1 打開dede/templets/catalog_add.htm,查找
<tr> <td class='bline' height="26" style="padding-left:10px;"><font color='red'>欄目名稱:</font></td> <td class='bline'><input name="typename" type="text" id="typename" size="30" class="iptxt" /></td> </tr>在其下面加上如下代碼:
<tr> <td class='bline' height="26" style="padding-left:10px;"><font color='red'>欄目圖片:</font></td> <td class='bline'> <input name="typeimg" type="text" style="width:250px" id="typeimg" class="alltxt" value="" /> <input type="button" name="set9" value="瀏覽... "class="coolbg np" style="width:60px" onClick="SelectImage('form1.typeimg','');" /> </td> </tr>并在<head></head>之間引入如下js:
<script language="javascript" src="js/main.js"></script>2.2 打開dede/catalog_add.php頁面,保存上傳欄目圖片的內(nèi)容,查找
$queryTemplate = "INSERT INTO在
(reid,topid,sortrank,typename的后面添加 ,typeimg 字段,再找到
('~reid~','~topid~','~rank~','~typename~',在其后面添加 ,’~typeimg~’ 字段,接著查找
$in_query = "INSERT INTO在
(reid,topid,sortrank,typename后面同樣添加 ,typeimg 字段,并在
('$reid','$topid','$sortrank','$typename'后面添加 ,’$typeimg’ 字段。
2.3 打開dede/templets/catalog_edit.htm頁面,查找
<tr> <td class='bline' height="26" style="padding-left:10px;"><font color='red'>欄目名稱:</font></td> <td class='bline'><input name="typename" type="text" id="typename" size="30" value="<?php echo $myrow['typename']?>" class="iptxt" /></td> </tr>聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-07-19 ,文章怎樣實(shí)現(xiàn)給DEDE的欄目增加欄目圖片,織夢(mèng)文章主要講述欄目,標(biāo)簽,織夢(mèng)網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請(qǐng)保留鏈接: http://www.bifwcx.com/article/web_30178.html
為你推薦與怎樣實(shí)現(xiàn)給DEDE的欄目增加欄目圖片,織夢(mèng)文章相關(guān)的文章
-
dedecms 織夢(mèng)5.7 圖集實(shí)現(xiàn)分頁功能,織夢(mèng)技術(shù)
(51)人喜歡 2023-07-19 -
織夢(mèng)模板如何顯示完整的標(biāo)題,dedecms
(101)人喜歡 2023-07-19 -
DedeCms織夢(mèng)后臺(tái)添加編輯文章空白解決辦法
(195)人喜歡 2023-07-19 -
DedeCMS Error: (PHP 5.3 and above) P,織夢(mèng)文章
(102)人喜歡 2023-07-19 -
織夢(mèng)后臺(tái)登錄界面更改,織夢(mèng)技術(shù)
(88)人喜歡 2023-07-19 -
織夢(mèng)dedecms模塊管理空白不顯示的四種解決
(61)人喜歡 2023-07-19