Info
- 3 posts
- 2 voices
- Started 3 years ago by csseur3
- Latest reply from _ck_
- This topic is not resolved
Add a "last poster" column in the listing of forums
-
- Posted 3 years ago #
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>
bye
-
- Posted 3 years ago #
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 years ago #
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
topictoforum, ie.forum_time() -
You must log in to post.