zoukankan      html  css  js  c++  java
  • 织梦在runphp里使用其他函数计算

    dedecms织梦在runphp里

    用php默认的时间格式函数计算,一个小例子,公司成立那一年与今年有多少年了

    [field:clsj runphp=yes]@me = (empty(@me) ? "" : "成立年限:<span class='orange'>".(date("Y",time())-@me)."</span> 年");[/field:clsj]

    还可以用双引号断开和拼接的方式,例如

    {dede:list pagesize='10'}
    [field:array runphp=yes]
    ($GLOBALS[autoindex]==1) ? @me="<li><a href='{@me['arcurl']}' class='preview'><img src='{@me['litpic']}'/></a><a href='{@me['arcurl']}' class='title'>{@me['title']}</a><span class='info'><small>日期:</small>".GetDateTimeMK(@me['pubdate'])."<small>点击:</small>{@me['click']}<small>好评:</small>{@me['scores']}</span><p class='intro'>简介:{@me['description']}</p></li>":@me="<li><a href='{@me['arcurl']}' class='title'>{@me['title']}</a><span class='info'><small>日期:</small>".GetDateTimeMK(@me['pubdate'])."<small>点击:</small>{@me['click']}<small>好评:</small>{@me['scores']}</span><p class='intro'>简介:{@me['description']}</p></li>";[/field:array]
    {/dede:list}
  • 相关阅读:
    [USACO06NOV]Corn Fields(状压DP)
    关灯问题II (状态压缩 BFS)
    天梯---至多删三个字符(DP)
    天梯
    蓝桥
    天梯
    天梯
    天梯
    天梯
    蓝桥
  • 原文地址:https://www.cnblogs.com/dedehtml/p/9904510.html
Copyright © 2011-2022 走看看