文字链接
[e:loop={'select * from [!db.pre!]enewslink where checked=1 and classid=分类ID order by lid',20,24,0}]
<li><a href="<?=$bqr[lurl]?>"><?=$bqr[lname]?></a></li>
[/e:loop]
图片链接
[e:loop={'select * from [!db.pre!]enewslink where checked=1 and classid=分类ID order by lid',20,24,0}]
<li><a href="<?=$bqr[lurl]?>"><img src="<?=$bqr[lpic]?>" border="0"/></a></li>
[/e:loop]
[e:loop={'select * from [!db.pre!]enewslink where checked=1 and classid=分类ID order by myorder ',20,24,0}]
<a href="<?=$bqr[lurl]?>"><?=$bqr[lname]?></a>
[/e:loop]
其中,classid=1 为友情链接分类ID,checkde=1 为审核过的链接。
如果希望不需要指定分类,则去掉 and classid=1 即可。
下拉菜单式的“友情链接”
代码如下:
<label for="FRIEND LINK ">友情链接:</label>
<select onchange="window.open(this.options[selectedIndex].value,'','');" name="FRIEND LINK" size="1" id="FRIEND LINK">
[e:loop={'select * from [!db.pre!]enewslink where checked=1 order by lid',20,24,0}]
<option value="<?=$bqr[lurl]?>">
<?=$bqr[lname]?>
</option>
[/e:loop]
</select>