标签SQL调用方法如下:
[e:loop={'select lname,lurl,lpic from [!db.pre!]enewslink where checked=1 order by myorder,lid',20,24,0}]
<a href="<?=$bqr['lurl']?>" target="_blank"><?=$bqr['lname']?></a>
[/e:loop]
其中,classid=0 为友情链接分类ID,checkde=1 为审核过的链接。 如果希望不需要指定分类,则去掉 and classid=0 即可。
下面以灵动标签为例:
1、lname为站点名称字段;
2、lurl为站点地址字段;
3、lpic为站点图标地址字段。
(按某一分类调用SQL为:select lname,lurl,lpic from [!db.pre!]enewslink where checked=1 and classid=分类ID order by myorder,lid)
常规示例
[e:loop={'select * from [!db.pre!]enewslink where checked=1 and classid=1 order by myorder',20,24,0}]
<li><a href="<?=$bqr[lurl]?>" target="_blank"><?=$bqr[lname]?></a></li>
[/e:loop]
图片友情链接
[e:loop={'select lname,lurl,lpic from [!db.pre!]enewslink where checked=1 and classid=5 order by myorder,lid',3,24,0}]
<li><a href="<?=$bqr[lurl]?>" target="_blank" ><img src="<?=$bqr[lpic]?>"></a></li>
[/e:loop]
联合查询
[e:loop={'select b.*,a.* from [!db.pre!]enewslinkclass as a,[!db.pre!]enewslink as b where a.classid=b.classid order by myorder',20,24,0}]
<div class="whitebg">
<h2 class="htitle"><?=$bqr[classname]?></h2>
<ul class="site_tj site_yx">
<li><a href="<?=$bqr[lurl]?>" target="_blank"><?=$bqr[lname]?></a></li>
</ul>
</div>
[/e:loop]
本文摘自网络,不代表短经典网立场 https://www.duanjingdian.com/682.html