织梦dedecms当天文章标题加赤色最新标志

文章标题的后头增加“(new)”最新宣布的符号:

 

{dede:arclist row='5'titlelen='60' typeid='1'}

<li><a href=http://www.dede58.com/"[field:arcurl/]">[field:title/]</a>

<span>

[field:senddate runphp='yes']

$ntime = time();

$oneday = 3600 * 24;

if(($ntime – @me)<$oneday) @me = "<font color='#c00'>(new)</font>";

else @me = "";

[/field:senddate]

</span>

</li>

{/dede:arclist}

 

另一种php形式代码:

 

{dede:arclist titlelen='60'row='5'}

<li><a href=http://www.dede58.com/"[field:arcurl/]">[field:title/]</a>

<span>

[field:pubdate runphp='yes']

$a="<font color='#ccc'>";

$d="<font color='#c00'>";

$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>

</li>

{/dede:arclist}
 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wsjpgs.html