Home >CMS Tutorial >DEDECMS >Dream Weaver dedecms article list 'interlaced color change' effect

Dream Weaver dedecms article list 'interlaced color change' effect

(*-*)浩
(*-*)浩Original
2019-12-09 14:41:182438browse

Dream Weaver dedecms article list 'interlaced color change' effect

Using interlaced color change in the article list can make the two displayed contents different. Many websites use the interlaced color display method in the list page. I will explain it below. The code that implements interlaced color changing in dedecms v5.7 is posted here, so that friends who like dedecms can refer to the following code and modify it to achieve the display effect you want.

Add a line every 5 lines in the list: (Recommended learning: 梦Weavercms)

{dede:list pagesize='50'}
<LI><a href="[field:arcurl /]" title="[field:title function=&#39;htmlspecialchars(@me)&#39;/]"
target=_blank>[field:title function="cn_substr(@me,48)"/]</a>[field:pubdate runphp=&#39;yes&#39;]
$a="<font color=red>".strftime(&#39;%m-%d&#39;,@me)."</font>";
$b=strftime(&#39;%m-%d&#39;,@me);
$ntime = time();
$day3 = 3600 * 24;
if(($ntime - @me) < $day3) @me = $a;
else @me =$b;
[/field:pubdate]<br>
[field:global name=autoindex runphp="yes"]
if(@me%5==0)@me="<hr />";
else @me="";
[/field:global]
{/dede:list}
<DIV></DIV></LI>

The above is the detailed content of Dream Weaver dedecms article list 'interlaced color change' effect. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn