Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-18 00:10:39

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Random Daily Article.

How do I display an article at random that changes on a daily basis?

Know it’s a simple one, but…

Offline

#2 2006-02-18 02:32:35

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Random Daily Article.

Not that easy with core, no. I can’t think of an easy way to do this with TXP. But if you know some basic PHP, you could do this with a plugin, and it wouldn’t be that hard.

Offline

#3 2006-02-18 03:38:51

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Random Daily Article.

<txp:article_custom sortby="rand()" limit="1" /> can give you random, but yeah it’d change on every page load.

Offline

#4 2006-02-18 15:56:41

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Random Daily Article.

Welcome back Mary…

Yeah, sortby="rand()" was one of the first tricks I learned. But the daily duration is the bit thta eludes me.

I’ve been looking at the code in mdp_rotating_image, an oldie that produces a randomly rotating image that rotates every hour/day/week/month/year but it seems to load an image into a cache directory or something, which it replaces based on a PHP routine.

I’ll post if I find anything further.

Offline

Board footer

Powered by FluxBB