Пример #1
0
 /**
  * @covers ::bbp_forum_last_reply_author_id
  * @covers ::bbp_get_forum_last_reply_author_id
  */
 public function test_bbp_get_forum_last_reply_author_id()
 {
     $u = $this->factory->user->create();
     $c = $this->factory->forum->create(array('forum_meta' => array('forum_type' => 'category', 'status' => 'open')));
     $f = $this->factory->forum->create(array('post_author' => $u, 'post_parent' => $c, 'forum_meta' => array('forum_id' => $c, 'forum_type' => 'forum', 'status' => 'open')));
     $t = $this->factory->topic->create(array('post_parent' => $f, 'post_author' => $u, 'topic_meta' => array('forum_id' => $f)));
     $r = $this->factory->reply->create(array('post_parent' => $t, 'post_author' => $u, 'reply_meta' => array('forum_id' => $f, 'topic_id' => $t)));
     // Get the forums last reply author id.
     $forum = bbp_get_forum_last_reply_author_id($f);
     $this->assertSame($u, $forum);
     // Get the categories last reply author id.
     $category = bbp_get_forum_last_reply_author_id($c);
     $this->assertSame($u, $category);
 }
Пример #2
0
</a></h3>
				<p class="forum-description"><?php 
    bbp_forum_content();
    ?>
</p>
			</div>

			<div class="forum-count">
				<?php 
    bbp_forum_topic_count();
    ?>
			</div>

			<div class="forum-freshness">
				<?php 
    echo apoc_get_avatar(array('user_id' => bbp_get_forum_last_reply_author_id(), 'link' => true, 'size' => 50));
    ?>
				<div class="freshest-meta">
					<a class="freshest-title" href="<?php 
    echo $link;
    ?>
" title=""><?php 
    bbp_forum_last_topic_title();
    ?>
</a>
					<span class="freshest-author">By <?php 
    bbp_author_link(array('post_id' => bbp_get_forum_last_topic_id(), 'type' => 'name'));
    ?>
</span>
					<span class="freshest-time"><?php 
    bbp_topic_last_active_time(bbp_get_forum_last_topic_id());
Пример #3
0
		<div class="last-posted-topic-title">
			<a href="<?php 
echo bbp_get_forum_last_topic_permalink();
?>
"><?php 
echo bbp_get_topic_last_reply_title(bbp_get_forum_last_active_id());
?>
</a>
		</div>
		<div class="last-posted-topic-user">av 
		<span class="bbp-author-avatar"><?php 
echo get_avatar(bbp_get_forum_last_reply_author_id(), '14');
?>
 </span>
			<?php 
echo bbp_get_user_profile_link(bbp_get_forum_last_reply_author_id());
?>
		</div>
		<div class="last-posted-topic-time">
			<?php 
echo bbp_get_forum_last_active_time();
?>
		</div>
	</li>
    
    </div>
    
		<?php 
do_action('bbp_theme_before_forum_sub_forums');
?>
Пример #4
0
/**
 * Return link to author of last reply of forum
 *
 * @since bbPress (r2625)
 *
 * @param int $forum_id Optional. Forum id
 * @uses bbp_get_forum_id() To get the forum id
 * @uses bbp_get_forum_last_reply_author_id() To get the forum's last
 *                                             reply's author id
 * @uses bbp_get_user_profile_link() To get the reply's author's profile
 *                                    link
 * @uses apply_filters() Calls 'bbp_get_forum_last_reply_author_link'
 *                        with the author link and forum id
 * @return string Link to author of last reply of forum
 */
function bbp_get_forum_last_reply_author_link($forum_id = 0)
{
    $forum_id = bbp_get_forum_id($forum_id);
    $author_id = bbp_get_forum_last_reply_author_id($forum_id);
    $author_link = bbp_get_user_profile_link($author_id);
    return apply_filters('bbp_get_forum_last_reply_author_link', $author_link, $forum_id);
}
Пример #5
0
 public function epicwebs_get_last_poster_block($subforum_id = "")
 {
     if (!empty($subforum_id)) {
         // Main forum display with sub forums
         $output = "<div class='last-posted-topic-title'>";
         $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>";
         $output .= "</div>";
         $output .= "<div class='last-posted-topic-user'>av ";
         $author_id = bbp_get_forum_last_reply_author_id($subforum_id);
         $output .= "<span class=\"bbp-author-avatar\">" . get_avatar($author_id, '14') . "&nbsp;</span>";
         $output .= bbp_get_user_profile_link($author_id);
         $output .= "</div>";
         $output .= "<div class='last-posted-topic-time'>";
         $output .= bbp_get_forum_last_active_time($subforum_id);
         $output .= "</div>";
     } else {
         // forum category display (no sub forums list)
         $output = "<div class='last-posted-topic-title'>";
         $output .= "<a href='" . bbp_get_forum_last_topic_permalink() . "'>" . bbp_get_topic_last_reply_title(bbp_get_forum_last_active_id()) . "</a>";
         $output .= "</div>";
         $output .= "<div class='last-posted-topic-user'>av ";
         $output .= "<span class=\"bbp-author-avatar\">" . get_avatar(bbp_get_forum_last_reply_author_id(), '14') . "&nbsp;</span>";
         $output .= bbp_get_user_profile_link(bbp_get_forum_last_reply_author_id());
         $output .= "</div>";
         $output .= "<div class='last-posted-topic-time'>";
         $output .= bbp_get_forum_last_active_time();
         $output .= "</div>";
     }
     return $output;
 }