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)'/]

posted @ 2014-11-11 14:38  jyb2014  阅读(129)  评论(0编辑  收藏  举报