Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-04-25 13:15:33

csandberg
Plugin Author
From: Sweden
Registered: 2006-01-07
Posts: 40
Website

[plugin] csb_if_newer_than

This simple plugin can be used to check if an article has been published within a given time. It’s my first plugin for Textpattern.

Article (website offline – Uli)

Download

Version 1.0
csb_if_newer_than.txt

Usage

In an article form:

<txp:csb_if_newer_than days="30" hours="12" minutes="20">
    The article is posted within 30 days, 12 hours and 20 minutes.
<txp:else />
    This article is too old.
</txp:csb_if_newer_than>

Feel free to make suggestions and report bugs!

{Edited to fix the broken download link. -Uli}

Last edited by uli (2012-02-09 23:19:35)

Offline

#2 2006-04-29 13:12:12

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] csb_if_newer_than

Thanks for this, using it here to mark ‘new’ articles.

Offline

#3 2006-07-14 15:32:32

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,096
Website GitHub Mastodon Twitter

Re: [plugin] csb_if_newer_than

very cool
thanks csandberg


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-07-04 05:11:38

jauhari
Member
Registered: 2007-05-24
Posts: 97
Website

Re: [plugin] csb_if_newer_than

Just Running Good ;) I like it ;)

Offline

#5 2014-08-08 02:29:51

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: [plugin] csb_if_newer_than

Figured out a neat trick (at least to me). I never liked having really large day counts (3,000 days ago).

<txp:csb_if_newer_than days="365" hours="0" minutes="0">
  <txp:permlink><txp:title /></txp:permlink> - <txp:posted />
<txp:else />
  <txp:permlink><txp:title /></txp:permlink> - <txp:posted format="%B %e, %Y" />
</txp:csb_if_newer_than>

Offline

Board footer

Powered by FluxBB