帝国CMS6.0版新增了针对会员空间信息调用的“灵动标签函数”,使会员空间模板增加信息调用更简单,不用写sql查询执行代码。
空间的“灵动标签函数”语法基本同灵动标签,大家回顾下灵动标签语法:
点击这里查看:http://www.phome.net/doc/ecmsedu/base/mbzz/html/sysbq.html#eloop
空间的“灵动标签函数”具体语法为如下:
<?php $spacesql=espace_eloop(栏目ID,显示条数,操作类型,只显示有标题图片); while($spacer=$empire->fetch($spacesql)) { $spacesr=espace_eloop_sp($spacer); ?> 模板代码内容 <? } ?> |
<table width="380" border="0" cellpadding="3" cellspacing="1" bgcolor="#96C8F1" align="center"> <tr> <td background="template/default/images/bg_title_sider.gif"><b>最新新闻</b></td> </tr> <tr> <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php $spacesql=espace_eloop(2,5,0,0); while($spacer=$empire->fetch($spacesql)) { $spacesr=espace_eloop_sp($spacer); ?> <tr> <td height="25"> <img src="template/default/images/li.gif" width="15" height="10"><a href="<?=$spacesr[titleurl]?>" target="_blank"><?=$spacer[title]?></a> (<?=date('Y-m-d',$spacer[newstime])?>) </td> </tr> <? } ?> </table> </td> </tr> </table> |
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#96C8F1" align="center"> <tr> <td background="template/default/images/bg_title_sider.gif"><b>图片新闻</b></td> </tr> <tr> <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <?php $spacesql=espace_eloop(2,4,0,1); while($spacer=$empire->fetch($spacesql)) { $spacesr=espace_eloop_sp($spacer); ?> <td height="25" align="center"> <a href="<?=$spacesr[titleurl]?>" target="_blank"><img src="<?=$spacer[titlepic]?>" width="108" height="72" border="0"></a> <br> <a href="<?=$spacesr[titleurl]?>" target="_blank"><?=esub($spacer[title],20)?></a> </td> <? } ?> </tr> </table> </td> </tr> </table> |
版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!
转载请注明: 帝国CMS 6.0功能解密之会员空间信息标签调用