<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">

观点

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

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

时间:2020-12-16

很多做博客或者cms类的站长,用织梦的程序,都希望在多少时间呢,置顶文章,今天给大家分享一个标题自动红色的小技巧

我们打开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
首页
案例
关于
联系