Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-08-25 17:35:54
- nemozob
- Member
- Registered: 2008-04-15
- Posts: 36
How to test if article is new or modified within last 30 days?
I thought csb_if_newer_than was what I needed for this but it only tests for the original posted date, not the modified date. I’d like to add a class to article titles that are either new or have been modified within the last 30 days.
Offline
Re: How to test if article is new or modified within last 30 days?
A small warning: $thisarticle[‘modified’] does not contain the unix timestamp in 4.0.6 as it should (will be fixed in TXP 4.0.7), so refrain from using that to solve this when using TXP 4.0.6/
Offline
#3 2008-08-25 22:13:17
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: How to test if article is new or modified within last 30 days?
nemozob, have you considered to use the “Set timestamp to now” checkbox when saving a modified article?
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#4 2008-08-25 22:52:52
- nemozob
- Member
- Registered: 2008-04-15
- Posts: 36
Re: How to test if article is new or modified within last 30 days?
yes, checking “Set timestamp to now” does allow me to do what I wanted. Although I would like this to be automated, I supposed I could modify the link to always be checked.
Thanks.
Offline
#5 2008-08-25 23:59:10
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: How to test if article is new or modified within last 30 days?
Download, install and activate rss_admin_show_adv_opts.
Then edit the plugin:
Find
toggleDisplay('advanced');
and replace by
toggleDisplay('more');
document.article.publish_now.checked = true;
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#6 2008-08-26 00:32:25
- nemozob
- Member
- Registered: 2008-04-15
- Posts: 36
Re: How to test if article is new or modified within last 30 days?
Thanks. The DOM path above wasn’t quite correct. It should be:
document.article.reset_time.checked = true;
But yes, this works. I was planning to use a javascript fix for this, now I know how to do this in the future.
Offline