bbPress

Simple, Fast, Elegant

bbPress support forums » Requests and Feedback

expired topics

(4 posts)
  1. I'd love to see the ability to have topics automatically expire. In other words, if a topic hasn't had a new post in a given amount of time, it could optionally be closed or deleted automatically. For those of us that wish to keep our databases small, this might be pretty helpful.

    Posted 2 months ago #
  2. This would be a very simple plugin.
    I'll try to whip it up for you when I have a moment.

    Posted 2 months ago #
  3. Untested. auto-closes a topic on-the-fly when someone visits it and it's last post is 90 days old (adjustable)

    add_action('bb_head','auto_close_topic');
    function auto_close_topic() {
    global $topic;
    if (is_topic() && $topic->topic_open===1) {
    $old=time()-3600*24*90; // 90 days default
    if (strtotime($topic->topic_time)<$old) {
    bb_close_topic($topic->topic_id);
    $topic->topic_open=0;  // just in case the cache doesn't clear
    }
    }
    }
    Posted 2 months ago #
  4. You're the best, _ck_! I'll try it!

    Posted 2 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.