Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[plugin] [ORPHAN] msv_if_custom_article_date ( If Custom Article Date )
I tried to post this on the plug-in’s Textpattern Resources page but it never went through so I’m starting a thread for it (the plug-in).
______________________________________
What I Couldn’t Post
This plug-in is exactly what I’ve been looking for. I’d like to use it to have articles automagically “die” after a specified date, not a posting/modification date like similar plug-ins I’ve found.
I’ve tried many ways of getting this to work but I have not been successful.
I admit to getting confused reading things like “…will be published if date specified in the custom field number 1 (date in format ‘dd-mm-yyyy’) is less than 11th November 2006.” Less than? I’m not used to thinking about dates in greater/less than terms but I’ve tried each of the options without success (i.e., greater/less/greaterequal/lessequal/equal/notequal).
I’ve also tried inputting a date with / and – and changing the dateseparator appropriately, again, without success.
Could anyone that’s gotten this to work for them give an example?
Also, the linked file above goes to the author’s other plugin, msv_show_article_field, not msv_if_custom_article_date.
______________________________________
Links
Martin Švihla’s Textpattern plugins
Last edited by rtxpn (2006-10-30 17:34:39)
Offline
Re: [plugin] [ORPHAN] msv_if_custom_article_date ( If Custom Article Date )
thanx for pointing me here.
now i’d like to find out about this plugin:
if an article is older than of a certain date:
will this article actually be completely deleted from the database then?
i believe, that this is not possible without storing an expiration date for an article with the article itself.
that would be, in any case, the type of functionality i am searching for.
unfortunately the plugin author’s website doesn’t say anything about this special functionality. or did i overlook that?
thanx much in advance 8)
Last edited by jayrope (2006-10-30 18:17:06)
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: [plugin] [ORPHAN] msv_if_custom_article_date ( If Custom Article Date )
Er, hmm. Yea. I missed the whole important deletion part of your thread. I was so excited that I might have found a lead to help me with this issue that I selectively read your post
I’m sorry to disappoint you! …but hopefully the plug-in’s handling of everything else is a good starting place for you (I read of your desire to set an article’s date in a custom field).
How I’m hoping to use this, if you’re curious:
- Upcoming events are stored as individual articles. The event’s date (or ending date if it spans multiple days) will be put in a custom field.
- By making use of the conditional, after the event’s specified date has passed its article is no longer displayed in the upcoming events category.
- By making use of the conditional, past events can be displayed in a ‘past events’ category.
Offline
#4 2006-11-28 10:55:36
- bigtom
- New Member
- Registered: 2006-11-21
- Posts: 4
Re: [plugin] [ORPHAN] msv_if_custom_article_date ( If Custom Article Date )
hi
I tried to use this plugin but I have a problem
The events I manage may begin a day and finish a few days later (sometimes a week). I want to have a separation between future events, actual events and past events.
My article have two custom fields : custom1=begining date and custom2=finishing date
I created three forms :
article_future
<txp:msv_if_custom_article_date is=“greater” customfield=“1”>
<txp:msv_if_custom_article_date is=“greater” customfield=“2”>
<txp:permlink><txp:title /></txp:permlink>
<txp:body />
</txp:msv_if_custom_article_date>
</txp:msv_if_custom_article_date>
article_today
<txp:msv_if_custom_article_date is=“greaterequal” customfield=“1”>
<txp:msv_if_custom_article_date is=“lessequal” customfield=“1”>
<txp:permlink><txp:title /></txp:permlink>
<txp:body />
</txp:msv_if_custom_article_date>
</txp:msv_if_custom_article_date>
and article_past
<txp:msv_if_custom_article_date is=“less” customfield=“2”> <txp:permlink><txp:title /></txp:permlink>
<txp:body />
</txp:msv_if_custom_article_date>
But it doesn’t publish the right article at the right place. First, it publishes the body of the article without the title. Second, the form article_future and article_today publish the same list of articles. It shouldn’t.
Does anyboy know why ?
Offline
Re: [plugin] [ORPHAN] msv_if_custom_article_date ( If Custom Article Date )
With a slight modification to the plug-in it can be used to do a list of future articles according to a custom field.
I’ve used <txp:article listform="mylistform" sort="custom_1 asc" />
in the page
custom_1
in the article holds the event start date in the format yyyy-mm-dd
(rather than the other way around as martin suggests) for ensuring correct sorting.
mylistform
is wrapped in his plug-in:
<txp:msv_if_custom_article_date is="greaterequal" customfield="1" dateseparator="-">
... rest of form ...
</txp:msv_if_custom_article_date>
The modification made to martin’s plug-in is minimal and is simply to reflect the change in date format with year first, then month, then day:
$intFirstDay = $arrFirstDate[2];
$intFirstMonth = $arrFirstDate[1];
$intFirstYear = $arrFirstDate[0];
The list outputs as if it were txp:article time="future"
but using a custom field rather the article publish format.
Last edited by jakob (2007-04-01 21:56:14)
TXP Builders – finely-crafted code, design and txp
Offline