1.先给数据库中的dede_arctype表增加一个字段

  • 后台 - 系统 - 系统设置 - SQL命令行工具
    ALTER TABLE `dede_arctype` ADD `typebigpic` CHAR( 255 ) NOT NULL DEFAULT '';

2.打开 dedetempletscatalog_add.htm 搜索

name="typename"
  • 在它的</tr>下面加入
<script language='javascript' src="js/main.js"></script>
<tr id="pictable">
<td height="24" colspan="6">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="158"> &nbsp;图片地址:</td>
<td width="560">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td height="30">
<input name="typebigpic" type="text" id="picname" style="width:220px" value="" />
<input type="button" name="Submit2" value="站内选择" style="margin-left:8px;" onClick="SelectImage('form1.picname','');" class='np coolbg'/>
</td>
</tr>
</table>
</td>
<td width="270">
<style>
.divpre,.divpre img{height:50px;}
</style>
<img src="images/pview.gif" width="100" height="50" id="picview" name="picview">
</td>
</tr>
</table>
</td>
</tr>

3.打开 dedetempletscatalog_edit.htm 搜索

name="typename"
  • 在它的</tr>下面加入
<script language='javascript' src="js/main.js"></script>
<tr id="pictable">
<td height="24" colspan="6">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="158"> &nbsp;图片地址:</td>
<td width="560">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td height="30">
<input name="typebigpic" type="text" id="picname" style="width:220px" value="<?php echo $myrow['typebigpic']?>" />
<input type="button" name="Submit2" value="站内选择" style="margin-left:8px;" onClick="SelectImage('form1.picname','');" class='np coolbg'/>
</td>
</tr>
</table>
</td>
<td width="270">
<style>
.divpre,.divpre img{height:50px;}
</style>
<img src="<?php if($myrow['typebigpic']!="") echo $myrow['typebigpic']; else echo "images/pview.gif";?>" width="100" height="50" id="picview" name="picview">
</td>
</tr>
</table>
</td>
</tr>

4.打开 dedecatalog_add.php 搜索

$in_query = "INSERT INTO `dede_arctype`(reid,topid,sortrank,typename
  • 改成
$in_query = "INSERT INTO `dede_arctype`(reid,topid,sortrank,typename,typebigpic
  • 继续搜索
VALUES('$reid','$topid','$sortrank','$typename'
  • 改成
VALUES('$reid','$topid','$sortrank','$typename','$typebigpic'

5.打开 dedecatalog_edit.php 搜索

`smalltypes`='$smalltypes'
  • 改成
`smalltypes`='$smalltypes',`typebigpic`='$typebigpic'

6.打开 includetaglibchannelartlist.lib.php 搜索

typedir
  • 改成
typedir,typebigpic

7.打开 includetaglibchannel.lib.php 搜索

typedir
  • 改成
typedir,typebigpic
  • 注意:这个文件有4处都需要改
    8.打开 includetaglibtype.lib.php 搜索

typedir
  • 改成
typedir,typebigpic

9.includearc.listview.class.php 搜索

//设置环境变量
  • 在它下面添加
$this->Fields['typebigpic'] = $this->TypeLink->TypeInfos['typebigpic'];

后台栏目效果

1.png

前台模板中调用标签

{dede:channelartlist}{dede:field.typebigpic/}{/dede:channelartlist}

{dede:channel}[field:typebigpic/]{/dede:channel}

{dede:type}[field:typebigpic/]{/dede:type}

栏目列表页单独调用

{dede:field.typebigpic/}
Last modification:June 11th, 2020 at 10:46 am
如果觉得我的文章对你有用,请随意赞赏