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 '';
如圖
鏈接: https://pan.baidu.com/s/1d-sqOE3Shdv7cZUfiniiAQ 提取碼: 75ca
如果不想直接覆蓋文件或者你的文件是修改過(guò)的話,參考最下面的 第六、七、八步 修改方法來(lái)
如果上傳圖片失敗一般是瀏覽器緩存引起,可以試試換個(gè)瀏覽器試試
{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}
6.1、先參考這個(gè)教程添加個(gè)自定義方法
https://www.dedehtml.com/notes/get-type-infos.html
6.2、頂級(jí)欄目英文名稱
{dede:field.typeid function=getToptype(@me,enname)/}
6.3、頂級(jí)欄目大圖
{dede:field.typeid function=getToptype(@me,litpic)/}
6.4、頂級(jí)欄目小圖
{dede:field.typeid function=getToptype(@me,litimg)/}
以上是覆蓋文件的方式完成對(duì)欄目添加[英文名稱] [欄目大圖] [欄目小圖] 功能
以下是自己自由修改的方式,根據(jù)自己的情況來(lái)
文件下載
鏈接: https://pan.baidu.com/s/1fkzxldVho6JeFznNMWjLpQ 提取碼: yjqs
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, 'ppicview', '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">
<p id='ppicview' class='ppre'><img height="50" src="images/pview.gif"></p>
</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, 'psmallpicview', '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">
<p id='psmallpicview' class='ppre'><img height="50" src="images/pview.gif"></p>
</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, 'ppicview', '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">
<p id='ppicview' class='ppre'><img height="50" src="<?php if($myrow['litpic']!="") echo $myrow['litpic']; else echo "images/pview.gif";?>"></p>
</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, 'psmallpicview', '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">
<p id='psmallpicview' class='ppre'><img height="50" src="<?php if($myrow['litimg']!="") echo $myrow['litimg']; else echo "images/pview.gif";?>"></p>
</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);
//添加英文名稱欄目大圖欄目小圖
7.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);
//添加英文名稱欄目大圖欄目小圖
9.1、/include/taglib/channel.lib.php 找到
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
有4處這樣的多個(gè)字段,4處都改成
*
9.2、/include/taglib/channelartlist.lib.php 找到
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
這樣的多個(gè)字段,改成
*
9.3、/include/taglib/type.lib.php 找到
id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath
這樣的多個(gè)字段,改成
*
以上第六、第七、第八自己修改完成欄目添加 [英文名稱] [欄目大圖] [欄目小圖] 功能
版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: 織夢(mèng)欄目添加 [英文名稱] [欄目大圖] [欄目小圖] 功能