Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Pages: 1 [2]

Author Topic: Article Expiration  (Read 10311 times)

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
Article Expiration
« Reply #15 on: January 31, 2007, 08:07:57 AM »

That's delete upon expiration mode. Try this instead:
BACKUP BEFORE TESTING
Quote
// ARTICLES - FUTURE POSTING
function update_articles() {
mysql_query("UPDATE ".db('prefix')."articles SET published=1 WHERE published=2 AND date <= '".date("Y-m-d H:i:s")."'");
// this will unpublish all published articles at the position 1 (main articles) that are 30 days older than current date
mysql_query("UPDATE ".db('prefix')."articles SET published = 2 WHERE published = 1 AND position = 1 AND DATE_SUB(CURDATE(),INTERVAL 30 DAY) > date");
}
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

tinus2

  • Newbie
  • *
  • Karma: 0
  • Posts: 5
Article Expiration
« Reply #16 on: February 06, 2007, 12:12:22 AM »

thanks for your posts!

i understand that this mod will unpublish after 30 days of publication - but what can I do if I want the article to expire at a certain date? Ideally, this would be chosen when publishing the articles.
Logged

vince

  • Newbie
  • *
  • Karma: 0
  • Posts: 3
Article Expiration
« Reply #17 on: February 08, 2007, 03:18:26 PM »

Quote from: codetwist
My suggestion is along availability of following options:
 - global expiration time (specific number of days, if set empty then nothing ever expires by default)
 - article specific expiration time (specific number of days, if set empty then global expiration takes precedence)
 - article marked as permanent (active always, never mind any expiration times)

But beware of oversmarting this CMS:
No automatic removal of articles from database tables. If anyone needs this - make it as a mod; but by default all content should be removable only by conscious or not so ;) action of competent or again not so ;P site admin.

                                             
 :rolleyes: Waiting eagerly for stable 1.5
Hi everyone,
I'm new here but afetr a brief look at sNews and how it would fit my requirements, I found myself looking for this feature before anything else.  :)

Sincerely hope the post by codetwist gets more support.

Now off to look at the Captcha for comments and contact form.

Best wishes to all on this great little CMS.

- Vince
Logged
Pages: 1 [2]