/** * Add some header informtaion below the top pagination, like favorites link and subscription link. */ public function add_bbp_header() { ?> <div class="bbp-header fusion-bbp-header"> <div class="bbp-reply-favs"> <?php if (!bbp_show_lead_topic()) { ?> <?php bbp_user_favorites_link(); ?> <?php bbp_user_subscribe_link(); ?> <?php } ?> </div><!-- .bbp-reply-content --> <div class="fusion-clearfix"></div> </div><!-- .bbp-header --> <?php }
?> " class="bbp-forums"> <li class="bbp-header"> <ul class="forum-titles"> <li class="bbp-forum-info"><?php _e('Forum', 'mk_framework'); ?> </li> <li class="bbp-forum-topic-count"><?php _e('Topics', 'mk_framework'); ?> </li> <li class="bbp-forum-reply-count"><?php bbp_show_lead_topic() ? _e('Replies', 'mk_framework') : _e('Posts', 'mk_framework'); ?> </li> <li class="bbp-forum-freshness"><?php _e('Freshness', 'mk_framework'); ?> </li> </ul> </li><!-- .bbp-header --> <li class="bbp-body"> <?php while (bbp_forums()) { bbp_the_forum();
function og_groups_update_num_posts_and_rank_options($args = array()) { // wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php //error_log("og group post count here ".print_r($args,true)); //echo "og here"; $group_id = 0; $og_my_postcount = 0; //error_log("og group post count here"); $group = groups_get_current_group(); //Taken from wp-content/plugins/bbpress/includes/extend/buddypress/groups.php // Not posting from a BuddyPress group? stop now! if (!empty($group)) { $group_id = $group->id; //bp_get_current_group_id(); //$bp->groups->current_group->id; error_log("og group post count id " . $group_id); } else { return $args; } //Taken from wp-content/plugins/bbpress/includes/extend/buddypress/groups.php $my_forum_ids = bbp_get_group_forum_ids($my_group_id); $forum_id = null; // Get the first forum ID if (!empty($my_forum_ids)) { $forum_id = (int) is_array($my_forum_ids) ? $my_forum_ids[0] : $my_forum_ids; $og_my_postcount = bbp_show_lead_topic() ? bbp_get_forum_reply_count($forum_id) : bbp_get_forum_post_count($forum_id); } // Update the group's post count //error_log("og group post count ".$og_my_postcount); groups_update_groupmeta($group_id, 'og_num_posts', $og_my_postcount); // Taken from p-content/plugins/buddypress/bp-groups/bp-groups-forums.php // Update the group's rank, based on its previous rank $og_rank_arg = 'og_rank'; // Get the previous rank $og_prev_grp_rank = groups_get_groupmeta($group_id, $og_rank_arg); //error_log("og group post rank ".empty($og_prev_grp_rank)); // If the rank doesn't exist yet, make it 0 if (empty($og_prev_grp_rank == null)) { $og_prev_grp_rank = 0; } // Update the rank as follows: rank = .7*prev rank + .3*current unix time // groups_update_groupmeta .5*og_rank+.5*lastactivitytimeinunix groups_update_groupmeta($group_id, $og_rank_arg, 0.7 * $og_prev_grp_rank + 0.3 * microtime(true)); return $args; }
?> " class="bbp-topics clearfix"> <li class="bbp-header"> <ul class="forum-titles clearfix"> <li class="bbp-topic-title"> <span><i class='ioa-ti ti-comments '></i> <?php _e('Topic', 'ioa'); ?> </span></li> <li class="bbp-topic-voice-count"><span><?php _e('Voices', 'ioa'); ?> </span></li> <li class="bbp-topic-reply-count"><span><?php bbp_show_lead_topic() ? _e('Replies', 'ioa') : _e('Posts', 'ioa'); ?> </span></li> <li class="bbp-topic-freshness"><span><?php _e('Freshness', 'ioa'); ?> </span></li> </ul> </li> <li class="bbp-body clearfix"> <?php while (bbp_topics()) { bbp_the_topic();
do_action('bbp_theme_after_forum_sub_forums'); ?> <?php bbp_forum_row_actions(); ?> </li> <li class="bbp-forum-topic-count"><?php bbp_forum_topic_count(); ?> </li> <li class="bbp-forum-reply-count"><?php bbp_show_lead_topic() ? bbp_forum_reply_count() : bbp_forum_post_count(); ?> </li> <li class="bbp-forum-freshness"> <?php do_action('bbp_theme_before_forum_freshness_link'); ?> <?php bbp_forum_freshness_link(); ?> <?php do_action('bbp_theme_after_forum_freshness_link');
?> " class="bbp-forums"> <li class="bbp-header"> <ul class="forum-titles"> <li class="bbp-forum-info"><?php _e('Forum', 'bbpress'); ?> </li> <li class="bbp-forum-topic-count"><?php _e('Topics', 'bbpress'); ?> </li> <li class="bbp-forum-reply-count"><?php bbp_show_lead_topic() ? _e('Replies', 'bbpress') : _e('Posts', 'bbpress'); ?> </li> <!--<li class="bbp-forum-freshness"><?php /*_e( 'Freshness', 'bbpress' ); */ ?> </li> --> </ul> </li><!-- .bbp-header --> <li class="bbp-body"> <?php while (bbp_forums()) { bbp_the_forum();
/** * Return the topic pagination count * * @since bbPress (r2519) * * @uses bbp_number_format() To format the number value * @uses bbp_show_lead_topic() Are we showing the topic as a lead? * @uses apply_filters() Calls 'bbp_get_topic_pagination_count' with the * pagination count * @return string Topic pagination count */ function bbp_get_topic_pagination_count() { $bbp = bbpress(); // Define local variable(s) $retstr = ''; // Set pagination values $start_num = intval(($bbp->reply_query->paged - 1) * $bbp->reply_query->posts_per_page) + 1; $from_num = bbp_number_format($start_num); $to_num = bbp_number_format($start_num + ($bbp->reply_query->posts_per_page - 1) > $bbp->reply_query->found_posts ? $bbp->reply_query->found_posts : $start_num + ($bbp->reply_query->posts_per_page - 1)); $total_int = (int) $bbp->reply_query->found_posts; $total = bbp_number_format($total_int); // We are threading replies if (bbp_thread_replies() && bbp_is_single_topic()) { return; $walker = new BBP_Walker_Reply(); $threads = (int) $walker->get_number_of_root_elements($bbp->reply_query->posts); // Adjust for topic $threads--; $retstr = sprintf(_n('Viewing %1$s reply thread', 'Viewing %1$s reply threads', $threads, 'bbbpress'), bbp_number_format($threads)); // We are not including the lead topic } elseif (bbp_show_lead_topic()) { // Several replies in a topic with a single page if (empty($to_num)) { $retstr = sprintf(_n('Viewing %1$s reply', 'Viewing %1$s replies', $total_int, 'bbpress'), $total); // Several replies in a topic with several pages } else { $retstr = sprintf(_n('Viewing %2$s replies (of %4$s total)', 'Viewing %1$s replies - %2$s through %3$s (of %4$s total)', $bbp->reply_query->post_count, 'bbpress'), $bbp->reply_query->post_count, $from_num, $to_num, $total); } // We are including the lead topic } else { // Several posts in a topic with a single page if (empty($to_num)) { $retstr = sprintf(_n('Viewing %1$s post', 'Viewing %1$s posts', $total_int, 'bbpress'), $total); // Several posts in a topic with several pages } else { $retstr = sprintf(_n('Viewing %2$s post (of %4$s total)', 'Viewing %1$s posts - %2$s through %3$s (of %4$s total)', $bbp->reply_query->post_count, 'bbpress'), $bbp->reply_query->post_count, $from_num, $to_num, $total); } } // Filter and return return apply_filters('bbp_get_topic_pagination_count', esc_html($retstr)); }
/** * List subforums or forums * * Must be called within a loop or be assigned an forum id * * @param mixed $args The function supports these args: * - forum_id: Forum id. Defaults to '' * @uses bbp_forum_get_subforums() To check if the forum has subforums or not * @uses bbp_get_forum_permalink() To get forum permalink * @uses bbp_get_forum_title() To get forum title * @uses bbp_is_forum_category() To check if a forum is a category * @uses bbp_get_forum_topic_count() To get forum topic count * @uses bbp_get_forum_reply_count() To get forum reply count * @return void */ function ipt_kb_bbp_list_subforums($args = array()) { $r = bbp_parse_args($args, array('forum_id' => ''), 'ipt_kb_list_forums'); $sub_forums = bbp_forum_get_subforums($r['forum_id']); if (!empty($sub_forums)) { foreach ($sub_forums as $sub_forum) { ?> <li class="<?php if (bbp_is_forum_category($sub_forum->ID)) { echo 'bbp-forum-is-category'; } ?> list-group-item bbp-body ipt_kb_subforum_list"> <?php do_action('bbp_theme_before_forum_sub_forums'); ?> <ul id="bbp-forum-<?php bbp_forum_id($sub_forum->ID); ?> " <?php bbp_forum_class($sub_forum->ID); ?> > <li class="bbp-forum-info"> <span class="pull-left ipt_kb_bbpress_subforum_icon ipt_kb_bbpress_forum_icon"> <?php if (bbp_is_forum_category($sub_forum->ID)) { ?> <span class="glyphicon ipt-icomoon-folder-open"></span> <?php } else { ?> <span class="glyphicon ipt-icomoon-file4"></span> <?php } ?> </span> <?php ipt_kb_bbp_forum_title_in_list($sub_forum->ID); ?> <?php ipt_kb_bbp_forum_description_in_list($sub_forum->ID); ?> <?php bbp_forum_row_actions(); ?> </li> <li class="bbp-forum-topic-count"> <?php bbp_forum_topic_count($sub_forum->ID); ?> </li> <li class="bbp-forum-reply-count"> <?php bbp_show_lead_topic() ? bbp_forum_reply_count($sub_forum->ID) : bbp_forum_post_count($sub_forum->ID); ?> </li> <li class="bbp-forum-freshness"> <?php ipt_kb_bbp_forum_freshness_in_list($sub_forum->ID); ?> </li> </ul> <?php do_action('bbp_theme_after_forum_sub_forums'); ?> <div class="clearfix"></div> </li> <?php } } }
/** * Return the topic pagination count * * @since bbPress (r2519) * * @uses bbp_number_format() To format the number value * @uses bbp_show_lead_topic() Are we showing the topic as a lead? * @uses apply_filters() Calls 'bbp_get_topic_pagination_count' with the * pagination count * @return string Topic pagination count */ function bbp_get_topic_pagination_count() { $bbp = bbpress(); // Define local variable(s) $retstr = ''; // Set pagination values $start_num = intval(($bbp->reply_query->paged - 1) * $bbp->reply_query->posts_per_page) + 1; $from_num = bbp_number_format($start_num); $to_num = bbp_number_format($start_num + ($bbp->reply_query->posts_per_page - 1) > $bbp->reply_query->found_posts ? $bbp->reply_query->found_posts : $start_num + ($bbp->reply_query->posts_per_page - 1)); $total_int = (int) $bbp->reply_query->found_posts; $total = bbp_number_format($total_int); // We are not including the lead topic if (bbp_show_lead_topic()) { // Several replies in a topic with a single page if (empty($to_num)) { $retstr = sprintf(_n('Viewing %1$s reply', 'Viewing %1$s replies', $total_int, 'bbpress'), $total); // Several replies in a topic with several pages } else { $retstr = sprintf(_n('Viewing %2$s replies (of %4$s total)', 'Viewing %1$s replies - %2$s through %3$s (of %4$s total)', $bbp->reply_query->post_count, 'bbpress'), $bbp->reply_query->post_count, $from_num, $to_num, $total); } // We are including the lead topic } else { // Several posts in a topic with a single page if (empty($to_num)) { $retstr = sprintf(_n('Viewing %1$s post', 'Viewing %1$s posts', $total_int, 'bbpress'), $total); // Several posts in a topic with several pages } else { $retstr = sprintf(_n('Viewing %2$s post (of %4$s total)', 'Viewing %1$s posts - %2$s through %3$s (of %4$s total)', $bbp->reply_query->post_count, 'bbpress'), $bbp->reply_query->post_count, $from_num, $to_num, $total); } } // Filter and return return apply_filters('bbp_get_topic_pagination_count', $retstr); }
?> " class="bbp-topics"> <li class="bbp-header"> <ul class="forum-titles"> <li class="bbp-topic-title"><?php esc_html_e('Topic', 'monsoon'); ?> </li> <li class="bbp-topic-voice-count"><?php esc_html_e('Voices', 'monsoon'); ?> </li> <li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? esc_html_e('Replies', 'monsoon') : esc_html_e('Posts', 'monsoon'); ?> </li> <li class="bbp-topic-freshness"><?php esc_html_e('Freshness', 'monsoon'); ?> </li> </ul> </li> <li class="bbp-body"> <?php while (bbp_topics()) { bbp_the_topic();
?> <div id="bbpress-forums"> <?php do_action( 'bbp_template_before_single_topic' ); ?> <?php if ( post_password_required() ) : ?> <?php bbp_get_template_part( 'form', 'protected' ); ?> <?php else : ?> <?php bbp_single_topic_description(); ?> <?php if ( bbp_show_lead_topic() ) : ?> <?php bbp_get_template_part( 'content', 'single-topic-lead' ); ?> <?php endif; ?> <?php if ( bbp_has_replies() ) : ?> <?php bbp_topic_tag_list(); ?> <?php bbp_get_template_part( 'pagination', 'replies' ); ?> <?php bbp_get_template_part( 'loop', 'replies' ); ?> <?php bbp_get_template_part( 'pagination', 'replies' ); ?>
<?php if (bbp_is_forum_category() && !bbp_get_forum_parent_id()) { ?> <div class="section-head gallery-title forum-cat"> <ul class="forum-titles"> <li class="bbp-forum-info"><?php bbp_forum_title(); ?> </li> <li class="normal bbp-forum-topic-count"><?php _ex('Topics', 'bbPress', 'bunyad'); ?> / <?php bbp_show_lead_topic() ? _ex('Replies', 'bbPress', 'bunyad') : _ex('Posts', 'bbPress', 'bunyad'); ?> </li> <li class="normal bbp-forum-freshness"><?php _ex('Freshness', 'bbPress', 'bunyad'); ?> </li> </ul> </div> <?php // get sub-forums $orig_query = clone bbpress()->forum_query; bbp_has_forums(array('post_parent' => bbp_get_forum_id())); while (bbp_forums()) {
function wm_bbp_additional_class($classes) { //Helper variables $voices_count = bbp_get_topic_voice_count(); $replies_count = bbp_show_lead_topic() ? bbp_get_topic_reply_count() : bbp_get_topic_post_count(); if (bbp_get_forum_post_type() == get_post_type()) { $voices_count = bbp_get_forum_topic_count(); $replies_count = bbp_show_lead_topic() ? bbp_get_forum_reply_count() : bbp_get_forum_post_count(); } //Preparing output $classes[] = 1 < $voices_count ? 'multi-voices' : 'single-voice'; $classes[] = 1 < $replies_count ? 'multi-replies' : 'single-reply'; //Output return apply_filters('wmhook_wm_bbp_additional_class_output', $classes); }
/** * [g1_bbp_forums] shortcode callback function. * * @param array $atts * @param string $content * @return string */ function g1_bbp_forums_shortcode($atts, $content) { /* We need a static counter to trace a shortcode without the id attribute */ static $counter = 0; $counter++; extract(shortcode_atts(array('id' => '', 'class' => ''), $atts, 'g1_bbp_forums')); // Compose final HTML id attribute $final_id = strlen($id) ? $id : 'g1-bbp-forums-' . $counter; // Compose final HTML class attribute $final_class = array('g1-bbp-forums'); $final_class = array_merge($final_class, explode(' ', $class)); // Note: private and hidden forums will be excluded via the // bbp_pre_get_posts_normalize_forum_visibility action and function. $query = new WP_Query(array('post_type' => bbp_get_forum_post_type(), 'post_parent' => $settings['parent_forum'], 'post_status' => bbp_get_public_status_id(), 'posts_per_page' => get_option('_bbp_forums_per_page', 50), 'ignore_sticky_posts' => true, 'no_found_rows' => true, 'orderby' => 'menu_order title', 'order' => 'ASC')); if (!$query->have_posts()) { return ''; } // Start output buffer ob_start(); ?> <div class="<?php echo implode(' ', array_map('sanitize_html_class', $final_class)); ?> "> <div class="g1-collection g1-collection--grid g1-collection--one-third g1-collection--simple"> <ul> <?php while ($query->have_posts()) { $query->the_post(); ?> <li class="g1-collection__item"> <article> <?php if (has_post_thumbnail()) { ?> <figure class="entry-featured-media"> <a href="<?php bbp_forum_permalink($query->post->ID); ?> "> <?php the_post_thumbnail('g1_one_third'); ?> </a> </figure> <?php } else { ?> <?php echo do_shortcode('[placeholder icon="camera" size="g1_one_third"]'); ?> <?php } ?> <div class="g1-nonmedia"> <div class="g1-inner"> <header class="entry-header"> <h3 class="entry-title"> <a href="<?php bbp_forum_permalink($query->post->ID); ?> "><?php bbp_forum_title($query->post->ID); ?> </a> </h3> <p class="entry-meta g1-meta"> <span><?php _e('Topics', 'bbpress'); ?> : <?php bbp_forum_topic_count($query->post->ID); ?> </span> <span><?php bbp_show_lead_topic() ? _e('Replies', 'bbpress') : _e('Posts', 'bbpress'); ?> : <?php bbp_show_lead_topic() ? bbp_forum_reply_count($query->post->ID) : bbp_forum_post_count($query->post->ID); ?> </span> </p> </header> <div class="entry-summary"> <?php the_excerpt(); ?> </div> </div> </div> </article> </li> <?php } ?> </ul> </div> </div> <?php // Reset the $post global wp_reset_postdata(); // Return and flush the output buffer return ob_get_clean(); }
?> " class="bbp-topics"> <li class="bbp-header"> <ul class="forum-titles"> <li class="bbp-topic-title"><?php _e('Topic', 'wpdance'); ?> </li> <li class="bbp-topic-voice-count"><?php _e('Voices', 'wpdance'); ?> </li> <li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? _e('Replies', 'wpdance') : _e('Posts', 'wpdance'); ?> </li> <li class="bbp-topic-freshness"><?php _e('Freshness', 'wpdance'); ?> </li> </ul> </li> <li class="bbp-body"> <?php while (bbp_topics()) { bbp_the_topic();
function x_bbpress_add_actions_replies() { ?> <?php if (!bbp_show_lead_topic() && !bbp_is_single_user_replies() && !x_is_buddypress_user()) { ?> <div class="x-bbp-header"> <div class="actions"> <a href="<?php echo bbp_get_forum_permalink(bbp_get_topic_forum_id()); ?> "><?php _e('To Parent Forum', '__x__'); ?> </a> <?php bbp_topic_subscription_link(); ?> <?php bbp_user_favorites_link(); ?> </div> </div> <?php } ?> <?php }
<div class="bbp-forum-freshness pull-right text-muted"> <small> <div class="bbp-forum-topic-count"><span class="badge"><?php bbp_forum_topic_count(); ?> </span> <?php _e('Topics', 'firmasite'); ?> </div> <div class="bbp-forum-reply-count"><span class="badge"><?php bbp_show_lead_topic() ? bbp_forum_reply_count() : bbp_forum_post_count(); ?> </span> <?php bbp_show_lead_topic() ? _e('Replies', 'firmasite') : _e('Posts', 'firmasite'); ?> </div> <div class="clearfix"> <?php do_action('bbp_theme_before_forum_freshness_link'); ?> <?php echo firmasite_social_bbp_get_forum_freshness_link(); ?> <?php do_action('bbp_theme_after_forum_freshness_link'); ?>
<ul id="bbp-forum-<?php bbp_forum_id(); ?> " class="bbp-topics"> <li class="bbp-header"> <ul class="forum-titles"> <li class="bbp-topic-title"><?php esc_html_e('Topic', 'bbpress'); ?> </li> <li class="bbp-topic-voice-count"><?php esc_html_e('Voices', 'bbpress'); ?> </li> <li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? esc_html_e('Replies', 'bbpress') : esc_html_e('Posts', 'bbpress'); ?> </li> <li class="bbp-topic-freshness"><?php esc_html_e('Last Post', 'bbpress'); ?> </li> </ul> </li> <li class="bbp-body"> <?php while (bbp_topics()) { bbp_the_topic(); ?>
/** * Output an RSS2 feed of replies, based on the query passed. * * @since bbPress (r3171) * * @uses bbp_version() * @uses bbp_is_single_topic() * @uses bbp_user_can_view_forum() * @uses bbp_get_topic_forum_id() * @uses bbp_show_load_topic() * @uses bbp_topic_permalink() * @uses bbp_topic_title() * @uses bbp_get_topic_reply_count() * @uses bbp_topic_content() * @uses bbp_has_replies() * @uses bbp_replies() * @uses bbp_the_reply() * @uses bbp_reply_url() * @uses bbp_reply_title() * @uses bbp_reply_content() * @uses get_wp_title_rss() * @uses get_option() * @uses bloginfo_rss * @uses self_link() * @uses the_author() * @uses get_post_time() * @uses rss_enclosure() * @uses do_action() * @uses apply_filters() * * @param array $replies_query */ function bbp_display_replies_feed_rss2($replies_query = array()) { // User cannot access forum this topic is in if (bbp_is_single_topic() && !bbp_user_can_view_forum(array('forum_id' => bbp_get_topic_forum_id()))) { return; } // Adjust the title based on context if (bbp_is_single_topic() && bbp_user_can_view_forum(array('forum_id' => bbp_get_topic_forum_id()))) { $title = apply_filters('wp_title_rss', get_wp_title_rss(' » ')); } elseif (!bbp_show_lead_topic()) { $title = ' » ' . __('All Posts', 'bbpress'); } else { $title = ' » ' . __('All Replies', 'bbpress'); } // Display the feed header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true); header('Status: 200 OK'); echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>'; ?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" <?php do_action('bbp_feed'); ?> > <channel> <title><?php bloginfo_rss('name'); echo $title; ?> </title> <atom:link href="<?php self_link(); ?> " rel="self" type="application/rss+xml" /> <link><?php self_link(); ?> </link> <description><?php // ?> </description> <pubDate><?php echo mysql2date('D, d M Y H:i:s O', current_time('mysql'), false); ?> </pubDate> <generator>http://bbpress.org/?v=<?php bbp_version(); ?> </generator> <language><?php bloginfo_rss('language'); ?> </language> <?php do_action('bbp_feed_head'); ?> <?php if (bbp_is_single_topic()) { ?> <?php if (bbp_user_can_view_forum(array('forum_id' => bbp_get_topic_forum_id()))) { ?> <?php if (bbp_show_lead_topic()) { ?> <item> <guid><?php bbp_topic_permalink(); ?> </guid> <title><![CDATA[<?php bbp_topic_title(); ?> ]]></title> <link><?php bbp_topic_permalink(); ?> </link> <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?> </pubDate> <dc:creator><?php the_author(); ?> </dc:creator> <description> <![CDATA[ <p><?php printf(__('Replies: %s', 'bbpress'), bbp_get_topic_reply_count()); ?> </p> <?php bbp_topic_content(); ?> ]]> </description> <?php rss_enclosure(); ?> <?php do_action('bbp_feed_item'); ?> </item> <?php } ?> <?php } ?> <?php } ?> <?php if (bbp_has_replies($replies_query)) { ?> <?php while (bbp_replies()) { bbp_the_reply(); ?> <item> <guid><?php bbp_reply_url(); ?> </guid> <title><![CDATA[<?php bbp_reply_title(); ?> ]]></title> <link><?php bbp_reply_url(); ?> </link> <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?> </pubDate> <dc:creator><?php the_author(); ?> </dc:creator> <description> <![CDATA[ <?php bbp_reply_content(); ?> ]]> </description> <?php rss_enclosure(); ?> <?php do_action('bbp_feed_item'); ?> </item> <?php } ?> <?php } ?> <?php do_action('bbp_feed_footer'); ?> </channel> </rss> <?php // We're done here exit; }
/** * Returns pagination links of a topic within the topic loop * * @since bbPress (r2966) * * @param mixed $args This function supports these arguments: * - topic_id: Topic id * - before: Before the links * - after: After the links * @uses bbp_get_topic_id() To get the topic id * @uses WP_Rewrite::using_permalinks() To check if the blog is using * permalinks * @uses user_trailingslashit() To add a trailing slash * @uses trailingslashit() To add a trailing slash * @uses get_permalink() To get the permalink of the topic * @uses add_query_arg() To add query args * @uses bbp_get_topic_reply_count() To get topic reply count * @uses bbp_show_topic_lead() Are we showing the topic as a lead? * @uses get_option() To get replies per page option * @uses paginate_links() To paginate the links * @uses apply_filters() Calls 'bbp_get_topic_pagination' with the links * and arguments * @return string Pagination links */ function bbp_get_topic_pagination($args = '') { global $wp_rewrite; $defaults = array('topic_id' => bbp_get_topic_id(), 'before' => '<span class="bbp-topic-pagination">', 'after' => '</span>'); $r = bbp_parse_args($args, $defaults, 'get_topic_pagination'); extract($r); // If pretty permalinks are enabled, make our pagination pretty if ($wp_rewrite->using_permalinks()) { $base = trailingslashit(get_permalink($topic_id)) . user_trailingslashit($wp_rewrite->pagination_base . '/%#%/'); } else { $base = add_query_arg('paged', '%#%', get_permalink($topic_id)); } // Get total and add 1 if topic is included in the reply loop $total = bbp_get_topic_reply_count($topic_id); // Bump if topic is in loop if (!bbp_show_lead_topic()) { $total++; } // Pagination settings $pagination = array('base' => $base, 'format' => '', 'total' => ceil((int) $total / (int) bbp_get_replies_per_page()), 'current' => 0, 'prev_next' => false, 'mid_size' => 2, 'end_size' => 3, 'add_args' => bbp_get_view_all() ? array('view' => 'all') : false); // Add pagination to query object $pagination_links = paginate_links($pagination); if (!empty($pagination_links)) { // Remove first page from pagination if ($wp_rewrite->using_permalinks()) { $pagination_links = str_replace($wp_rewrite->pagination_base . '/1/', '', $pagination_links); } else { $pagination_links = str_replace('&paged=1', '', $pagination_links); } // Add before and after to pagination links $pagination_links = $before . $pagination_links . $after; } return apply_filters('bbp_get_topic_pagination', $pagination_links, $args); }
/** * Returns pagination links of a topic within the topic loop * * @since 2.0.0 bbPress (r2966) * * @param array $args This function supports these arguments: * - topic_id: Topic id * - before: Before the links * - after: After the links * @uses bbp_get_topic_id() To get the topic id * @uses bbp_use_pretty_urls() To check if the site is using pretty URLs * @uses user_trailingslashit() To add a trailing slash * @uses trailingslashit() To add a trailing slash * @uses get_permalink() To get the permalink of the topic * @uses add_query_arg() To add query args * @uses bbp_get_topic_reply_count() To get topic reply count * @uses bbp_show_topic_lead() Are we showing the topic as a lead? * @uses get_option() To get replies per page option * @uses paginate_links() To paginate the links * @uses apply_filters() Calls 'bbp_get_topic_pagination' with the links * and arguments * @return string Pagination links */ function bbp_get_topic_pagination($args = array()) { // Bail if threading replies if (bbp_thread_replies()) { return; } // Parse arguments against default values $r = bbp_parse_args($args, array('topic_id' => bbp_get_topic_id(), 'before' => '<span class="bbp-topic-pagination">', 'after' => '</span>'), 'get_topic_pagination'); // If pretty permalinks are enabled, make our pagination pretty if (bbp_use_pretty_urls()) { $base = trailingslashit(get_permalink($r['topic_id'])) . user_trailingslashit(bbp_get_paged_slug() . '/%#%/'); } else { $base = add_query_arg('paged', '%#%', get_permalink($r['topic_id'])); } // Get total and add 1 if topic is included in the reply loop $total = bbp_get_topic_reply_count($r['topic_id'], true); // Bump if topic is in loop if (!bbp_show_lead_topic()) { $total++; } // Add pagination to query object $pagination_links = paginate_links(array('base' => $base, 'format' => '', 'total' => ceil((int) $total / (int) bbp_get_replies_per_page()), 'current' => 0, 'prev_next' => false, 'mid_size' => 2, 'end_size' => 3, 'add_args' => bbp_get_view_all() ? array('view' => 'all') : false)); if (!empty($pagination_links)) { // Remove first page from pagination if (bbp_use_pretty_urls()) { $pagination_links = str_replace(bbp_get_paged_slug() . '/1/', '', $pagination_links); } else { $pagination_links = str_replace('&paged=1', '', $pagination_links); } // Add before and after to pagination links $pagination_links = $r['before'] . $pagination_links . $r['after']; } return apply_filters('bbp_get_topic_pagination', $pagination_links, $args); }
<?php bbp_topic_row_actions(); ?> <?php do_action('bbp_theme_after_topic_meta'); ?> </li> <li class="topic-activity"> <div class="stat"><span class="number"><?php bbp_topic_voice_count(); ?> </span> <?php _ex('Voices', 'bbPress', 'bunyad'); ?> </div> <div class="stat"><?php echo bbp_show_lead_topic() ? '<span class="number">' . bbp_get_topic_reply_count() . '</span> ' . _x('Replies', 'bbPress', 'bunyad') : '<span class="number">' . bbp_get_topic_post_count() . '</span> ' . _x('Posts', 'bbPress', 'bunyad'); ?> </div> </li> </ul><!-- #bbp-topic-<?php bbp_topic_id(); ?> -->
do_action('bbp_theme_after_topic_meta'); ?> <?php bbp_topic_row_actions(); ?> </li> <li class="bbp-topic-voice-count"><?php bbp_topic_voice_count(); ?> </li> <li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? bbp_topic_reply_count() : bbp_topic_post_count(); ?> </li> <li class="bbp-topic-freshness"> <?php do_action('bbp_theme_before_topic_freshness_link'); ?> <?php bbp_topic_freshness_link(); ?> <?php do_action('bbp_theme_after_topic_freshness_link');
?> " class="bbp-topics table"> <thead class="bbp-header"> <tr class="forum-titles"> <th class="bbp-topic-title"><?php _e('Topic', 'omega-td'); ?> </th> <th class="bbp-topic-voice-count"><?php _e('Voices', 'omega-td'); ?> </th> <th class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? _e('Replies', 'omega-td') : _e('Posts', 'omega-td'); ?> </th> <th class="bbp-topic-freshness"><?php _e('Freshness', 'omega-td'); ?> </th> </tr> </thead> <tbody class="bbp-body"> <?php while (bbp_topics()) { bbp_the_topic();
?> <?php if (post_password_required()) { ?> <?php bbp_get_template_part('form', 'protected'); ?> <?php } else { ?> <?php if (bbp_show_lead_topic()) { ?> <?php bbp_get_template_part('content', 'single-topic-lead'); ?> <?php } ?> <?php if (bbp_has_replies()) { ?> <?php
<?php bbp_forum_row_actions(); ?> </li> <li class="bbp-forum-topic-count"> <div><span class="number"><?php bbp_forum_topic_count(); ?> </span> <?php _ex('topics', 'bbpress', 'bunyad'); ?> </div> <div><?php echo bbp_show_lead_topic() ? '<span class="number">' . bbp_get_forum_reply_count() . '</span> ' . _x('replies', 'bbpress', 'bunyad') : '<span class="number">' . bbp_get_forum_post_count() . '</span> ' . _x('posts', 'bbpress', 'bunyad'); ?> </li> <li class="bbp-forum-freshness"> <p class="bbp-topic-meta"> <?php do_action('bbp_theme_before_topic_author'); ?> <span class="bbp-topic-freshness-author"> <?php