Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to Add Status Update *NEW* into Your Title

  • @bbisimone

    Member

    Hi folks,

    I would like to know how I could get bbpress to show a little status update in my titles. So people can see which posts have just been opened.

    This is what I’d like to accomplish: http://www.flickr.com/help/forum/en-us/

    Thanks a bunch for your suggestions!

Viewing 8 replies - 1 through 8 (of 8 total)
  • @gerikg

    Member

    https://bbpress.org/plugins/topic/unread-topics/#post-573

    I think you can just change UNREAD to NEW.

    @gerikg

    Member

    @bbisimone

    Member

    Thanks for this idea gerikg!

    But I think it’s not yet what I was looking for. Instead of the additional tables in the database I would just like to do one thing:

    Indicate wether the post you see was recently opened up, let’s say one day old or so. If so, put the new in front of the title.

    So instead of checking wether you have read the post already, the function just checks if the post is older than one day and shows yes or no!

    Should be fairly straight forward, but my coding skilss are not enough advanced.

    @kawauso

    Member

    <?php if ( (time() - 24*60*60) < strtotime($topic->topic_time) ) : ?>*NEW* <?php endif; ?>

    A very rough way of doing it there, but if you put that in forum.php before say, <?php topic_title(); ?> if you want it in the topic title, it should work. Change 24*60*60 to the number of seconds you want to include topics from.

    @bbisimone

    Member

    Works perfectly as far as I can see!

    Why would you say this is a rough way? Seems very clean to me.

    Cheers Kawauso and gerikg.

    @bbisimone

    Member

    Ok now again it is connected with the last activity in a thread. So when I comment on an older thread it will show *new*.

    Instead I want it connected with the thread opening time?

    @kawauso

    Member

    Apparently topic_time is timezone-shifted, so the previous code is wrong :P told you it was rough! This will take the time from the opening time :)

    <?php if ( (current_time('timestamp') - 24*60*60) < strtotime($topic->topic_start_time) ) : ?>*NEW* <?php endif; ?>

    @bbisimone

    Member

    Works a charm Kawauso :)

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar