帝国cms常用标签调用方法(灵动标签和万能标签的调用方法)


当前第2页 返回上一页

css:

.input_text { background: #FFF url(../images/sub_text.gif) no-repeat left; padding-left: 30px; color: #DFDFDF; height: 22px; border: 0; float: left; border: #d6d6d6 1px solid }

.input_submit { background: url(../images/search.jpg) no-repeat; width: 50px; border: none; cursor: pointer; height: 22px; margin-left: 10px }

涉及图片: 

<form action="[!--news.url--]e/search/index.php" method="post" name="searchform" id="searchform">

        <input name="keyboard" type="text" class="input_text"  id="keyboard" value="请输入关键词" onfocus="if(this.value=='请输入关键词'){this.value=''}; this.style.color='black';" onblur="if(this.value==''||this.value=='请输入关键词'){this.value='请输入关键词'; this.style.color='#DFDFDF';}"/><input type="hidden" name="show" value="title" /><input type="hidden" name="tempid" value="1" /><input name="tbname" type="hidden" value="news">

        <input type="submit" name="Submit" value="" class="input_submit" />

</form>

栏目图片调用(标签模板)

1、万能标签调用方法:

页面模板内容:[!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.listtemp--]

列表内容模板:<li><a href="[!--classurl--]" title="[!--classname--]"><img src="[!--classimg--]" /></a></li>

首页调用:[showclasstemp]67,21,0,0[/showclasstemp] 67是id 21是模板

2、灵动标签调用方法(前12条记录):

[e:loop={"select classid,classname,classimg from {$dbtbpre}enewsclass where bclassid=0 order by myorder,classid desc limit 12",0,24,0}]

<?php

$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址

?>

<li><a href="<?=$classurl?>" target="_blank"><img src="<?=$bqr[classimg]?>"></a><?=$bqr[classname]?></li>

[/e:loop]

友情链接

1、带模版的下拉友情链接列表

页面模板内容:

<select onchange="window.open(this.options[selectedIndex].value,'','');" class="selink"  name='friendsite'>

 [!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.listtemp--]

</select>

列表内容模板:<option value='[!--titleurl--]'>[!--title--]</option>

对应页面调用:[ecmsinfo]'select lname as title,lurl as titleurl,lid as id from [!db.pre!]enewslink where classid=1 order by lid limit 50',0,50,0,24,14,0[/ecmsinfo](14是模板标签 第一个50是数量)

2、友情链接图片:

[e:loop={'select lname,lurl,lpic from [!db.pre!]enewslink where checked=1 and classid=5 order by myorder,lid',3,24,0}]

<li><a href="<?=$bqr[lurl]?>" target="_blank" ><img src="<?=$bqr[lpic]?>"></a></li>

 [/e:loop]

留言板时间格式修改

<?=format_datetime($r[lytime],'Y-m-d H:i')?>

<?=format_datetime($r[lytime],'Y-m-d')?>

用if判断内容模板字段为空时

1、举例:如果来源为空,则显示“”

<?

if($navinfor['befrom']=="") {

echo '';

}

else{

echo ''.$navinfor[befrom].'';

}

?> 

2、如果作者为空,则不输出任何内容,那么添加样式以及作者

<?

if($navinfor['writer']=="") {

echo '';

}

else{

echo '<span>作者:'.$navinfor[writer].'</span>';

}

?> 

好了这篇文章就介绍到这了,基本上常用的都有了 


标签:帝国CMS

返回前面的内容

相关阅读 >>

acrobat怎么批量保存pdf小图片 pdf文件导出所有图像的技巧

帝国CMS后台fckeditor编辑器兼容ie10的方法汇总

asp 精华源码收集(五年总结)

帝国CMS内容页根据关键字调用相关内容的方法

帝国CMS页面浏览量或点击率统计调用代码

在php代码中调用帝国CMS头部变量temp.header的方法

gta5 pc版破解补丁失效怎么回事 补丁失效解决方法介绍

c++实现图书管理系统课程设计

帝国CMS后台生成更新后,前台页面显示空白的原因分析

帝国CMS更改消息提醒的方法

更多相关阅读请进入《帝国CMS》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...