ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

One random entry per day

February 05, 2012 11:38pm

Subscribe [4]
  • #1 / Feb 05, 2012 11:38pm

    Brennan Sang

    17 posts

    I’m working on building a site that will highlight one random entry per day.

    I’ve thought about caching the template with a 24 hour refresh, but that would require the template be called at midnight to have it switch over perfectly.

    I was wondering if anyone has any ideas? I’m open to using addons.

    Thanks a ton,
    Brennan

  • #2 / Feb 06, 2012 1:59am

    Bhashkar Yadav

    727 posts

    Brennan, i don’t think, there is any ad-one which can do it. An ad-one can be developed which will highlight one random entry per day by setting a new channel status for selected random entry and highlight that day.

  • #3 / Feb 06, 2012 4:31am

    silenz

    1651 posts

    I could port the Random Sticky plugin to EE 2 if the functionality meets your requirements…

  • #4 / Feb 06, 2012 5:45am

    Bhashkar Yadav

    727 posts

    @silenz - cool. i looked a glance at this ad-one. great work. can be modified for EE 2 also.

  • #5 / Feb 06, 2012 10:51am

    Brennan Sang

    17 posts

    @silenz — I think the tricky part is that the refresh is based on a duration, whereas ideally it’d be based on the day. Am I correct in thinking that’s how your plugin works?

  • #6 / Feb 06, 2012 4:26pm

    silenz

    1651 posts

    It’s duration based, too. But compared to normal template caching it will behave more consistently.

    For the “perfectly timed switch” unrelated to any site activity you’d need to setup a cron job in any way. Though I don’t know whether you really need it. If a tree falls in a forest and no one is around to hear it, does it make a sound?

    Anyways, I updated the plugin in case anyone needs it: Random Sticky.

  • #7 / Feb 06, 2012 5:01pm

    AndreiCurelaru

    54 posts

    Hi,

    It could be a usefull feature, let us know what solution you picked up an working for EE2.4

  • #8 / Feb 06, 2012 6:22pm

    Brennan Sang

    17 posts

    Thanks Silenz. I’ll give it shot w/the plugin and report back.

    The site is a collection of phrases/poems/passages. The idea is that every day one is selected, and people can then discuss the selected entry.

    The more I look into it, the more I think I’ll need to write a plugin that interacts w/a db table. So I’d put a randomly generated sequence of post ID’s into a DB with each row including the date to be featured and the ID of the post. That way I can ensure no entries were repeated before all of them were featured at least once.

    Thanks a ton for your help.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases