如何在DEDECMS首页调用分类信息
这是子栏目调用:
{dede:channel type='son'}
<li><a href="[field:typeurl/]">[field:typename]</a></li>
{/dede:channel}
修改文件/include/arcarchivesclass
将以下代码
$next = (is_array($nextR) " where arcid={$nextR['id']} " : ' where 1>2 ');$pre = (is_array($preR) " where arcid={$preR['id']} " : ' where 1>2 ');
$query = "Select arcid,arctitle,arcshorttitle,arctypeid,arcismake,arcsenddate,arcarcrank,arcmoney,arcfilename,arclitpic,
ttypedir,ttypename,tnamerule,tnamerule2,tispart,tmoresite,tsiteurl,tsitepath
from `#@__archives` arc left join #@__arctype t on arctypeid=tid ";
改为如下
if($this->ChannelUnit->ChannelInfos[‘issystem‘]!=-1){$next = (is_array($nextR) " where arcid={$nextR[‘id‘]} " : ‘ where 1>2 ‘);
$pre = (is_array($preR) " where arcid={$preR[‘id‘]} " : ‘ where 1>2 ‘);
$query = "Select arcid,arctitle,arcshorttitle,arctypeid,arcismake,arcsenddate,arcarcrank,arcmoney,arcfilename,arclitpic,
ttypedir,ttypename,tnamerule,tnamerule2,tispart,tmoresite,tsiteurl,tsitepath
from `#@__archives` arc left join #@__arctype t on arctypeid=tid ";
}else{
$next = (is_array($nextR) " where arcaid={$nextR[‘id‘]} " : ‘ where 1>2 ‘);
$pre = (is_array($preR) " where arcaid={$preR[‘id‘]} " : ‘ where 1>2 ‘);
$query = "Select arcaid,arctitle,arctypeid,arcsenddate,arcarcrank,arclitpic,
ttypedir,ttypename,tnamerule,tnamerule2,tispart,tmoresite,tsiteurl,tsitepath
from `"$this->ChannelUnit->ChannelInfos[‘addtable‘]"` arc left join #@__arctype t on arctypeid=tid ";
}
{dede:infolink}
地 区:[field:linkallplace/] [field:nativeplace /]
类 型:[field:linkalltype/] [field:infotype /]
{/dede:infolink}和分类页调用一样
0条评论