Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-05-27 13:47:38
- pketh
- Member
- Registered: 2005-05-30
- Posts: 24
differentiating posts that are less than a week old
Hey all,
I was wondering how (if?) it was possible to have my posts that were less than a week old automatically have a little image beside their title (like a little ‘new post’ badge or anything else). Is there a way to make a time sensitive form or tags in the default form (the latter is preferred) ?
thanks so much :)
personal site:
www.pketh.com
Offline
Re: differentiating posts that are less than a week old
In your article form at the position where you want the image to appear:
<txp:php>
global $thisarticle;
if (time() - $thisarticle['posted'] < 7*24*3600)
{
echo '<img src="path/to/new.jpg">';
}
</txp:php>
Last edited by ruud (2007-05-27 13:59:20)
Offline
Re: differentiating posts that are less than a week old
Would csb_if_newer_than help you?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#4 2007-05-27 14:04:00
- pketh
- Member
- Registered: 2005-05-30
- Posts: 24
Re: differentiating posts that are less than a week old
very very awesome!
I’ll try them both soon then
thanks again :)
personal site:
www.pketh.com
Offline
#5 2007-05-27 14:55:10
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: differentiating posts that are less than a week old
Try these ras_if_dates
Offline
Re: differentiating posts that are less than a week old
Tks ruud,
As always : very short code for great fonctionnality!
Less n’d less plugin, more n’d more PHP!
Cheers,
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline