Open the /extend/function.php file and add the following code in it:
1. Determine whether to add an icon to the article of the day. The icon file needs to be prepared by yourself
/*Customize timestamp to add picture function file on the same day, calling code: {$field.add_time|diy_MyDate=###}*/
function diy_MyDate($add_time = 0)
{
$str = $add_time;
$time = strtotime(date('Y-m-d'));
if (intval($str) > $time) {
$pic = handle_subdir_pic('/public/static/admin/images/new.gif');
$str ="
";
} else {
$str = date('Y-m-d',$str);
}
Return $str;
}
/public/static/admin/images/new.gif is the image path. Please add and modify the image path if you need the image required
Calling code: {$field.add_time|diy_MyDate=###}
2. Determine the day’s article and add the red mark style
/*Customize the time stamp function file marked in red on the day, calling code: {$field.add_time|diy_MyDate=###}*/function diy_MyDate($add_time = 0)
{
$str = $add_time;
$time = strtotime(date('Y-m-d'));
if (intval($str) > $time) {
$str = "".date('Y-m-d', $str)."";
} else {
$str = date('Y-m-d', $str);
} }
Return $str;
}
is a red code, if you need other colors, please modify it yourself
Calling code: {$field.add_time|diy_MyDate=###}
Note: The two functions cannot be used together