一、添加字段 (后臺-系統(tǒng)-SQL命令行工具-執(zhí)行)
ALTER TABLE `dede_arctype` ADD `enname` CHAR( 255 ) NOT NULL DEFAULT '';
ALTER TABLE `dede_arctype` ADD `litpic` CHAR( 255 ) NOT NULL DEFAULT '';
ALTER TABLE `dede_arctype` ADD `litimg` CHAR( 255 ) NOT NULL DEFAULT '';
如圖
二、備份你的以下7個文件
  • /dede/templets/catalog_add.htm
  • /dede/templets/catalog_edit.htm
  • /dede/catalog_add.php
  • /dede/catalog_edit.php
  • /include/taglib/channel.lib.php
  • /include/taglib/channelartlist.lib.php
  • /include/taglib/type.lib.php
三、下載修改好的文件根據(jù)程序編碼覆蓋到你網(wǎng)站對應(yīng)目錄
如果不想直接覆蓋文件或者你的文件是修改過的話,參考最下面的 第六、七、八步 修改方法來
四、清除瀏覽器緩存和臨時文件,這一步非常重要
如果上傳圖片失敗一般是瀏覽器緩存引起,可以試試換個瀏覽器試試
五、模板調(diào)用寫法
{dede:channelartlist row=7 typeid=top}
英文名稱:{dede:field.enname/}
欄目大圖:{dede:field.litpic/}
欄目小圖:{dede:field.litimg/}
{/dede:channelartlist}
{dede:channel row=7 type=top}
英文名稱:[field:enname/]
欄目大圖:[field:litpic/]
欄目小圖:[field:litimg/]
{/dede:channel}
{dede:type typeid=1}
英文名稱:[field:enname/]
欄目大圖:[field:litpic/]
欄目小圖:[field:litimg/]
{/dede:type}
六、模板調(diào)用頂級欄目英文名稱、頂級欄目大圖、頂級欄目小圖 的寫法
6.1、先參考這個教程添加個自定義方法
6.2、頂級欄目英文名稱
{dede:field.typeid function=getToptype(@me,enname)/}
6.3、頂級欄目大圖
{dede:field.typeid function=getToptype(@me,litpic)/}
6.4、頂級欄目小圖
{dede:field.typeid function=getToptype(@me,litimg)/}
以上是覆蓋文件的方式完成對欄目添加[英文名稱] [欄目大圖] [欄目小圖] 功能

以下是自己自由修改的方式,根據(jù)自己的情況來
七、添加2個文件到后臺目錄
  • /dede/catalog_up.php
  • /dede/js/catalog.js
