DEDE函数


 Html2text() 函数是去掉html标签代码。

cn_substr(str,80) 函数是截取字符串长度。

当然,他们也可以合并起来使用:
[field:body function
="cn_substr(Html2text(@me),80)"/] 更多函数总结: 基本语法: 函数一: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:field.content function
="Html2Text(cn_substr('@me',110))" /}
功能:获取栏目信息摘要信息(提取110个字符[55个汉字]),删除hml标签元素,转为纯文本
!

 

转载于:https://www.cnblogs.com/xinlinux/p/4086889.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值