主页 > 网站建设 > 建站知识 > 织梦dedecms当天文章标题加红色最新标记

织梦dedecms当天文章标题加红色最新标记

POST TIME:2021-05-22 23:51

在文章标题的后面增加“(new)”最新发布的标志:
 
{dede:arclist row='5'titlelen='60' typeid='1'}
<li><a href="[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="[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}
 
 


收缩
  • 微信客服
  • 微信二维码
  • 电话咨询

  • 400-1100-266