帝国ECMS列表模板list.var中新发布的新闻加new标识图片
list.var模板需要勾选“使用程序代码”选项:
list.var的内容为:
$newimg='';
if (time()-$r[newstime]<=1*24*3600) {
$newimg='<img src="new图片地址" border="0" >';
}
$listtemp='<li><a href="/">[!--title--]</a>' .$newimg. '</li>';
其他说明:
如果$listtemp引用模板内容是用单引号,那么里面使用单引号前面要加\,例如:$listtemp='<imgsrc=\'[!--titlepic--]\'>';
相反如果引用模板内容是用双引号,那么里面使用双引号前面也要加\,例如:$listtemp="<imgsrc=\"[!--titlepic--]\">";
标签:栏目+标题+日期列表(主页)
$newimg='';
if (time()-$r[newstime]<=1*24*3600) {
$newimg='<img src="/skin/default/images/new.gif" border=0 >';
$title=$r[title];
$ttl=substr($title, 0, 45);
if ( strlen( mb_substr($ttl, -1,1,"gbk") ) == strlen( substr($ttl, -1,1) ) ){
$ttl=substr($title, 0,44) ;
}
}else{
$ttl ='[!--title--]';
}
$listtemp='<li>[!--class.name--] <a href="[!--titleurl--]" title="[!--oldtitle--]" target="_blank">' . $ttl . '</a>'.$newimg.' <span>[!--newstime--]</span></li>';
标签:循环子栏目+日期列表(频道页)
$listtemp='<li>'. $navinfor[befrom] .'<a href="[!--titleurl--]" title="[!--oldtitle--]">' . $ttl . '</a>' .$newimg. ' <span>[!--newstime--]</span></li>';
默认文章列表模板
$listtemp='<li><a href="[!--titleurl--]" title="[!--oldtitle--]">' .$ttl . '</a>' .$newimg. ' <span>[!--newstime--]</span></li>';
|