调用子栏目的方法
[caption id="attachment_355" align="aligncenter" width="319"]
调用子栏目[/caption]
代码如下:
<?php
$bclassid=$GLOBALS[navclassid]
?>
[e:loop={"select classid, classname, classpath from `[!db.pre!]enewsclass` where bclassid='$bclassid' order by `classid` asc ",8,24,0,0,0}]
<li><a href="<?=$bqsr[classurl]?>" class="sub_current"><?=$class_r[$bqr[classid]]['classname']?></a></li>
[/e:loop]
调用子栏目文章的方法
[caption id="attachment_356" align="aligncenter" width="312"]
调用子栏目文章[/caption]
代码如下:
<?php
$bclassid=$GLOBALS[navclassid];
?>
[e:loop={"select classid, classname, classpath from `[!db.pre!]enewsclass` where bclassid='$bclassid' order by `classid` asc ",7,24,0}]
<?php
$commbook=$empire->fetch1("select title,titlepic,smalltext,titleurl,keyboard,groupid,classid,newspath,filename,id from
3g_ecms_news where classid = ".$bqr[classid]." and titlepic!='' order by newstime desc limit 1");
$commbookurl=sys_ReturnBqTitleLink($commbook);
?>
<li>[<a href="<?=$public_r[newsurl].$bqr[classpath]?>"><?=$bqr[classname]?></a>]
<?php
$newbook=$empire->query("select title,titlepic,smalltext,titleurl,keyboard,newstime,groupid,classid,newspath,filename,id from
3g_ecms_news where classid =".$bqr[classid]." order by newstime desc limit 1");
while($r=$empire->fetch($newbook)) {
?>
<a href="<?=sys_ReturnBqTitleLink($r)?>" title="<?=$r[title]?>"><?=$r[title]?></a></li>
<?php
}
?>
[/e:loop]
这里的3g,要更换成自己的数据库前置代码
代码学习来自这里,
http://bbs.phome.net/showthread-13-147813-0.html
下面这个是调用所有栏目
[e:loop={'selfinfo',10,3,0,'','newstime DESC'}]
<li><a href="<?=$bqsr[classurl]?>" class="sub_current">【<?=$class_r[$bqr[classid]]['classname']?>】</a><a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a></li>
[/e:loop]