大家好,对帝国cms灵动标签应用大汇总感兴趣的小伙伴,下面一起跟随三零脚本的小编来看看帝国cms灵动标签应用大汇总的例子吧。
一、灵动标签应用之“调用友情链接”。
众所周知帝国的友情链接调用标签生成出来的代码是Table的,不符合标准,所以我们用灵动标签调用友情链接。
代码:
<ul class="links_text">
[e:loop={'select * from [!db.pre!]enewslink where checked=1 and lpic="" order by lid',20,24,0}]
<li><a href="<?=$bqr[lurl]?>"><?=$bqr[lname]?></a></li>
[/e:loop]
</ul>
<ul>
<li><a href="/" title="首页" target="_self">首 页</a></li>
[e:loop={'select classid,classname,classpath from [!db.pre!]enewsclass order by classid',0,24,0}]
<li class="" id="cid<?=$bqr[classid]?>"><a href="<?=$public_r[newsurl]?><?=$bqr[classpath]?>" title="<?=$bqr[classname]?>" target="_self" ><?=$bqr[classname]?></a></li>
[/e:loop]
<li class="posr"><a href="/top" title="排行榜" target="_self">排行榜</a></li>
</ul>
<script>
var changeclass=window.document.getElementById('cid[!--self.classid--]');
changeclass.className='active';
</script>
<ul>
[e:loop={栏目ID,显示条数,操作类型,只显示有标题图片}]
<?
$newimg="";
if(date("m-d",$bqr[truetime])==date("m-d"))
{
$newimg="<img src='New图片地址'>";
}
?>
<li>
<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=sub($bqr[title],0,10,false)?></a><?=$newimg?>
</li>
[/e:loop]
</ul>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
[e:loop={"select tid,subject from cdb_threads order by tid desc limit 10",10,24,0}]
<tr><td>
<a href="/bbs/viewthread.php?tid=<?=$bqr[tid]?>" target="_blank"><?=$bqr[subject]?></a>
</td></tr>
[/e:loop]
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="3">
[e:loop={"select tid,subject from pw_threads order by tid desc limit 10",10,24,0}]
<tr><td>
<a href="/bbs/read.php?tid=<?=$bqr[tid]?>" target="_blank"><?=$bqr[subject]?></a>
</td></tr>
[/e:loop]
</table>
<ul>
[e:loop={'select userid as userid,truename as title,userpic as titlepic from [!db.pre!]enewsmemberadd order by userid desc limit 8',10,24,0}]
<li><a href="/e/space/?userid=<?=$bqr[userid]?>" target="_blank"><img src="<?=$bqr[titlepic]?>" alt="<?=$bqr[title]?>" width="52" height="52" /><?=$bqr[title]?></a></li>
[/e:loop]
</ul>
用户ID:<?=$bqr[userid]?>
用户头像:<?=$bqr[titlepic]?>
用户名称:<?=$bqr[title]?>
[e:loop={'select * from [!db.pre!]ecms_news where checked=1 order by diggtop desc,id desc limit 8',10,24,0}]
<li><a href="<?=$bqsr[titleurl]?>"><?=sub($bqr[title],0,30,false)?>]</a><span><small>点击:</small><?=$bqr[onclick]?></span> <span><small>顶:</small><?=$bqr[diggtop]?></span></li>
[/e:loop]
[e:loop={'select * from [!db.pre!]ecms_news where checked=1 order by plnum desc,id desc limit 8',10,24,0}]
<li> <small><a href="<?=$bqsr[titleurl]?>" class="title"><?=sub($bqr[title],0,30,false)?></a></small>
<p><?=$bqr[smalltext]?></p>
</li>
[/e:loop]
[e:loop={'select classid,classname,classpath,wburl from [!db.pre!]enewsclass where bclassid=0 and showclass=0 order by myorder',0,24,0}]
<li><a href="<?php
if(empty($bqr[wburl]))
{
echo $public_r[newsurl].$bqr[classpath];
} else {
echo $bqr[wburl];
}
?>" title="<?=$bqr[classname]?>" target="_self"><?=$bqr[classname]?></a></li>
[/e:loop]