八、添加代碼
8.1、/dede/templets/catalog_add.htm 找到
onSubmit="return checkSubmit();"
改成
onSubmit="return checkSubmit();" enctype="multipart/form-data"
繼續(xù)找到
name="typename"
在它下面的</tr>另起一行插入代碼
<script language='javascript' src='js/catalog.js'></script>
<tr>
<td class='bline' height="26" style="padding-left:10px;"> 英文名稱: </td>
<td class='bline'>
<input name="enname" id="enname" type="text" size="30" class="iptxt" />
</td>
</tr>
<tr>
<td height="24" colspan="5" class="bline">
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="26" style="padding-left:10px;"> 欄目大圖: </td>
<td width="482">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td height="30">
<input name="litpic" id="litpic" type="text" style="width:220px;opacity:1;margin-left:0;cursor:auto;" value="" />
<input type="button"  value="本地上傳" style="width:70px;cursor:pointer;" />
<iframe name='uplitpicfra' id='uplitpicfra' src='' width='200' height='200' style='display:none'></iframe>
<span class="litpic_span"><input name="bigpic" type="file" id="bigpic"  onChange="SeePicNew(this, 'divpicview', 'uplitpicfra', 165, 'catalog_add.php','save','bigpic','litpic');" size="1" class='np coolbg' style="cursor:pointer;height:20px;margin-left:-20px;opacity:0;width:85px;" /></span>
<input type="button" name="Submit2" value="站內(nèi)選擇" style="margin-left:8px;" onClick="SelectImageN('form1.litpic','imgstick','picview');" class='np coolbg'/>
<input type='checkbox' class='np' name='ddisremote' value='1'>遠(yuǎn)程 
</td>
</tr>
</table>
</td>
<td width="160" align="center">
<div id='divpicview' class='divpre'><img height="50" src="images/pview.gif"></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="24" colspan="5" class="bline">
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="26" style="padding-left:10px;"> 欄目小圖: </td>
<td width="482">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td height="30">
<input name="litimg" id="litimg" type="text" style="width:220px" value="" />
<input type="button"  value="本地上傳" style="width:70px;cursor:pointer;" />
<iframe name='upsmallpicfra' id='upsmallpicfra' src='' width='200' height='200' style='display:none'></iframe>
<span class="litpic_span"><input name="smallpic" type="file" id="smallpic"  onChange="SeePicNew(this, 'divsmallpicview', 'upsmallpicfra', 165, 'catalog_add.php', 'save', 'smallpic', 'litimg');" size="1" class='np coolbg' style="cursor:pointer;height:20px;margin-left:-20px;opacity:0;width:85px;"/></span>
<input type="button" name="Submit2" value="站內(nèi)選擇" style="margin-left:8px;" onClick="SelectImageN('form1.litimg','imgstick','smallpicview');" class='np coolbg'/>
<input type='checkbox' class='np' name='ddisremote2' value='1'>遠(yuǎn)程 
</td>
</tr>
</table>
</td>
<td width="160" align="center">
<div id='divsmallpicview' class='divpre'><img height="50" src="images/pview.gif"></div>
</td>
</tr>
</table>
</td>
</tr>
8.2、/dede/templets/catalog_edit.htm 找到
onSubmit="return checkSubmit();"
改成
onSubmit="return checkSubmit();" enctype="multipart/form-data"
繼續(xù)找到
name="typename"
在它下面的</tr>另起一行插入代碼
<script language='javascript' src='js/catalog.js'></script>
<tr>
<td class='bline' height="26" style="padding-left:10px;"> 英文名稱: </td>
<td class='bline'>
<input name="enname" id="enname" type="text" size="30" class="iptxt" value="<?php echo $myrow['enname']?>" />
</td>
</tr>
<tr>
<td height="24" colspan="5" class="bline">
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="26" style="padding-left:10px;"> 欄目大圖: </td>
<td width="482">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td height="30">
<input name="litpic" id="litpic" type="text" style="width:220px;opacity:1;margin-left:0;cursor:auto;" value="<?php echo $myrow['litpic']?>" />
<input type="button"  value="本地上傳" style="width:70px;cursor:pointer;" />
<iframe name='uplitpicfra' id='uplitpicfra' src='' width='200' height='200' style='display:none'></iframe>
<span class="litpic_span"><input name="bigpic" type="file" id="bigpic"  onChange="SeePicNew(this, 'divpicview', 'uplitpicfra', 165, 'catalog_edit.php','save','bigpic','litpic');" size="1" class='np coolbg' style="cursor:pointer;height:20px;margin-left:-20px;opacity:0;width:85px;" /></span>
<input type="button" name="Submit2" value="站內(nèi)選擇" style="margin-left:8px;" onClick="SelectImageN('form1.litpic','imgstick','picview');" class='np coolbg'/>
<input type='checkbox' class='np' name='ddisremote' value='1'>遠(yuǎn)程 
</td>
</tr>
</table>
</td>
<td width="160" align="center">
<div id='divpicview' class='divpre'><img height="50" src="<?php if($myrow['litpic']!="") echo $myrow['litpic']; else echo "images/pview.gif";?>"></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="24" colspan="5" class="bline">
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="26" style="padding-left:10px;"> 欄目小圖: </td>
<td width="482">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td height="30">
<input name="litimg" id="litimg" type="text" style="width:220px" value="<?php echo $myrow['litimg']?>" />
<input type="button"  value="本地上傳" style="width:70px;cursor:pointer;" />
<iframe name='upsmallpicfra' id='upsmallpicfra' src='' width='200' height='200' style='display:none'></iframe>
<span class="litpic_span"><input name="smallpic" type="file" id="smallpic"  onChange="SeePicNew(this, 'divsmallpicview', 'upsmallpicfra', 165, 'catalog_edit.php', 'save', 'smallpic', 'litimg');" size="1" class='np coolbg' style="cursor:pointer;height:20px;margin-left:-20px;opacity:0;width:85px;"/></span>
<input type="button" name="Submit2" value="站內(nèi)選擇" style="margin-left:8px;" onClick="SelectImageN('form1.litimg','imgstick','smallpicview');" class='np coolbg'/>
<input type='checkbox' class='np' name='ddisremote2' value='1'>遠(yuǎn)程 
</td>
</tr>
</table>
</td>
<td width="160" align="center">
<div id='divsmallpicview' class='divpre'><img height="50" src="<?php if($myrow['litimg']!="") echo $myrow['litimg']; else echo "images/pview.gif";?>"></div>
</td>
</tr>
</table>
</td>
</tr>
8.3、/dede/catalog_add.php 找到 大概在239行
UpDateCatCache();
在它上面加入
//添加英文名稱欄目大圖欄目小圖
require_once(DEDEADMIN.'/inc/inc_archives_functions.php');
if(!empty($ddisremote))
{
$litpic = UploadOneImage('imgfile', $litpic, $ddisremote, 1);
}
if(!empty($ddisremote2))
{
$litimg = UploadOneImage('imgfile', $litimg, $ddisremote2, 1);
}
$id = $dsql->GetLastID();
$upquery = "UPDATE `dede_arctype` SET `enname`='$enname',`litpic`='$litpic',`litimg`='$litimg' WHERE id='$id' ";
$dsql->ExecuteNoneQuery($upquery);
//添加英文名稱欄目大圖欄目小圖
8.4、/dede/catalog_edit.php 找到 大概在106行
UpDateCatCache();
在它上面加入
//添加英文名稱欄目大圖欄目小圖
require_once(DEDEADMIN.'/inc/inc_archives_functions.php');
if(!empty($ddisremote))
{
$litpic = UploadOneImage('imgfile', $litpic, $ddisremote, 1);
}
if(!empty($ddisremote2))
{
$litimg = UploadOneImage('imgfile', $litimg, $ddisremote2, 1);
}
$upquery = "UPDATE `dede_arctype` SET `enname`='$enname',`litpic`='$litpic',`litimg`='$litimg' WHERE id='$id' ";
$dsql->ExecuteNoneQuery($upquery);
//添加英文名稱欄目大圖欄目小圖
九、標(biāo)簽庫輸出修改
9.1、/include/taglib/channel.lib.php 找到
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
有4處這樣的多個字段,4處都改成
*
9.2、/include/taglib/channelartlist.lib.php 找到
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
這樣的多個字段,改成
*
9.3、/include/taglib/type.lib.php 找到
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
這樣的多個字段,改成
*
以上第六、第七、第八自己修改完成欄目添加 [英文名稱] [欄目大圖] [欄目小圖] 功能