如我们一个栏目列表都用缩略图来表示,而不仅仅只是文字,如果没有这项功能会非常麻烦,网上有很多这方面的资料,但是都试过了有很多问题,自己研究一下,测试基本通过。新加字段 typeimg
1,后台执行SQL: alter table `cn_arctype` add `typeimg` char(100) NOT NULL default '';涉及到文件: dede/catalog_add.php
2,打开dede/catalog_add.phpdede/catalog_edit.php dede/templets/catalog_add.htm dede/templets/catalog_edit.htm 查找$queryTemplate = "insert into `cn_arctype` 将 (reid,topid,sortrank,typename,typedir, 替换为 (reid,topid,sortrank,typename,typedir,typeimg, 将 ('~reid~','~topid~','~rank~','~typename~','~typedir~', 替换为 ('~reid~','~topid~','~rank~','~typename~','~typedir~','~typeimg~', 3,打开dede/catalog_edit.php 查找 $upquery = "Update `cn_arctype` set 在其下面新加一行 <tr> <td height="26">列表命名规则:</td> <td> <input name="namerule2" type="text" id="namerule2" value="{typedir}/list_{tid}_{page}.html" class="pubinputs" style="width:250px" /> <img src="img/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar3')"/></td> </tr>
<td height="65" style="padding-left:10px;">栏目图片:</td> <td> <input name="typeimg" type="text" style="width:250px" id="typeimg" class="alltxt" value="" /> <input type="button" name="set9" value="浏览... "class="coolbg np" style="width:60px" onClick="SelectImage('form1.typeimg','');" /> </td> </tr>
<script language='javascript' src="js/main.js"></script> 在刚前面的位置加入: <tr> <td height="65" style="padding-left:10px;">栏目图片:</td> <td> <input name="typeimg" type="text" style="width:250px" id="typeimg" class="alltxt" value="<?php echo $myrow['typeimg']?>" /> <input type="button" name="set9" value="浏览... "class="coolbg np" style="width:60px" onClick="SelectImage('form1.typeimg','');" /> </td> </tr>
<script language='javascript' src="js/main.js"></script> 原来是这样的: {dede:channel type='top' row='13'} <li><a href='[field:typeurl/]' [field:rel/]>[field:typeimg/]</a></li> {/dede:channel} 在这里面加上[field:typeimg] 是调不出来的,我个人认为栏目缩略图就是通过循环出来的,而循环不出来则意义不大,所以改成了如下: {dede:sql sql="SELECT typename,typedir,typeimg FROM dede_arctype"} <li><a href="[field:typedir/]">[field:typeimg/]</a></li> {/dede:sql}
{dede:channelartlist typeid='13,14' row ='10'} <dt class="clearfix"><img src="{dede:field name='litpic'/}" alt="" width="80" /><span><a href='{dede:field name='typeurl'/}'>{dede:field name='typename'/}</a></span></dt> <dd> <ul class="clearfix"> {dede:channel type='son' noself='yes' } <li><a href='[field:typelink/]'>[field:typename/]</a></li> {/dede:channel} </ul> </dd> {/dede:channelartlist} |
|