基本语法: 函数一: function=cn_substr(@me,200)(功能:获取指定数值的字符串) 函数二: function=html2text(@me)(功能:去掉html样式,转换为纯文本字符) 函数三: function=GetDateTimeMk(@me)(功能:根据秒数返回时
基本语法:
函数一:
function=cn_substr(@me,200)(功能:获取指定数值的字符串)
函数二:
function=html2text(@me)(功能:去掉html样式,转换为纯文本字符)
函数三:
function=GetDateTimeMk(‘@me’)(功能:根据秒数返回时间)
函数四:
function=“GetDateMK(@me) (功能:根据秒数返回日期)
函数五:
function=‘strftime(“%m-%d”,@me)’(功能:根据秒数返回格式化的日期或者时间,php自带的函数)
首页:
08 [field:pubdate function=strftime('%d',@me)/]
08 日 [field:pubdate function=strftime('%d日',@me)/]
06-08 [field:pubdate function=strftime('%m-%d',@me)/]
06月08日 [field:pubdate function=strftime('%m月%d日',@me)/]
09-06-08 [field:pubdate function=strftime('%y-%m-%d',@me)/]
2009-06-08 [field:pubdate function=strftime('%Y-%m-%d',@me)/]
09年06月08日 [field:pubdate function=strftime('%y年%m月%d日',@me)/]
2009年06月08日 [field:pubdate function=strftime('%Y年%m月%d日',@me)/]
2009-06-08 13:28 [field:pubdate function=strftime('%Y-%m-%d %H:%M',@me)/]
列表页:
[field:pubdate function="GetDateTimeMK(@me)"/]==2008-1-1 18:30:02
[field:pubdate function="GetDateMK(@me)"/]==2008-05-15
函数六:
function=‘str_replace(“lit_”,“”,@me) (功能:替换字符串)
函数七:
function=MyDate(‘m-d’,@me) (功能:返回格林威治标准时间)
组合函数:
function="html2text(cn_substr('@me',200))"(功能:提取指定个数的字符串并去掉html样式,转换为纯文本字符)
{dede:sql sql="select * from wmd_arctype where topid=3"}
<a class="server_case_li" href="[field:typedir function=str_replace('{cmspath}','',@me) /]">
<div><span>[field:typename /]</span></div>
[field:id runphp='yes']
global $dsql;
$id=@me;
$sql="select * from wmd_archives where typeid=".$id." order by pubdate desc limit 0,1";
$dsql->SetQuery($sql);
$dsql->Execute();
$rows=$dsql->GetOne();
@me=$rows['litpic'];
@me="<img src='@me'>";
[/field:id]
</a>
{/dede:sql}
举例:
{dede:field.content function="Html2Text(cn_substr('@me',110))" /}
版权声明:本站部分内容来源互联网,如果文章中所涉及的图片或者文字内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!
织梦狗模板
织梦dedecms常用函数整理汇总
最新VIP资源
猜你喜欢
- 织梦dedecms会员中心自定义图片字段上传后无法选中问题 2021-08-11
- 织梦dedecms后台假死卡死无法操作怎么办 2023-09-20
- 织梦修改完数据后怎么搬家到空间服务器 2023-09-25
- 织梦DEDECMS首页调用自定义表单数据 2021-08-09
- 织梦dede:flink标签支持limit属性的方法 2023-08-06
- 织梦dedecms怎样用标签调用随机数? 2021-06-15
- dedecms不同栏目调用不同banner图的方法 2023-07-28
- 解决dedecms(5.6/5.7)缩略图缩放变形问题方法 2023-09-23
- dedecms模板中使用php和if判断语句的技巧 2023-09-21
- 织梦dedecms怎么添加调用自定义字段 2023-09-21