


How to make the title of Dreamweaver's latest post appear red within 24 hours
#How to make the title of Dreamweaver’s latest post appear red within 24 hours?
The title of the latest post published by Dream Weaver DEDECMS is displayed in red within 24 hours
Recommended learning: Dream Weaver cms
How to modify DEDECMS The latest published content will be displayed in red within 24 hours. What about changing to the normal setting color after more than 24 hours? We all know that the latest published call tag is in the home page template of the template directory. We open templets/default/index.htm. Let's assume that the following code is the latest published tag that calls this site:
<dl class="list2"> <dt><b>最新发表</b></dt> {dede:arclist titlelen='60' noflag='h' row='13'} <dd><ul> <li><span>[field:pubdate function="MyDate('m-d',@me)"/]</span><a href="[field:arcurl/]"> [field:title/]</a></li> </ul></dd> {/dede:arclist} </dl>
The following code is the call tag with a red title within 24 hours after we modify it:
<dl class="list2"> <dt><b>最新发表</b></dt> {dede:arclist titlelen='60' noflag='h' row='13'} <dd><ul> <li><span>[field:pubdate runphp='yes'] $a="<font color='#ff0000'>"; $d="<font color='#858585'>"; $b="</font>"; $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] </span><a href="[field:arcurl/]">[field:title/]</a></li> </ul></dd> {/dede:arclist} </dl>
That's it , many people will not use the default template of DEDECMS, so the latest tag I call here is different from yours. If your homepage uses the default template, you only need to add the following code:
<span>[field:pubdate function="MyDate('m-d',@me)"/]</span>
Replace it with the following code:
<span>[field:pubdate runphp='yes'] $a="<font color='#ff0000'>"; $d="<font color='#858585'>"; $b="</font>"; $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] </span>
That’s it!
The above is the detailed content of How to make the title of Dreamweaver's latest post appear red within 24 hours. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.