bbPress

Simple, Fast, Elegant

bbPress support forums » Plugins

Plugin: Recent Posts (kinda like the "edit comments" in WP)

(7 posts)
  • Started 1 year ago by _ck_
  • Latest reply from fel64
  • This topic is not resolved
  1. This is so simple I bet I am duplicating what someone else has already done. I am not sure why this isn't in bbPress by default and it doesn't even begin to address what I would consider basic moderation tools but it's a start.

    Install and check under "content" submenu. Why the posts menu =deleted posts in bbpress's default I have no clue.

    <?php
    /*
    Plugin Name: bbPress Recent Posts
    Plugin URI: http://bbpress.org/plugins/
    Description:  shows most recent posts with (extremely limited) moderation options
    Author: _ck_
    Author URI: http://CKon.wordpress.com
    Version: 0.01
    */
    
    function recent_posts_admin_page() {
    	if ( !bb_current_user_can('browse_deleted') ) {die(__("Now how'd you get here?  And what did you think you'd being doing?"));}
    	global $bbdb, $bb_posts, $bb_post, $page;
    	$bb_posts=get_latest_posts(0,$page);
    	$total = bb_count_last_query();
    ?>
    <h2>Recent Posts</h2>
    <ol id="the-list">
    <? bb_admin_list_posts();  ?>
    </ol>
    <?php echo get_page_number_links( $page, $total );
    }
    
    function recent_posts_admin_menu() {
    	global $bb_submenu;
    	$bb_submenu['content.php'][] = array(__('Recent Posts'), 'use_keys', 'recent_posts_admin_page');
    }
    add_action( 'bb_admin_menu_generator', 'recent_posts_admin_menu' );
    Posted 1 year ago #
  2. Beauty! Thanks!

    Trent

    Posted 1 year ago #
  3. is there a way to tweak this so you can simply list the latest posters on the front page (as username/profile link)?

    Posted 1 year ago #
  4. outchy, this plugin is for a completely different purpose.

    You already have the latest posters on the front page, if you want to turn their names into profile links you need to do something like this in your front-page.php

    <td class="num"><a href="<? user_profile_link( get_post_author_id( ) ); ?>"><?php topic_last_poster(); ?></a></td>

    (untested)

    Note because of the way user data is not cached on the front page, this will cause several extra queries per topic listed and probably not a good idea for very busy forums.

    Posted 1 year ago #
  5. ok i'll stay away from that then, thanks.

    Posted 1 year ago #
  6. Actually, I just realized there is a cheat way to do zero extra mysql queries and link to the profile.

    <td class="num"><a href="/forums/profile.php?id=<? echo $topic->topic_last_poster; ?>"><?php topic_last_poster(); ?></a></td>

    untested but should work in theory

    This will just use the stored last posted id # instead of forcing bbpress to lookup all their meta data and profile link in the database.

    If your forum uses permalinks, it will just rewrite the url on display.

    Posted 1 year ago #
  7. What would bb be looking up? It knows the link type and it already has $topic->topic_last_poster_name as well as $topic->topic_last_poster.

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.