1.先给数据库中的dede_arctype表增加一个字段
后台 - 系统 - 系统设置 - SQL命令行工具
ALTER TABLE `dede_arctype` ADD `typeimg` CHAR( 255 ) NOT NULL DEFAULT '';
2.打开 \dede\templets\catalog_add.htm 搜索
<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="images/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar3')"/></td> </tr>
在下方增加
<!--增加栏目图--> <tr> <td width="90" height="81" style="padding-left:10px;"><font color='red'>栏目图片2:</font></td> <td width="500"> <input name="typeimg" type="text" id="typeimg" style="width:300px" value=""><input type="button" name="Submit" value="浏览..." style="width:70px" onClick="SelectImage('form1.typeimg','');"> 远程<br />(栏目模板里用{dede:field.typeimg /}调用) </td> <td align="center"> <img src="<?php echo "images/pview.gif";?>" width="150" height="100" id="picview" name="picview"> </td> </tr> <!--增加栏目图-->
3.打开 \dede\templets\catalog_edit.htm 搜索
<tr> <td height="26" style="padding-left:10px;">列表命名规则:</td> <td> <input name="namerule2" type="text" id="namerule2" value="<?php echo $myrow['namerule2']?>" size="40" class="iptxt" /> <img src="images/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar3')"/></td> </tr>
在下方增加
<!--增加栏目图--> <tr> <td width="90" height="81" style="padding-left:10px;"><font color='red'>栏目图片2:</font></td> <td width="500"> <input name="typeimg" type="text" id="typeimg" style="width:300px" value="<?php echo $myrow['typeimg']?>"><input type="button" name="Submit" value="浏览..." style="width:70px" onClick="SelectImage('form1.typeimg','');"> 远程<br />(栏目模板里用{dede:field.typeimg /}调用) </td> <td align="center"> <img src="<?php if($myrow['typeimg']!="") echo $myrow['typeimg']; else echo "images/pview.gif";?>" width="150" height="100" id="picview" name="picview"> </td> </tr> <!--增加栏目图-->
4.打开 \dede\catalog_add.php 搜索
$queryTemplate = "INSERT INTO
在下面一行
`dede_arctype`(reid,topid,sortrank,typename,typedir,isdefault,defaultname,issend,channeltype,
改为
`dede_arctype`(reid,topid,sortrank,typename,typedir,typeimg,isdefault,defaultname,issend,channeltype,
红色是新增
继续搜索
VALUES('~reid~','~topid~','~rank~','~typename~','~typedir~','$isdefault','$defaultname','$issend','
改为
VALUES('~reid~','~topid~','~rank~','~typename~','~typedir~','~typeimg~','$isdefault','$defaultname','$issend','
5.打开 \dede\catalog_edit.php 搜索
typedir='$typedir',
只需修改42行的,下面那一行不需要修改
替换为
typedir='$typedir',
typeimg='$typeimg',
6.打开 \include\taglib\channelartlist.lib.php 搜索
typedir
改成
typedir,typeimg
7.打开 \include\taglib\channel.lib.php 搜索
typedir
改成
typedir,typeimg
注意:这个文件有4处都需要改
8.打开 \include\taglib\type.lib.php 搜索
typedir
改成
typedir,typeimg
9.\include\arc.listview.class.php 搜索
//设置环境变量
在它下面添加
$this->Fields['typeimg'] = $this->TypeLink->TypeInfos['typeimg'];
前台调用标签:
{dede:channelartlist}{dede:field.typeimg/}{/dede:channelartlist} {dede:channel}[field:typeimg/]{/dede:channel} {dede:type}[field:typeimg/]{/dede:type}
{dede:field.typeimg/}
完毕。
织梦CMS内容页有上一篇下一篇文章,没有上一个栏目下一个栏目,我们可以不用修改程序内核文件,直接在模板里用
效果如下: 1、搜索框代码里使用name=q作为搜索框属性,例如 2、打开 /include/taglib/arclist.lib.php 找到,大概在188行 $i
代码如下: {ceip:channelartlisttype=son}liahref={ceip:fieldname=typeurl/}{ceip:fieldname=typename/}/a{ceip:php}$id=$refObj-Fields[id];$sql=(SELECT
1、搜索框代码里的关键词input框那增加使用name=q作为搜索框属性, 2、打开 /include/taglib/arclist.lib.php 找到,大概在18
判断是否有子栏目,有就输出 javascript:; ,没有子栏目就直接输出一级栏目的链接 {dede:fieldname=typeidrunphp=yes}global$dsq