<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

DEDECMS最新发表的帖子在24小时内标题显示红色

时间:2020-12-15

DEDECMS怎么修改最新发表的内容在24小时内显示红色,超过24小时后变换为常理设置颜色呢?都知道最新发表的调用标签在模板目录的主页模板中,我们打开templets/default/index.htm .我们就假设以下这段代码是调用本站的最新发表标签:
 
最新发表
 
{dede:arclist titlelen='60' noflag='h' row='13'}
[field:pubdate function="MyDate('m-d',@me)"/][field:title/]
{/dede:arclist}
 
下面的代码是我们修改之后24小时内标题红色的调用标签:
最新发表
{dede:arclist titlelen='60' noflag='h' row='13'}
[field:pubdate runphp='yes'] $a=""; $d=""; $b=""; $c=strftime("%m-%d","@me"); $ntime = time(); $oneday = 3600 * 24; if(($ntime - @me)<$oneday) @me = $a.$c.$b; else @me = $d.$c.$b; [/field:pubdate] [field:title/]
{/dede:arclist}
这样就可以了,很多人不会去用DEDECMS默认模板吧,所以我这里调用最新标签跟你的是不一样的,如果你的首页是用的默认模板的话,只需要将以下代码:
 
[field:pubdate function="MyDate('m-d',@me)"/] 
替换成以下代码:
[field:pubdate runphp='yes']  
$a="";  
$d="";  
$b="";  
$c=strftime("%m-%d","@me");  
$ntime = time();  
$oneday = 3600 * 24;  
if(($ntime - @me)<$oneday) @me = $a.$c.$b;  
else @me = $d.$c.$b;  
[/field:pubdate] 
 
这样即可!
0
首页
案例
关于
联系