Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-07-21 11:13:13

edmungo
Member
Registered: 2006-07-10
Posts: 12

Can if_expires work in article lists like ras_if_expires plugin does?

Since Txp 4.0.6 I’ve been using the ras_delete_expired to delete expired articles (setting an expiry date in a custom field). With this plugin I can also show the expiry date on an article list (using ras_if_expires and ras_expires). Now Txp has Expires in the core and an if_expires tag, so I thought I’d ditch the plugin and use the core functions. But I can’t use if_expires in an article list!? So now I have to set both! I have use ras_if_expires to show expiry dates on article lists, and also set the core Expires date to use core expiry date functions. Anyone know a patch I can apply to fix the core if_expires tag to work in an article list?

Offline

#2 2010-07-21 12:28:53

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,376
Website GitHub Mastodon

Re: Can if_expires work in article lists like ras_if_expires plugin does?

if_expires works in article lists. Posting your article form or even a tag trace might give us some clues why you are not receiving your desired output.

Offline

#3 2010-07-22 01:05:54

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

Re: Can if_expires work in article lists like ras_if_expires plugin does?

ras_delete_expired hasn’t been updated since article expiration was added to the core (also not the included tags). I’m currently using this delete_expired and core tags for what I do.

Offline

#4 2010-08-10 10:57:36

edmungo
Member
Registered: 2006-07-10
Posts: 12

Re: Can if_expires work in article lists like ras_if_expires plugin does?

Sorry, I may have been unclear – txp:if_expires works in an article list but txp:expires doesn’t, so I can list articles with an expiry date but I can’t display that date in the list. I’m having to use txp:if_expires to list the articles and ras_expires (which uses a custom field) to display the expiry date, so I have to set both the core expiry date and the custom field.

Any ideas?

Offline

#5 2010-08-10 11:33:23

edmungo
Member
Registered: 2006-07-10
Posts: 12

Re: Can if_expires work in article lists like ras_if_expires plugin does?

one further note on this – I’m using Rob Sables rss_unlimited_categories_article_list, which might be why it’s not returning the expires date?

Offline

#6 2010-08-10 13:38:22

edmungo
Member
Registered: 2006-07-10
Posts: 12

Re: Can if_expires work in article lists like ras_if_expires plugin does?

Ok, turns out it was the rss_unlimited_categories plugin that didn’t include any article expiry information so I’ve had to hack that plugin. For your information around line 480 of the plugin change:

$rs = safe_rows_start(“*, unix_timestamp(Posted) as uPosted”, “textpattern”, $q2);

to

$rs = safe_rows_start(“*, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod”, “textpattern”, $q2);

Offline

Board footer

Powered by FluxBB