此成果添加涉及到以下文件:
dede/catalog_add.php
dede/catalog_edit.php
dede/templets/catalog_add.htm
dede/templets/catalog_edit.htm
include/taglib/channel.lib.php
此进级修改要领,在V5.7,V5.7sp1 测试通过,其他版本未测试,道理基内情同,请各人自行测试是否可行。
首先给 栏目表(`dede_arctype`)增加一个字段typeimg
alter table `dede_arctype` add `typeimg` varchar(200) NOT NULL default ;修改catalog_add.php文件
打开dede/catalog_add.php
查找$queryTemplate = “insert into `dede_arctype`
将
(reid,topid,sortrank,typename,typedir,替换为:
(reid,topid,sortrank,typename,typedir,typeimg,将
(‘~reid~’,'~topid~’,'~rank~’,'~typename~’,'~typedir~’,替换为:
(‘~reid~’,'~topid~’,'~rank~’,'~typename~’,'~typedir~’,'~typeimg~’,查找$in_query = “INSERT INTO `dede_arctype`
将
(reid,topid,sortrank,typename,typedir,替换为:
(reid,topid,sortrank,typename,typedir,typeimg,将
(‘$reid’,'$topid’,'$sortrank’,'$typename’,'$typedir’,替换为:
(‘$reid’,'$topid’,'$sortrank’,'$typename’,'$typedir’,'$typeimg’,生存catalog_add.php
下面修改catalog_edit.php文件
打开dede/catalog_edit.php
查找$upquery = “Update `dede_arctype` set
在 typedir=’$typedir’, 其下面增加一行:
`typeimg`=’$typeimg’,生存catalog_edit.php
开始修改栏目添加模板文件
打开dede/templets/catalog_add.htm
在最上面找到这个段
<title>栏目打点</title><link href=http://down.chinaz.com/”css/base.css” rel=”stylesheet” type=”text/css”>
替换为:
<title>栏目打点</title><link href=http://down.chinaz.com/”css/base.css” rel=”stylesheet” type=”text/css”>
<script language=”javascript” src=http://down.chinaz.com/”../include/js/dedeajax2.js”></script>
<script language=’javascript’ src=http://down.chinaz.com/”js/main.js”></script>
<script type=”text/javascript” src=http://down.chinaz.com/”js/calendar/calendar.js”></script>
列表定名法则:
<tr><td height="26" style="padding-left:10px;">列表定名法则:</td>
<td>
<input name="namerule2" type="text" id="namerule2" value="{typedir}/list_{tid}_{page}.html" class="pubinputs" style="width:250px" />
<img src=http://down.chinaz.com/"images/help.gif" alt="辅佐" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar3')"/></td>
</tr>
在标签下面增加一行:
<!--增加栏目缩略图--><tr>
<td width="90" style="padding-left:10px;">栏目图片:</td>
<td width="560">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td height="30">
<input name="typeimg" type="text" id="typeimg" style="width:240px" />
<input type="button" value="当地上传" style="width:70px;cursor:pointer;display:none" />
<iframe src=''></iframe>
<span class="litpic_span"><input name="litpic" type="file" id="litpic" onChange="SeePicNew(this, 'divpicview', 'uplitpicfra', 165, 'archives_add.php');" size="1"/></span>
<input type="button" name="Submit2" value="选择图片" style="margin-left:8px;" onClick="SelectImage('form1.typeimg','small');"/>
<input type="button" name="Submit2" value="裁剪" style="margin-left:8px;" onClick="imageCut('typeimg');"/>
<input type='checkbox' value='1'/>长途<br />(栏目模板里用{dede:field.typeimg /}挪用
</td>
</tr>
</table>
</td>
<td width="150" align="center">
<div></div>
</td>
</tr>
<!--增加栏目缩略图-->
生存catalog_add.htm
开始修改栏目编辑模板文件
打开dede/templets/catalog_edit.htm
在最上面找到这个段
<title>栏目打点</title><link href=http://down.chinaz.com/”css/base.css” rel=”stylesheet” type=”text/css”>
替换为:
<title>栏目打点</title><link href=http://down.chinaz.com/”css/base.css” rel=”stylesheet” type=”text/css”>
<script language=”javascript” src=http://down.chinaz.com/”../include/js/dedeajax2.js”></script>
<script language=”javascript” src=http://down.chinaz.com/”js/main.js”></script>
<script type=”text/javascript” src=http://down.chinaz.com/”js/calendar/calendar.js”></script>