假如你的代码为:
{dede:arclist row=’6′ titlelen=’33’ typeid=’6′ orderby =’pubdate’}
<li>
<span>[field:pubdate function=”MyDate(‘m-d’,@me)”/]</span>
<a href=”[field:arcurl/]”>[field:title/]</a>
</li>
{/dede:arclist}
则将以上代码修改为:
{dede:arclist row=’6′ titlelen=’33’ typeid=’6′ orderby =’pubdate’}
<li>
<span>[field:pubdate runphp=’yes’]
$a=”<font color=’#ff0000′>”;
$d=”<font color=’#858585′>”;
$b=”</font>”;
$c=strftime(“%m-%d”,”@me”);
$ntime = time();
$oneday = 3600 * 24;
if(($ntime – @me)<$oneday) @me = $a.$c.$b;
else @me = $d.$c.$b;
[/field:pubdate]
</span>
<a href=”[field:arcurl/]”>[field:title/]</a>
</li>
{/dede:arclist}
蓝色代码为修改前代码,红色代码为修改后代码

发表评论

电子邮件地址不会被公开。 必填项已用*标注