Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2006-09-23 04:12:27

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: ras_if_expired (conditional, expiration, date)

I’ve a plugin that is tested, won’t crash 4.0.3, and is much easier to use than if_days. It uses day, hours, and minutes as integer attributes and the whole picture just makes clearer sense.
Info Article
Plugin Link ras_enable_articles_v4.0.3.1.txt

Thanks Uli.

Nardo – The dates_today function, as well as the rest, still doesn’t work as defaulted to the current day. If given a date attribute all three work nicely – I’ll let you know when I can get them working in auto-mode.

Last edited by rsilletti (2006-09-23 18:00:46)

Offline

#32 2006-09-25 05:20:49

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: ras_if_expired (conditional, expiration, date)

I’ve a working copy of a ras_dates plugin that seems to be running perfectly.

Plugin Link ras_dates_v4.0.3.1.txt

Not exactly the original idea, but the combination of ras_enable_articles and ras_dates should be of practical value if they prove reliable.

Last edited by rsilletti (2006-09-28 00:14:46)

Offline

#33 2006-09-26 00:57:36

szac
Member
From: Detroit-ish
Registered: 2004-09-18
Posts: 50

Re: ras_if_expired (conditional, expiration, date)

Hi rsillietti,

The plugin appears to need compiling. If I’m reading the thread right this plugin would work if I just wanted to show an article for duration? Like if article’s date == today then show the article. Is this correct?
thanks for your work!

Offline

#34 2006-09-26 01:31:05

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: ras_if_expired (conditional, expiration, date)

Plugins are encoded and are installed that way. Once installed, both the plugin functions (as recognizable text) and the help writeups are available.
Some good instructions on installation Here ,and yes the plugin is designed to return article content posted to the current day as well as other choices.
Some example forms , and be aware that this plugin is presently in development. I can’t, as yet, gaurantee the desired results.

Do let us know how it works if you do choose to use it.

Last edited by rsilletti (2006-09-26 01:32:48)

Offline

#35 2006-09-28 00:03:01

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: ras_if_expired (conditional, expiration, date)

Egad – sorry about that, it was in fact not a compiled version – it was the backup php. I am not having my best week here. :(

I’ll check this one to make sure this time. Plugin

Offline

#36 2006-10-27 09:51:03

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 726
Website Mastodon

Re: ras_if_expired (conditional, expiration, date)

hey rick, super, that it’s goign further and furtehr. scuse my only occassional re-appearance: loads of nasty work to do over here, mostly not programming-related.
still i am looking ofrward to anything to come and hop i can chip in something everyonce in a while.

toooot

berlin’s so warm and windy, while leaves fall. it’s got a weird, subconcious climate change feel to it, i fear, but it’s nevertheless enjoyable and maybe nicely surreal


A hole turned upside down is a dome, when there’s also gravity.

Offline

#37 2006-10-30 21:46:47

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 726
Website Mastodon

Re: ras_if_expired (conditional, expiration, date)

rick, i totally appreciate your ongoing efforts on the article posting date related issues.
now… if one could add an option to actually completely delete an article, if it has expired!
i am looking into the txplib_wrapper.php and find this function:
deleteArticleID($article_id)

wouldn’t it make sense to implement an attribute to the ras_disable_articles, like delete=“y”, which could take care of this?

with a feature like this, textpattern could be serving large sites full of classifieds (with expiration dates) or anything similar.

i know i am fantasizing, but well….

best greets, janek


A hole turned upside down is a dome, when there’s also gravity.

Offline

#38 2006-10-30 23:51:35

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: ras_if_expired (conditional, expiration, date)

Disabling content display and deleting an article are tasks that are quite different. If I understand what you would like to see happen here, using a conditional test in an article form to initiate deletion of an article, a lot of things can happen that are out of control in terms of circumstances.
Given that the article form is called and the correct info is availble to that form, it could be done. But I think a seperate function would be required and there is no reason not to use it as a seperate tag, gimme some time with it :) BTW I love the new ideas, they are always more than welcome.

Offline

#39 2006-10-31 00:52:03

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 726
Website Mastodon

Re: ras_if_expired (conditional, expiration, date)

