调用文章
随机调用order by - 范围调用where
[e:loop={2,3,0,0,'id<10&&id>5','rand() DESC'}] <a href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a> [/e:loop]
调用文章数据
[e:loop={"select title from [!db.pre!]ecms_city where classid='$navinfor[classid]' order by rand() DESC limit 2",0,24,0}] <a href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?>SEO优化</a> [/e:loop]
多数据表联合查询
[e:loop={"select a.*,b.ztid from {$dbtbpre}ecms_news a join {$dbtbpre}enewsztinfo b on a.id = b.id where b.ztid =1 order by newstime desc limit 1,7",0,24,0}] <a href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a> [/e:loop]
全国城市数据调用|文章调用|字段调用
[e:loop={'inner',1,18,0,"id=($navinfor[id]%3000+1)"}] <?=$bqr['newstext']?> [/e:loop]
调用栏目
[e:loop={"select classid,classname,classpath from [!db.pre!]enewsclass where bclassid = $_class[bclassid]",0,24,0}] <?php $_listyle = ($bqr[classid]==$GLOBALS[navclassid]) ? ' class="active"' : '';?> <li<?=$_listyle?>><a href="/<?=$bqr['classpath']?>/"><?=$bqr['classname']?></a></li> [/e:loop] [e:loop={"select classid,classname from [!db.pre!]enewsclass where islast='1' and tbname='muban' order by rand() DESC limit 5",0,24,0}] <li><a href="/list-<?=$bqr[classid]?>.html"><?=$bqr['classname']?></a></li> [/e:loop]
调用广告
广告数据表做轮播图
[e:loop={"select picurl,url,classid,title from [!db.pre!]enewsad where classid=1 order by adid desc limit 2",0,24,0}] <li> <a href="<?=$bqr['url']?>" rel="nofollow" target="_blank"> <img src="<?=$bqr['picurl']?>" alt="<?=$bqr['title']?>" /> </a> </li> [/e:loop]
其他调用
调用任意数据库数据
[e:loop={"select tid,subject,dateline from discuzdb.pre_forum_thread order by tid desc limit 10",10,24,0}] <a href="/bbs/forum.php?mod=viewthread&tid=<?=$bqr[tid]?>"><?=$bqr[subject]?></a> (<?=date('Y-m-d',$bqr[dateline])?>) [/e:loop]