首先,要在模板中选中“使用程序代码”。

然后,在列表内容模板(list.var)框中,添加如下代码:

$newimg='[!--newstime--]';
if(time()-$r[newstime]<=1*24*3600)
{
        $newimg='<FONT color=red>[!--newstime--]</FONT>';
}  
$listtemp='<li><span class="date">'.$newimg.'</span> <a href="[!--titleurl--]" target=_blank>[!--title--]</a> </li>';

或者使用灵动标签

<ul>
[e:loop={'news',15,18,0}]
<?
$newstime=format_datetime($bqr[newstime],'m-d');
if(date('Y-m-d')==date('Y-m-d',$bqr[newstime]))
{
$newstime="<font color=red>$newstime</font>";
}
?>
<li>[<a href="<?=$bqsr[classurl]?>"><?=$bqsr[classname]?></a>] <a href="<?=$bqsr[titleurl]?>"><?=esub($bqr[title],40)?></a><span><?=$newstime?></span></li>
[/e:loop]
</ul>
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。