Home > CMS Tutorial > DEDECMS > body text

Dream Weaver dedecms article list 'interlaced color change' effect

(*-*)浩
Release: 2019-12-09 14:41:18
Original
2389 people have browsed it

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!