織夢CMS後臺欄目添加欄目縮略圖修改

新加字段 typeimg
後臺執行SQL:

alter table `dede_arctype` add `typeimg` char(100) NOT NULL default ”;

涉及到文件:

dede/catalog_add.php
dede/catalog_edit.php
dede/templets/catalog_add.htm
dede/templets/catalog_edit.htm

打開dede/catalog_add.php
查找$queryTemplate = “insert into `dede_arctype`



(reid,topid,sortrank,typename,typedir,

替換爲

(reid,topid,sortrank,typename,typedir,typeimg,


打開dede/catalog_edit.php
查找

$upquery = “Update `dede_arctype` set

在其下面新加一行
`typeimg`=’$typeimg’,

打開dede/templets/catalog_add.htm
查找

<tr>
<td height=”26″>列表命名規則:</td>
<td>
<input name=”namerule2″ type=”text” id=”namerule2″ value=”{typedir}/list_{tid}_{page}.html” style=”width:250px” />
<img src=”img/help.gif” alt=”幫助” width=”16″ height=”16″ border=”0″ style=”cursor:pointer” onClick=”ShowHide(‘helpvar3′)”/></td>
</tr>

在其下面增加以下內容

<tr>
<td height=”65″ style=”padding-left:10px;”>欄目圖片:</td>
<td>
<input name=”typeimg” type=”text” style=”width:250px” id=”typeimg” value=”" />
<input type=”button” name=”set9″ value=”瀏覽… “class=”coolbg np” style=”width:60px” onClick=”SelectImage(‘form1.typeimg’,”);” />
</td>
</tr>
並在文件的head增加以下內容
<script language=’javascript’ src=”js/main.js”></script>

打開dede/templets/catalog_edit.htm
在剛前面的位置加入:
<tr>
<td height=”65″ style=”padding-left:10px;”>欄目圖片:</td>
<td>
<input name=”typeimg” type=”text” style=”width:250px” id=”typeimg” value=”<?php echo $myrow['typeimg']?>” />
<input type=”button” name=”set9″ value=”瀏覽… “class=”coolbg np” style=”width:60px” onClick=”SelectImage(‘form1.typeimg’,”);” />
</td>
</tr>

說明:下面這句會調用出已添加的路片路徑。
<?php echo $myrow['typeimg']?>

並在文件的head增加以下內容
<script language=’javascript’ src=”js/main.js”></script>

在模板中數據調用跟調用欄目名稱形式相同

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章