hey rick 8-)
most important: no hurry!
and: i had started a thread about article deletion here
there’s some good indicators already, which way could be gone. still i guess we have the same problem: not much time for development right now. nevertheless: we’ll get there, i am sure.
(simultaneously working on multilingual blog stuff… and a cd shop in textpattern… ouch…)

best greets janek


A hole turned upside down is a dome, when there’s also gravity.

Offline

#40 2008-06-30 06:38:50

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: ras_if_expired (conditional, expiration, date)

hi, very neat plugin. i believe this is still the most up-to-date way to display just today’s articles?

so two problems i have so far using <txp:ras_if_dates_today>

the first is you have to set the date, or else you get an error in testing mode. which seems weird to me cause shouldn’t it know what the date is from the database? i dont think i understand that correctly.

the second problem is i’m trying to use the <txp:else /> to give me the conditional if there are no articles for today to spit back the message “sorry nothing happening”. but it seems to spit out the message regardless of there being an article or not. thanks

Offline

#41 2008-06-30 13:23:49

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

Re: ras_if_expired (conditional, expiration, date)

mrtunes wrote:

i believe this is still the most up-to-date way to display just today’s articles?

I think it is at least the easiest way.

the first is you have to set the date, or else you get an error in testing mode. which seems weird to me cause shouldn’t it know what the date is from the database?

Yes, it should, and it does: I don’t get any errors without inserting a date. Have you looked for things like using curly quotes instead of straight ones in any of your tags or forgotten to close a tag?
Please post the tag and the error here if the error keeps coming. I think if we got this running the second issue will be gone :)

You can also try my (simplified) code and see how it works:

<txp:ras_if_dates_today>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<txp:body />
<txp:else />
</txp:ras_if_dates_today>

Create an article type of form on the form tab for it and choose this form for the articles you want only to show on the current date.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#42 2008-06-30 14:14:38

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: ras_if_expired (conditional, expiration, date)

If what you are using is in fact called ras_if_expired, you are probably using an early variation of this plugin. The most recent and thoroughly tested versions are available here. The differences have to do with the tag builders and don’t affect the tags, but matching versions to TXP versions can avoid some annoyance.

ras_if_dates_v4.0.4.2

ras_if_dates_v4.0.5.1

Offline

#43 2008-06-30 19:50:49

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: ras_if_expired (conditional, expiration, date)

uli wrote:

Yes, it should, and it does: I don’t get any errors without inserting a date. Have you looked for things like using curly quotes instead of straight ones in any of your tags or forgotten to close a tag?
Please post the tag and the error here if the error keeps coming. I think if we got this running the second issue will be gone :)

thanks, i realized that i had to use the setdate cause i wasn’t using the </txp:else> command as the error seems to be gone now. or something else fixed it?

but it’s still not showing it conditionally:
<txp:ras_if_dates_today>
<h3><txp:title /></h3>
<txp:body />
<h2>Start Time: <txp:custom_field name=“time” /><br/>
Venue: <txp:custom_field name=“venue” /><br/>
Price: <txp:custom_field name=“price” />
</h2>
</txp:else>
Nothing’s good today </txp:ras_if_dates_today>

—-
Nothing’s good today shouldn’t show up if there’s no articles meeting the requirements

i’m using if dates v4.0.5.1 on txp 4.0.6 (sorry for not posting that earlier)

Last edited by mrtunes (2008-06-30 19:52:36)

Offline

#44 2008-06-30 20:44:19

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

Re: ras_if_expired (conditional, expiration, date)

As I presumed: </txp:else> is not the desired valid form of “else”, change it to <txp:else />. If that isn’t sufficient yet – though it should be – try downloading the plugins for 4.0.6 if_dates is contained herein.

When you post code, please use the textile commands for posting code as shown in the help under each posting form text area. This way we can unequivocally see whether someone has used the wrong, i.e. curly quotes which is often enough another simple reason for errors. Thanks :)

Last edited by uli (2008-06-30 20:47:47)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#45 2008-06-30 21:02:28

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: ras_if_expired (conditional, expiration, date)

Textpattern will return all the article content that the article tag calls for. ras_if_dates will select content on an article by article basis as set by the tag criteria for display if true for the set date or date range, and will display what is set in the tag arrangement (including article content) after the else clause when the date or date range does not fall into what is set by attribute or tag arrangement. The article tag still controls returned content, including navigation statistics.

some examples

Offline

Board footer

Powered by FluxBB