bbPress

Simple, Fast, Elegant

bbPress support forums » Themes

Add a "last poster" column in the listing of forums

(3 posts)
  • Started 4 months ago by csseur3
  • Latest reply from _ck_
  • This topic is not resolved

Tags:

  1. csseur3
    Member

    Hello, i try this in front-page.php:

    <tr<?php bb_forum_class(); ?>>
    <td><?php bb_forum_pad( '<div class="nest">' ); ?>"><?php forum_name(); ?><small><?php forum_description(); ?></small><?php bb_forum_pad( '</div>' ); ?></td>
    <td class="num"><?php forum_topics(); ?></td>
    <td class="num"><?php forum_posts(); ?></td>
    <td class="num"><?php topic_last_poster(); ?>, il y a "><?php topic_time(); ?></td>
    </tr>

    but the "><?php topic_time(); ?> show me all time the date of the first post, in all the forum themes ... Why?

    bye

    Posted 4 months ago #
  2. topic_time is meant to be used in topic loop, not a forum loop so it doesn't know the last topic id.

    You could get around this by passing the last topic id in the topic_time however you'd have to do a custom query to determine the last topic in a forum, as it's not stored/available by default.

    I think I'm going to make this into a plugin "forum_last_poster"

    update: I seem to have finally made it work!

    Posted 3 months ago #
  3. I've now made this into a full plugin:
    http://bbpress.org/plugins/topic/forum-last-poster/

    Once you install it, you'll be able to use your code above, but change the part of the function that says topic to forum, ie. forum_time()

    Posted 3 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.