DedeCms 栏目增加缩略图成果的要领(2)

  查找

<tr>
<td height="26" style="padding-left:10px;">列表定名法则:</td>
<td> <input name="namerule2" type="text" id="namerule2" value=http://down.chinaz.com/"<?php echo $myrow['namerule2']?>" size="40" class="iptxt" />
<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" height="81" style="padding-left:10px;">栏目图片:</td></td>
<td width="500">
<input name="typeimg" type="text" id="typeimg" style="width:300px" value=http://down.chinaz.com/"<?php echo $myrow['typeimg']?>"><input type="button" name="Submit" value="欣赏..." style="width:70px" onClick="SelectImage('form1.typeimg','');">
<input type="button" name="Submit2" value="裁剪" style="margin-left:8px;" onClick="imageCut('typeimg');"/>
<input type='checkbox' value='1'>
长途<br />(栏目模板里用{dede:field.typeimg /}挪用)
</td>
<td align="center">
<img src=http://down.chinaz.com/"<?php if($myrow['typeimg']!="") echo $myrow['typeimg']; else echo "images/pview.gif";?>" width="150" height="100" id="picview" name="picview">
</td>
</tr>
<!--增加栏目缩略图-->

  生存catalog_edit.htm

  至此已经修改完成!

  栏目图片的添加或修改图片时在 (栏目打点>高级选项)内里就会自动呈现栏目图片添加的选择,点击选择图片,弹出窗口内选择欣赏上传就OK

  留意:前台栏方针签挪用的时候,还需要改一个文件,才气实现栏目图片显示,不然只能通过sql语句才气显示图片。

  打开:include/taglib/channel.lib.php

  找到

if($type=='top')
{
$sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From `dede_arctype` where reid=0 And ishidden<>1 order by sortrank asc limit 0,$row";
}
else if($type=="son")
{
//if($_sys_globals['typeid']>0) $typeid = $_sys_globals['typeid'];
if($typeid==0) {
return '';
}
$sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From `dede_arctype` where reid='$typeid' And ishidden<>1 order by sortrank asc limit 0,$row";
}
else if($type=="self")
{
if($reid==0) {
return '';
}
$sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From `dede_arctype` where reid='$reid' And ishidden<>1 order by sortrank asc limit 0,$row";
}

  替换成下面的:

if($type=='top')
{
$sql = "Select id,typename,typeimg,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From `dede_arctype` where reid=0 And ishidden<>1 order by sortrank asc limit 0,$row";
}
else if($type=="son")
{
//if($_sys_globals['typeid']>0) $typeid = $_sys_globals['typeid'];
if($typeid==0) {
return '';
}
$sql = "Select id,typename,typeimg,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From `dede_arctype` where reid='$typeid' And ishidden<>1 order by sortrank asc limit 0,$row";
}
else if($type=="self")
{
if($reid==0) {
return '';
}
$sql = "Select id,typename,typeimg,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description
From `dede_arctype` where reid='$reid' And ishidden<>1 order by sortrank asc limit 0,$row";
}

  挪用要领:

<img src=http://down.chinaz.com/”[field:typeimg /]” />

  最近有许多网友问到修改的要领,此刻我把已经修改好的靠山文件分享出来,下载下来直接包围到靠山就可以了。

  假如想同时在文章内容页挪用栏目图片打开,修改\include\arc.archives.class.php

  查找

if($this->ChannelUnit->ChannelInfos['issystem']!=-1)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/10028.html