Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2006-09-06 01:38:09

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

Re: ras_if_expired (conditional, expiration, date)

hello all,

i couldn’t hesitate and look at ricks code to find out what i could do to improve the issue of displaying articles by date, especially because i needed more simple and separately designable solution for the display of today’s event only.

the result is my first plugin and it is here

it basically works like this:
<code>
&lt;txp:aaa_dates_past>…your past dates here…&lt;/txp:aaa_dates_past><br />
&lt;txp:aaa_dates_today>…your today’s dates here…&lt;/txp:aaa_dates_today><br />
&lt;txp:aaa_dates_future>…your future dates here…&lt;/txp:aaa_dates_future></code>

you’ll find a page with plugin help here

i hope you’ll enjoy and thanx to rick! maybe we shopuld just combine the two into one plug.

tooot!

Last edited by jayrope (2006-09-15 13:47:39)


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

Offline

#14 2006-09-11 01:16:18

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

Re: ras_if_expired (conditional, expiration, date)

Absolutely! between the five functions I think it would cover most of the desired bases. With your permission I’ll build a common plugin for the org site and Textbook, as soon as 4.0.4 comes out. Pick a prefix :)

Offline

#15 2006-09-13 10:50:13

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

Re: ras_if_expired (conditional, expiration, date)

sounds good 8).

we might aswell strip he whole thing down to three tags
I. past
II. today
III. future

all three could have attributes aswell.
1.: offdays – offset in days
+unset attribute would equal “0”.
2.: offhours – offset in hours unset attribute would equal “0”.

3.: exact = “on”/“off” – if set to off, then number of days and hours in attributes I and II would not refer to the exact posting time of the article but to the posting day, 0:00h. – very helpful for event listings. unset attribute would equal “off”).

sounds good?
prefix. phew. dunno. why not ras_dates? i kind alike to fool around with aaa_ on some other minor issues aswell, but i am generally open for anything. i like the “An Awesome AddOn” kinda thing. we might aswell use that,. You decide. I had just looked into the code of your plug and made some very simple changes.

ToooooT

Last edited by jayrope (2006-09-13 11:17:27)


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

Offline

#16 2006-09-14 06:09:53

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

Re: ras_if_expired (conditional, expiration, date)

Ok, This is what I have for a starting point.
The if_days and if_days_not tags are a good one size fits all approach, but they are cumbersome and complicated to use, maybe include them for special situations but they are in there best final form as is.

I agree. Past, Today, and Future is the best direction to go.
For picking articles for a specific date and/or time, the “month” attribute could be used with an article tag.

Offsets, I take it, would be offsets from the present until a time in the past or future when you would begin selecting article content. I haven’t looked carefully at both hours and days as attributes, I tend to like a single measure, but that ends in calculating seconds. With the proper tag arrangements, a lot can be done with what you already have.

I’ll post what I come up with as a text file as I find time to work on it. Let me know if you have any suggestions.

Offline

#17 2006-09-14 12:22:50

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

Re: ras_if_expired (conditional, expiration, date)

I tend to like a single measure, but that ends in calculating seconds.

rick, if you see possible anyhow, please don’t let the end users calculate fractions of days in order to achieve punctuality on the dot. i myself took much time in the testing phase, correcting the many mistakes i made on calculations, because dealing with txp is kinda fun for me. but the end users will not be this eager and willing, it’ll be their work, it’ll have to work. they’ll clearly prefer integer units ;)


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

Offline

#18 2006-09-15 01:22:26

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

Re: ras_if_expired (conditional, expiration, date)

Hi Uli, Good point, after looking at this for a bit it occured to me that we are after all using computers here. This upgrade should give you what I think you are looking for.

enable_articles.v04.3

I haven’t found any problems with this version, but I haven’t had much time to test either. Let us know if it works well for you.

Last edited by rsilletti (2006-09-25 05:10:36)

Offline

#19 2006-09-15 11:48:44

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

