Textpattern 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
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,383
Website

Re: [plugin] csb_if_newer_than

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


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 4,933
Website

Re: [plugin] csb_if_newer_than

very cool
thanks csandberg


Yiannis
——————————
neme.org | neme-imca.org | hblack.net | LABS

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: 501
Website

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