Abra el archivo /extend/function.php y agregue el siguiente código dentro:
1. Determine si desea agregar un ícono al artículo del día. El archivo del icono debe prepararlo usted mismo.
/*自定义时间戳当天加图片函数文件,调用代码:{$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 ="<img src='{$pic}'/>";
} else {
$str = date('Y-m-d',$str);
}
return $str;
}
/public/static/admin/images/new.gif es la ruta de la imagen. Agregue y modifique la ruta de la imagen si la necesita.
Código de llamada: {$field.add_time|diy_MyDate=###}
2. Determina el estilo rojo del artículo del día.
/*自定义时间戳当天标红函数文件,调用代码:{$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 = "<font color='red'>".date('Y-m-d', $str)."</font>";
} else {
$str = date('Y-m-d', $str);
}
return $str;
}
<font color='red'></font> es el código rojo, si necesita otros colores, modifíquelo usted mismo
Código de llamada: {$field.add_time|diy_MyDate=###}
Nota: Las dos funciones no se pueden utilizar juntas