Re: ras_if_expired (conditional, expiration, date)

it occured to me that we are after all using computers here.

:) an uli-understander.

yep, at least it should feel like that. even if it costs your, i.e. rick “robin hood” siletti’s, [edit: i mean it honestly] time, that you give to the poor/ user without even mentioning. ;) thank you for that, rick!
the help text looks like it really fulfills all end users desires. i’ll tell you how it works for the current site when i find the time for testing and, before, adjusting mary’s automation snippet above. hopefully, this’ll be this weekend.
thanks, once again, rick!

Last edited by uli (2006-09-15 12:19:52)


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

Offline

#20 2006-09-15 13:57:27

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

Re: ras_if_expired (conditional, expiration, date)

rick, thanx for your update!
nice new features!
one thing icouldn’t grasp is: is your plug now judging article posted by days or exact posted time down to the second (still)? it’ll be good to make this switchable somehow.
help files: yessir, they look good here now aswell.

as of your plug.txt link before:
i looked into it, but only briefly yet, since i have a customer flood on my back.
they all WANT stuff.
when is 4.0.4 due to be released?
and can we discuss some of your php in detail? i can’t follow you on <code>assert_article();</code> aswell as <code>tz_offset()</code>…

(it would be really helpful f.i., if an offset to today’s date could also mean, that the qualifying starting time or day remains the same, but the expiration could be shifted to the future in integer hours.
that way one could have todays date being displayed in tomorrow’s morning hours still. i oftenly have events coming up which are f.i. announced for saturday, 23.00, but in reality they start on sunday 03.30 in the morning – berlin is a nighttime city…)

best greets and thanx very much for your efforts. we’ll have a major cool plug in the end, simple as hell.!

Last edited by jayrope (2006-09-15 14:03:36)


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

Offline

#21 2006-09-16 03:17:39

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: ras_if_expired (conditional, expiration, date)

rick – when I activate your plugin (not call it, just make it active) my site doesn’t load and this error is displayed:
Fatal error: Call to undefined function assert_article() in /users/home/name/domains/domain.tld/public_html/textpattern/lib/txplib_misc.php(459) : eval()'d code on line 21

Offline

#22 2006-09-16 13:38:56

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

Re: ras_if_expired (conditional, expiration, date)

Yep, same thing here with v0.4.3. [had to change the post several times, chaotic afternoon]

Last edited by uli (2006-09-16 14:30:21)


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

Offline

#23 2006-09-16 23:52:17

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

Re: ras_if_expired (conditional, expiration, date)

uli-nardo:
assert_arrticle() is recently added error checking, the link above wasn’t intended to be released until 4.0.4 was available. This 4.0.3 plugin should work for Ver 4.0.3, or you could edit the plugin you already have installed by removing the line that reads “assert_article();” from both functions. They will work properly in both versions of TXP without the error checking.

jayrope:
The tz_offset() function is a textpattern function that returns the time zone settings (in seconds) that you have set in TXP`s preferences. Its inclusion in the functions moves the zero point for them to the users perspective rather than the servers.

Last edited by rsilletti (2006-09-30 02:05:49)

Offline

#24 2006-09-17 23:10:36

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: ras_if_expired (conditional, expiration, date)

thanks rick – still having trouble getting just posts timestamped ‘today’ (whether past or future today)

also confused about how posts are dated, etc – within Txp – because I developed this site locally, entered content locally, then uploaded to a site in another timezone, etc … the articles have the correct date and time but – eg – rss_suparchive doesn’t seem to check time zone settings so I have to make sure events start after 10am (I am GMT +10) … and with your plugin I’m getting some events from yesterday listed under the heading of today! (not sure how that could happen)

I remember reading a post from zem explaining some of the complexities of maintaining time but right now it’s a lot easier to go back to hand coding the daily lists!

PS much appreciate your work, ain’t a diss!!

Offline

Board footer

Powered by FluxBB