帝国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="/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="/home/space.php?uid=<?=$bqr[uid]?>" target="_blank"> <img src="/ucenter/avatar.php?uid=<?=$bqr[uid]?>&size=small&type=real" width="48px" height="48px" > </a> </div> <div> <a href="/home/space.php?uid=<?=$bqr[uid]?>" target="_blank"> <?=$bqr[username]?> </a> </div> [/e:loop]
8.帝国CMS内容页调用数据库filename字段
内容模板用
<?=$navinfor[filename]?>
灵动标签
<?=$bqr[filename]?>
列表用代码
$fr=$r[filename]; $listtemp='<li>'.$fr.'</li>';
本文链接:https://niujc.com/com/1326339.html
晚上好!当前时间为
目前距离2023年春节还有
TOP