DEDECMS为文章添加NEW标志图片

找到extend.func.php添加自定义函数:

function shownewimg($pubtime)
{
$ntime = time();
$tagtime = $pubtime;
$day3 = 3600 * 24 * 30;
if($tagtime > $ntime-$day3) $pubtime = "<img src='http://www.musictherapy2003.com/images/new.gif' />";
else $pubtime = "";
return $pubtime;
}

在模板文件中添加
[field:pubdate function='shownewimg(@me)'/]

原文地址:https://www.cnblogs.com/jyb2014/p/4089429.html