ad


CSS中文手册加入收藏设为首页共享模板提交创意简繁转换

您现在的位置: :首页 > CMS教程 > 帝国 > >> 正文

帝国CMS程序扩展变量说明

『 更新时间:2008-02-29 02:23:49 』『 字体: 』『 编辑: |  来源: 』

1、列表模板变量说明:
当前栏目id:$navclassid$GLOBALS['navclassid']

通过这个变量可以输出这个栏目id的所有数据(如:select * from phome_enewsclass where classid=$GLOBALS['navclassid'])

2、内容模板变量说明:

字段值数组:$navinfor

调用方法:$navinfor['字段名'],比如要显示"信息ID字段",那在模板里用:<?=$navinfor['id']?>即可输出(要开启模板支持程序代码)

通过此变量用户可以处理比较复杂的数据,比如处理音乐地址:
我们假设,音乐地址字段的存放格式为:

歌曲名称1,文件地址1
歌曲名称2,文件地址2
歌曲名称3,文件地址3
......

我们可以自定义一个标签用于输出连播格式

//--------输出音乐连播标签
function user_EchoMusic($ecms)
{global $empire,$public_r,$class_r,$navinfor;
$rr=explode("rn",$navinfor['musicpath']);
$count=count($rr);
if(empty($count))
{
return "";
}
?>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<form name="form1" method="get" onsubmit="javascript:return list();" action="<?=$public_r[newsurl]?>e/MusicSys/play/index.php" target=list>
<input type=hidden name=classid value="<?=$navinfor[classid]?>">
<input type=hidden name=id value="<?=$navinfor[id]?>">
<input type=hidden name=title value="<?=$navinfor[title]?>">
<tr bgcolor="990000">
<td colspan="2"> <div align="center"><font color="ffffff">歌曲名</font></div></td>
<td width="27%"> <div align="center"><font color="ffffff">试听</font></div></td>
</tr>
<?
for($i=0;$i<$count;$i++)
{
$fr=explode(",",$rr[$i]);
$musicname=$fr[0];
$purl=$public_r[newsurl]."e/MusicSys/play?classid=$navinfor[classid]&id=$navinfor[id]&mid[]=$i&title=$navinfor[title]";
$playurl="[<a href='#ecms' onclick="window.open('".$purl."','list','width=400,height=370');">播放</a>]";
?>
<tr>
<td width="4%"><div align="center">
<input name="mid[]" type="checkbox" value="<?=$i?>">
</div></td>
<td><div align="left"><a href="#ecms" onclick="window.open('<?=$purl?>','list','width=400,height=370');"><?=$musicname?></a></div></td>
<td width="27%"><div align="center"><?=$playurl?></div></td>
</tr>
<?
}
?>
<tr bgcolor="990000">
<td colspan="6"><div align="center">
<input type="button" name="Submit" value="全选" onclick=CheckAll(this.form)>
<input type="button" name="Submit2" value="反选" onclick=CheckOthers(this.form)>
<input type="submit" name="Submit3" value="播放">
</div></td>
</tr>
</form>
</table>
<?
}

然后再内容模板调用这个标签就可以显示相应的格式,上面音乐标签输出结果可以看:
http://www.phome.net/ecms37/music/gangtai/11454161071.html

还有如图片系统模型的地址也可以输出为js分页格式,从而实现漫画的个性浏览等等
动漫效果可以看:http://bbs.phome.net/ShowThread/?threadid=10293&forumid=31

通过这些变量可实现各种更复杂的系统.需要您不断的去开拓与应用.

共有 位网友发表了评论 收藏该内容报告错误点击复制信息给好友分享查看所有网友评论关闭此页面
  • 您暂未登陆,请登陆后发表! 或直接填写昵称匿名发表
  • 1.请勿发表广告及不良言论.
  • 2.本文内容及版权归原作者.
  • 匿名?
关于我们 | 投稿指南 | 广告服务 | 建站服务 | 联系我们 | 网站地图 | 友情连接 | 诚征英才
欢迎您光临模板CMS,竭尽全力为您打造最专业的CMS资源站点!联系我26211803 联系我667559
建站交流群:1700154 模板交流群:37797574 49415971 10086677 交流论坛
Copyright © 2005-2007 www.mobancms.com online services. All rights reserved. Template designed by lacdy.
模板CMS版权所有 豫ICP备06002344号