Advertisement
Guest User

Custom last_poster_block bbPress

a guest
Jul 17th, 2012
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.80 KB | None | 0 0
  1.     /** Last poster / freshness block for forums */
  2.     public function custom_last_poster_block( $subforum_id = "" ) {
  3.         echo BBP_Default::custom_get_last_poster_block( $subforum_id = "" );
  4.     }
  5.    
  6.         public function custom_get_last_poster_block( $subforum_id = "" ) {
  7.                    
  8.             if ( !empty( $subforum_id ) ) {
  9.                 // Main forum display with sub forums
  10.                 $output = "<div class='last-posted-topic-title'>";
  11.                 $output .= "<a href='". bbp_get_forum_last_topic_permalink( $subforum_id ) ."'>" . bbp_get_topic_last_reply_title( bbp_get_forum_last_active_id( $subforum_id ) ) . "</a>";
  12.                 $output .= "</div>";
  13.                 $output .= "<div class='last-posted-topic-user'>by ";
  14.                     $author_id = bbp_get_forum_last_reply_author_id( $subforum_id );
  15.                 $output .= "<span class=\"bbp-author-avatar\">" . get_avatar( $author_id, '14' ) . "&nbsp;</span>";
  16.                 $output .= bbp_get_user_profile_link( $author_id );
  17.                 $output .= "</div>";
  18.                 $output .= "<div class='last-posted-topic-time'>";
  19.                 $output .= bbp_get_forum_last_active_time( $subforum_id );
  20.                 $output .= "</div>";
  21.             } else {
  22.                 // forum category display (no sub forums list)
  23.                 $output = "<div class='last-posted-topic-title'>";
  24.                 $output .= "<a href='". bbp_get_forum_last_topic_permalink() ."'>" . bbp_get_topic_last_reply_title( bbp_get_forum_last_active_id() ) . "</a>";
  25.                 $output .= "</div>";
  26.                 $output .= "<div class='last-posted-topic-user'>by ";
  27.                 $output .= "<span class=\"bbp-author-avatar\">" . get_avatar( bbp_get_forum_last_reply_author_id(), '14' ) . "&nbsp;</span>";
  28.                 $output .= bbp_get_user_profile_link( bbp_get_forum_last_reply_author_id() );
  29.                 $output .= "</div>";
  30.                 $output .= "<div class='last-posted-topic-time'>";
  31.                 $output .= bbp_get_forum_last_active_time();
  32.                 $output .= "</div>";
  33.             }
  34.            
  35.             return $output;
  36.        
  37.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement