帝国CMS文章随机调用等一些常用标签

1.帝国CMS文章随机调用等一些常用标签

[e:loop={'news',10,18,0,'newstime>UNIX_TIMESTAMP()-86400*7','onclick desc'}]
<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><br>
[/e:loop]

2.多少天内的信息显示new字样

<table>
[e:loop={栏目ID,显示条数,操作类型,只显示有标题图片}]
<?
$newimg="";
if(time()-$bqr[truetime]<=3*24*3600)
{
$newimg="<img src='New图片地址'>";
}
?>
<tr><td>
<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=esub($bqr[title],36)?></a><?=$newimg?>
</td></tr>
[/e:loop]
</table>

3.按表随机调用

 [ecmsinfo]"select * from phome_ecms_news order by rand() desc limit 6 ",6,18,0,24,2,0[/ecmsinfo]

4.随机调用本栏目

[ecmsinfo]"select * from phome_ecms_news where classid='$GLOBALS[navclassid]' order by rand() desc limit 6",6,18,0,24,2,0[/ecmsinfo]

5.调用标题包含“cms”的新闻

[e:loop={'news',10,18,0,"title like '%cms%'",''}]
<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><br>
[/e:loop]

6.调用论坛最新10个帖子

<DIV>
<UL>
[e:loop={"select tid,subject from cdb_threads order by tid desc limit 10",10,24,0}]
<li><a href="http://www.nuopu.net/bbs/viewthread.php?tid=<?=$bqr[tid]?>" target="_blank"><?=sub($bqr[subject],0,40,false)?></a></li>
[/e:loop]
</UL>
</DIV>

7.调用uchome会员头像

[e:loop={"select uid,username from uchome_space order by credit desc limit 9",9,24,0}]
<div>
<a href="http://www.jqap.com/home/space.php?uid=<?=$bqr[uid]?>" target="_blank">
<img src="http://www.xxx.com/ucenter/avatar.php?uid=<?=$bqr[uid]?>&size=small&type=real" width="48px" height="48px" >
</a>
</div>
<div>
<a href="http://www.jqap.com/home/space.php?uid=<?=$bqr[uid]?>" target="_blank">
<?=$bqr[username]?>
</a>
</div>
[/e:loop]
上一篇:java同步和互斥【用具体程序说明】


下一篇:ASP.NET Core MVC I/O编程模型