function bphelp_pbpp_redirect()
{
    global $bp;
    //IMPORTANT: Do not alter the following line.
    $bphelp_my_redirect_slug = get_option('bphelp-my-redirect-slug', 'register');
    if (bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bbp_is_single_forum() || bbp_is_single_topic() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_members_component() || bp_is_profile_component()) {
        if (!is_user_logged_in()) {
            bp_core_redirect(get_option('home') . '/' . $bphelp_my_redirect_slug);
        }
    }
}
function logged_out_redirect()
{
    global $bp;
    // BuddyPress components to lock
    if (bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_page(BP_MEMBERS_SLUG) || bp_is_profile_component()) {
        // Check if user is logged out
        if (!is_user_logged_in()) {
            // Check if a page was selected for redirection
            if (of_get_option('redirect')) {
                $redirect_page = get_permalink(of_get_option('redirect'));
                // If not redirect to login page
            } else {
                $redirect_page = site_url('/wp-login.php');
            }
            wp_redirect($redirect_page);
            exit;
        }
    }
}
/**
 * Initiate the loop for a single topic's posts.
 *
 * @param array $args {
 *     Arguments for limiting the contents of the topic posts loop.
 *     @type int $topic_id ID of the topic to which the posts belong.
 *     @type int $per_page Number of items to return per page. Default: 15.
 *     @type int $max Max items to return. Default: false.
 *     @type string $order 'ASC' or 'DESC'.
 * }
 * @return bool True when posts are found corresponding to the args,
 *         otherwise false.
 */
function bp_has_forum_topic_posts( $args = '' ) {
	global $topic_template;

	$defaults = array(
		'topic_id' => false,
		'per_page' => 15,
		'max'      => false,
		'order'    => 'ASC'
	);

	$r = bp_parse_args( $args, $defaults, 'has_forum_topic_posts' );
	extract( $r, EXTR_SKIP );

	if ( empty( $topic_id ) && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_action_variable( 1 ) )
		$topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 1 ) );
	elseif ( empty( $topic_id ) && bp_is_forums_component() && bp_is_current_action( 'topic' ) && bp_action_variable( 0 ) )
		$topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 0 ) );

	if ( empty( $topic_id ) ) {
		return false;

	} else {
		$topic_template = new BP_Forums_Template_Topic( (int) $topic_id, $per_page, $max, $order );

		// Current topic forum_id needs to match current_group forum_id
		if ( bp_is_groups_component() && $topic_template->forum_id != groups_get_groupmeta( bp_get_current_group_id(), 'forum_id' ) )
			return false;
	}

	/**
	 * Filters whether or not there are topics to display.
	 *
	 * @since BuddyPress (1.1.0)
	 *
	 * @param bool                     $value          Whether or not there are topics.
	 * @param BP_Forums_Template_Topic $topic_template Topic template global to use when rendering.
	 */
	return apply_filters( 'bp_has_topic_posts', $topic_template->has_posts(), $topic_template );
}
/**
 * Is this a user's forums page?
 *
 * @package BuddyPress
 *
 * @return bool
 */
function bp_is_user_forums()
{
    if (bp_is_user() && bp_is_forums_component()) {
        return true;
    }
    return false;
}
 /**
  * Are we looking at something that needs old forum theme compatibility?
  *
  * @since 1.7.0
  */
 public function is_legacy_forum()
 {
     // Bail if not looking at a group.
     if (!bp_is_forums_component()) {
         return;
     }
     // Forum Directory.
     if ((!bp_current_action() || 'tag' == bp_current_action() && bp_action_variables()) && !bp_current_item()) {
         if (!bp_forums_has_directory()) {
             return false;
         }
         if (!bp_forums_is_installed_correctly()) {
             bp_core_add_message(__('The forums component has not been set up yet.', 'buddypress'), 'error');
             bp_core_redirect(bp_get_root_domain());
         }
         bp_update_is_directory(true, 'forums');
         do_action('bp_forums_directory_forums_setup');
         add_action('bp_template_include_reset_dummy_post_data', array($this, 'directory_dummy_post'));
         add_filter('bp_replace_the_content', array($this, 'directory_content'));
     }
 }
 /**
  * Set up the title for pages and the <title> element.
  */
 public function setup_title()
 {
     $bp = buddypress();
     // Adjust title based on view
     if (bp_is_forums_component()) {
         if (bp_is_my_profile()) {
             $bp->bp_options_title = __('Forums', 'buddypress');
         } else {
             $bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddypress'), bp_get_displayed_user_fullname())));
             $bp->bp_options_title = bp_get_displayed_user_fullname();
         }
     }
     parent::setup_title();
 }
    /**
     * header: add the buddypress dropdown navigation to the menu
     *
     * located: header.php do_action( 'bp_menu' )
     *
     * @package Custom Community
     * @since 1.8.3
     */
    function bp_menu()
    {
        global $cap;
        if (!defined('BP_VERSION')) {
            if ($cap->menue_disable_home == true) {
                ?>
				<ul>
					<li id="nav-home"<?php 
                if (is_home()) {
                    ?>
 class="span2 current-menu-item"<?php 
                }
                ?>
>
						<a href="<?php 
                echo home_url();
                ?>
" title="<?php 
                _e('Home', 'cc');
                ?>
"><?php 
                _e('Home', 'cc');
                ?>
</a>
					</li>
				</ul>
			<?php 
            }
            ?>
		<?php 
        } else {
            ?>
			<ul>
			<?php 
            if ($cap->menue_disable_home == true) {
                ?>
				<li id="nav-home"<?php 
                if (is_front_page()) {
                    ?>
 class="span2 current-menu-item"<?php 
                }
                ?>
>
					<a href="<?php 
                echo home_url();
                ?>
" title="<?php 
                _e('Home', 'cc');
                ?>
"><?php 
                _e('Home', 'cc');
                ?>
</a>
				</li>
			<?php 
            }
            ?>
				<?php 
            if ($cap->menue_enable_community == true) {
                ?>
                                <li id="nav-community"<?php 
                if (bp_is_activity_component() || (bp_is_members_component() || bp_is_user()) || (bp_is_groups_component() || bp_is_group()) || bp_is_forums_component() || bp_is_blogs_component()) {
                    ?>
 class="span2 page_item current-menu-item"<?php 
                }
                ?>
>
					<a href="<?php 
                echo site_url();
                ?>
/<?php 
                echo BP_ACTIVITY_SLUG;
                ?>
/" title="<?php 
                _e('Community', 'cc');
                ?>
"><?php 
                _e('Community', 'cc');
                ?>
</a>
					<ul class="children">
						<?php 
                if ('activity' != bp_dtheme_page_on_front() && bp_is_active('activity')) {
                    ?>
							<li<?php 
                    if (bp_is_activity_component()) {
                        ?>
 class="selected"<?php 
                    }
                    ?>
>
								<a href="<?php 
                    echo site_url();
                    ?>
/<?php 
                    echo BP_ACTIVITY_SLUG;
                    ?>
/" title="<?php 
                    _e('Activity', 'cc');
                    ?>
"><?php 
                    _e('Activity', 'cc');
                    ?>
</a>
							</li>
						<?php 
                }
                ?>

						<li<?php 
                if (bp_is_members_component() || bp_is_user()) {
                    ?>
 class="selected"<?php 
                }
                ?>
>
							<a href="<?php 
                echo site_url();
                ?>
/<?php 
                echo BP_MEMBERS_SLUG;
                ?>
/" title="<?php 
                _e('Members', 'cc');
                ?>
"><?php 
                _e('Members', 'cc');
                ?>
</a>
						</li>

						<?php 
                if (bp_is_active('groups')) {
                    ?>
							<li<?php 
                    if (bp_is_groups_component() || bp_is_group()) {
                        ?>
 class="selected"<?php 
                    }
                    ?>
>
								<a href="<?php 
                    echo site_url();
                    ?>
/<?php 
                    echo BP_GROUPS_SLUG;
                    ?>
/" title="<?php 
                    _e('Groups', 'cc');
                    ?>
"><?php 
                    _e('Groups', 'cc');
                    ?>
</a>
							</li>
							<?php 
                    if (bp_is_active('forums') && (function_exists('bp_forums_is_installed_correctly') && !(int) bp_get_option('bp-disable-forum-directory')) && bp_forums_is_installed_correctly()) {
                        ?>
								<li<?php 
                        if (bp_is_forums_component()) {
                            ?>
 class="selected"<?php 
                        }
                        ?>
>
									<a href="<?php 
                        echo site_url();
                        ?>
/<?php 
                        echo BP_FORUMS_SLUG;
                        ?>
/" title="<?php 
                        _e('Forums', 'cc');
                        ?>
"><?php 
                        _e('Forums', 'cc');
                        ?>
</a>
								</li>
							<?php 
                    }
                    ?>
						<?php 
                }
                ?>

						<?php 
                if (bp_is_active('blogs') && is_multisite()) {
                    ?>
							<li<?php 
                    if (bp_is_blogs_component()) {
                        ?>
 class="selected"<?php 
                    }
                    ?>
>
								<a href="<?php 
                    echo site_url();
                    ?>
/<?php 
                    echo BP_BLOGS_SLUG;
                    ?>
/" title="<?php 
                    _e('Blogs', 'cc');
                    ?>
"><?php 
                    _e('Blogs', 'cc');
                    ?>
</a>
							</li>
						<?php 
                }
                ?>
					</ul>
				</li>
        		<?php 
                do_action('bp_nav_items');
                ?>
        		<?php 
            }
            ?>
			</ul>
		<?php 
        }
    }
/**
 * Initiate the loop for a single topic's posts.
 *
 * @param array $args {
 *     Arguments for limiting the contents of the topic posts loop.
 *     @type int $topic_id ID of the topic to which the posts belong.
 *     @type int $per_page Number of items to return per page. Default: 15.
 *     @type int $max Max items to return. Default: false.
 *     @type string $order 'ASC' or 'DESC'.
 * }
 * @return bool True when posts are found corresponding to the args,
 *         otherwise false.
 */
function bp_has_forum_topic_posts($args = '')
{
    global $topic_template;
    $defaults = array('topic_id' => false, 'per_page' => 15, 'max' => false, 'order' => 'ASC');
    $r = bp_parse_args($args, $defaults, 'has_forum_topic_posts');
    extract($r, EXTR_SKIP);
    if (empty($topic_id) && bp_is_groups_component() && bp_is_current_action('forum') && bp_is_action_variable('topic', 0) && bp_action_variable(1)) {
        $topic_id = bp_forums_get_topic_id_from_slug(bp_action_variable(1));
    } elseif (empty($topic_id) && bp_is_forums_component() && bp_is_current_action('topic') && bp_action_variable(0)) {
        $topic_id = bp_forums_get_topic_id_from_slug(bp_action_variable(0));
    }
    if (empty($topic_id)) {
        return false;
    } else {
        $topic_template = new BP_Forums_Template_Topic((int) $topic_id, $per_page, $max, $order);
        // Current topic forum_id needs to match current_group forum_id
        if (bp_is_groups_component() && $topic_template->forum_id != groups_get_groupmeta(bp_get_current_group_id(), 'forum_id')) {
            return false;
        }
    }
    return apply_filters('bp_has_topic_posts', $topic_template->has_posts(), $topic_template);
}
function bp_forums_screen_single_topic()
{
    global $bp;
    if (!bp_is_forums_component() || !bp_is_current_action('topic') || !bp_action_variable(0)) {
        return false;
    }
    do_action('bp_forums_screen_single_topic');
    bp_core_load_template(apply_filters('bp_forums_screen_single_topic', 'forums/single/topic'));
}
Example #10
0
/**
 * Output custom bbPress admin links
 * @version 2.0
 */
function apoc_reply_admin_links($reply_id)
{
    // Make sure it's a logged-in user
    if (!is_user_logged_in()) {
        return false;
    }
    // Get post id and setup desired links
    $links = array();
    // Add common quote and reply links except on forum profiles
    if (!bp_is_forums_component()) {
        $links['quote'] = apoc_quote_button('reply', $reply_id);
        $links['reply'] = '<a class="scroll-respond button button-dark" href="#new-post" title="Quick Reply"><i class="fa fa-reply"></i>Reply</a>';
    }
    // Topic admin links
    if (bbp_is_topic($reply_id)) {
        $links['edit'] = bbp_get_topic_edit_link(array('id' => $reply_id, 'edit_text' => '<i class="fa fa-pencil"></i>Edit'));
        $links['close'] = bbp_get_topic_close_link(array('id' => $reply_id, 'close_text' => '<i class="fa fa-lock"></i>Close', 'open_text' => '<i class="fa fa-unlock"></i>Open'));
        $links['stick'] = bbp_get_topic_stick_link(array('id' => $reply_id, 'stick_text' => '<i class="fa fa-thumb-tack"></i>Stick', 'unstick_text' => '<i class="fa fa-level-down"></i>Unstick', 'super_text' => '<i class="fa fa-paperclip"></i>Notice'));
        $links['merge'] = bbp_get_topic_merge_link(array('merge_text' => '<i class="fa fa-code-fork"></i>Merge'));
        $links['trash'] = bbp_get_topic_trash_link(array('id' => $reply_id, 'trash_text' => '<i class="fa fa-trash"></i>Trash', 'restore_text' => '<i class="fa fa-undo"></i>Restore', 'delete_text' => '<i class="fa fa-remove"></i>Delete', 'sep' => ''));
        // Reply admin links
    } else {
        $links['edit'] = bbp_get_reply_edit_link(array('id' => $reply_id, 'edit_text' => '<i class="fa fa-pencil"></i>Edit'));
        $links['move'] = bbp_get_reply_move_link(array('id' => $reply_id, 'split_text' => '<i class="fa fa-arrows"></i>Move'));
        $links['split'] = bbp_get_topic_split_link(array('id' => $reply_id, 'split_text' => '<i class="fa fa-code-fork"></i>Split'));
        $links['trash'] = bbp_get_reply_trash_link(array('id' => $reply_id, 'trash_text' => '<i class="fa fa-trash"></i>Trash', 'restore_text' => '<i class="fa fa-undo"></i>Restore', 'delete_text' => '<i class="fa fa-remove"></i>Delete', 'sep' => ''));
    }
    // Get the admin links!
    bbp_reply_admin_links(array('id' => $reply_id, 'before' => '', 'after' => '', 'sep' => '', 'links' => $links));
}
Example #11
0
		<?php 
locate_template(array('members/single/member-header.php'), true);
?>
	

		<div id="profile-body">
			<?php 
do_action('template_notices');
?>
		<?php 
if (bp_is_user_profile()) {
    locate_template(array('members/single/profile.php'), true);
} elseif (bp_is_user_activity()) {
    locate_template(array('members/single/activity.php'), true);
} elseif (bp_is_forums_component()) {
    locate_template(array('members/single/forums.php'), true);
} elseif (bp_is_user_friends()) {
    locate_template(array('members/single/friends.php'), true);
} elseif (bp_is_user_groups()) {
    locate_template(array('members/single/groups.php'), true);
} elseif (bp_is_user_messages()) {
    locate_template(array('members/single/messages.php'), true);
} elseif (bp_is_user_settings()) {
    locate_template(array('members/single/settings.php'), true);
} elseif (bp_is_user_notifications()) {
    locate_template(array('members/single/notifications.php'), true);
} else {
    locate_template(array('members/single/plugins.php'), true);
}
?>
Example #12
0
    ?>
" tabindex="100" />

	        </form>

			<?php 
    do_action('bp_after_sidebar_login_form');
    ?>

		<?php 
}
?>

		<?php 
/* Show forum tags on the forums directory */
if (bp_is_active('forums') && function_exists('bp_forums_tag_heat_map') && bp_is_forums_component() && bp_is_directory()) {
    ?>
			<div id="forum-directory-tags" class="widget tags">
				<h3 class="widgettitle"><?php 
    _e('Forum Topic Tags', 'bp-magic');
    ?>
</h3>
				<div id="tag-text"><?php 
    bp_forums_tag_heat_map();
    ?>
</div>
			</div>
		<?php 
}
?>
Example #13
0
    ?>
" tabindex="100" />
			<input type="hidden" name="testcookie" value="1" />
		</form>

		<?php 
    do_action('bp_after_sidebar_login_form');
    ?>

	<?php 
}
?>

	<?php 
/* Show forum tags on the forums directory */
if (bp_is_forums_component() && bp_is_directory()) {
    ?>
		<div id="forum-directory-tags" class="widget tags">

			<h3 class="widgettitle"><?php 
    _e('Forum Topic Tags', 'buddypress');
    ?>
</h3>
			<?php 
    if (function_exists('bp_forums_tag_heat_map')) {
        ?>
				<div id="tag-text"><?php 
        bp_forums_tag_heat_map();
        ?>
</div>
			<?php 
Example #14
0
/**
 * Show sidebars based on page type (including BP components)
 *
 * @package Infinity
 * @subpackage base
 */
function infinity_base_sidebars()
{
    if (!current_theme_supports('infinity-sidebar-setup')) {
        return;
    }
    if (is_page()) {
        if (function_exists('bp_is_user') && bp_is_user() || function_exists('bp_is_members_component') && bp_is_members_component()) {
            if (is_active_sidebar('member-sidebar')) {
                dynamic_sidebar('member-sidebar');
            } elseif (current_user_can('edit_theme_options')) {
                ?>
				<div class="widget">
					<h4>BP Member Sidebar.</h4>
					<a href="<?php 
                echo home_url('/');
                ?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
				</div><?php 
            }
        } elseif (function_exists('bp_is_user') && !bp_is_user() && function_exists('bp_is_groups_component') && bp_is_groups_component()) {
            if (is_active_sidebar('groups-sidebar')) {
                dynamic_sidebar('groups-sidebar');
            } elseif (current_user_can('edit_theme_options')) {
                ?>
				<div class="widget">
					<h4>BP Group Sidebar.</h4>
					<a href="<?php 
                echo home_url('/');
                ?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
				</div><?php 
            }
        } elseif (function_exists('bp_is_user') && !bp_is_user() && function_exists('bp_is_forums_component') && bp_is_forums_component()) {
            if (is_active_sidebar('forums-sidebar')) {
                dynamic_sidebar('forums-sidebar');
            } elseif (current_user_can('edit_theme_options')) {
                ?>
				<div class="widget">
					<h4>BP Forums Sidebar.</h4>
					<a href="<?php 
                echo home_url('/');
                ?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
				</div><?php 
            }
        } elseif (function_exists('bp_is_user') && !bp_is_user() && function_exists('bp_is_blogs_component') && bp_is_blogs_component()) {
            if (is_active_sidebar('blogs-sidebar')) {
                dynamic_sidebar('blogs-sidebar');
            } elseif (current_user_can('edit_theme_options')) {
                ?>
				<div class="widget">
					<h4>BP Blogs Sidebar.</h4>
					<a href="<?php 
                echo home_url('/');
                ?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
				</div><?php 
            }
        } elseif (function_exists('bp_is_user') && !bp_is_user() && function_exists('bp_is_activity_component') && bp_is_activity_component()) {
            if (is_active_sidebar('activity-sidebar')) {
                dynamic_sidebar('activity-sidebar');
            } elseif (current_user_can('edit_theme_options')) {
                ?>
				<div class="widget">
					<h4>Activity Sidebar</h4>
					<a href="<?php 
                echo home_url('/');
                ?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
				</div><?php 
            }
        } elseif (is_front_page()) {
            if (is_active_sidebar('home-sidebar')) {
                dynamic_sidebar('home-sidebar');
            } elseif (current_user_can('edit_theme_options')) {
                ?>
				<div class="widget">
					<h4>Home Sidebar.</h4>
					<a href="<?php 
                echo home_url('/');
                ?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
				</div><?php 
            }
        } else {
            if (is_active_sidebar('page-sidebar')) {
                dynamic_sidebar('page-sidebar');
            } elseif (current_user_can('edit_theme_options')) {
                ?>
				<div class="widget">
					<h4>Page Sidebar.</h4>
					<a href="<?php 
                echo home_url('/');
                ?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
				</div><?php 
            }
        }
    } else {
        if (is_active_sidebar('blog-sidebar')) {
            dynamic_sidebar('blog-sidebar');
        } elseif (current_user_can('edit_theme_options')) {
            ?>
			<div class="widget">
				<h4>Blog Sidebar.</h4>
				<a href="<?php 
            echo home_url('/');
            ?>
nxt-admin/widgets.php" title="Add Widgets">Add Widgets</a>
			</div><?php 
        }
    }
}
Example #15
0
        _e('Groups', 'framemarket');
        ?>
"><?php 
        _e('Groups', 'framemarket');
        ?>
</a>
										</li>
									<?php 
    }
    ?>

									<?php 
    if (bp_is_active('forums') && bp_is_active('groups') && (function_exists('bp_forums_is_installed_correctly') && !(int) bp_get_option('bp-disable-forum-directory')) && bp_forums_is_installed_correctly()) {
        ?>
										<li<?php 
        if (bp_is_forums_component() && !bp_is_user_forums()) {
            ?>
 class="selected"<?php 
        }
        ?>
>
											<a href="<?php 
        echo site_url();
        ?>
/<?php 
        echo bp_forums_root_slug();
        ?>
/" title="<?php 
        _e('Forums', 'framemarket');
        ?>
"><?php 
/**
 * Customizes the post CSS class according to BuddyPress content.
 *
 * Hooked to the 'post_class' filter.
 *
 * @since 2.1.0
 *
 * @param array $wp_classes The post classes coming from WordPress.
 * @return array
 */
function bp_get_the_post_class($wp_classes = array())
{
    // Don't do anything if we're not on a BP page.
    if (!is_buddypress()) {
        return $wp_classes;
    }
    $bp_classes = array();
    if (bp_is_user() || bp_is_single_activity()) {
        $bp_classes[] = 'bp_members';
    } elseif (bp_is_group()) {
        $bp_classes[] = 'bp_group';
    } elseif (bp_is_activity_component()) {
        $bp_classes[] = 'bp_activity';
    } elseif (bp_is_blogs_component()) {
        $bp_classes[] = 'bp_blogs';
    } elseif (bp_is_register_page()) {
        $bp_classes[] = 'bp_register';
    } elseif (bp_is_activation_page()) {
        $bp_classes[] = 'bp_activate';
    } elseif (bp_is_forums_component() && bp_is_directory()) {
        $bp_classes[] = 'bp_forum';
    }
    if (empty($bp_classes)) {
        return $wp_classes;
    }
    // Emulate post type css class.
    foreach ($bp_classes as $bp_class) {
        $bp_classes[] = "type-{$bp_class}";
    }
    // Okay let's merge!
    return array_unique(array_merge($bp_classes, $wp_classes));
}
Example #17
0
/**
 * Customizes the post CSS class according to BuddyPress content.
 *
 * Hooked to the 'post_class' filter.
 *
 * @since BuddyPress (2.1.0)
 *
 * @param array $wp_classes The post classes coming from WordPress.
 * @return array
 */
function bp_get_the_post_class($wp_classes = array())
{
    // don't do anything if we're not on a BP page
    if (!is_buddypress()) {
        return $wp_classes;
    }
    $bp_classes = array();
    if (bp_is_user() || bp_is_single_activity()) {
        $bp_classes[] = 'bp_members';
    } elseif (bp_is_group()) {
        $bp_classes[] = 'bp_group';
    } elseif (bp_is_activity_component()) {
        $bp_classes[] = 'bp_activity';
    } elseif (bp_is_blogs_component()) {
        $bp_classes[] = 'bp_blogs';
    } elseif (bp_is_register_page()) {
        $bp_classes[] = 'bp_register';
    } elseif (bp_is_activation_page()) {
        $bp_classes[] = 'bp_activate';
    } elseif (bp_is_forums_component() && bp_is_directory()) {
        $bp_classes[] = 'bp_forum';
    }
    if (empty($bp_classes)) {
        return $wp_classes;
    }
    // emulate post type css class
    foreach ($bp_classes as $bp_class) {
        $bp_classes[] = "type-{$bp_class}";
    }
    // removes the 'page' and 'type-page' post classes
    // we need to remove these classes since they did not exist before we switched
    // theme compat to use the 'page' post type
    $page_key = array_search('page', $wp_classes);
    $page_type_key = array_search('type-page', $wp_classes);
    unset($wp_classes[$page_key], $wp_classes[$page_type_key]);
    // okay let's merge!
    return array_unique(array_merge($bp_classes, $wp_classes));
}
        bp_message_get_notices();
        /* Site wide notices to all users */
        ?>
			<?php 
    }
    ?>
		</div>
		<?php 
    do_action('bp_after_sidebar_me');
    ?>
	<?php 
}
?>
	<?php 
/* Show forum tags on the forums directory */
if (bp_is_active('forums') && bp_is_forums_component() && bp_is_directory()) {
    ?>
		<aside id="forum-directory-tags" class="widget tags">
			<h3 class="widgettitle"><?php 
    _e('Forum Topic Tags', 'status');
    ?>
</h3>
			<div id="tag-text"><?php 
    bp_forums_tag_heat_map();
    ?>
</div>
		</aside>
	<?php 
}
?>
Example #19
0
 * 7-23-2014
 */
?>

<header class="forum-header">
	<div class="forum-content">
	
	<?php 
// Recent Topics Archive
if (bbp_is_topic_archive()) {
    ?>
		<h2>Recent Topics</h2>
	
	<?php 
    // Search Results or Profile Topics
} elseif (is_search() || bp_is_forums_component()) {
    ?>
		<h2>Topic Title</h2>
	
	<?php 
    // Single Forum
} elseif (bbp_is_single_forum()) {
    ?>
		<h2><?php 
    bbp_forum_title();
    ?>
</h2>
		<a class="button scroll-respond" href="#respond" title="Create new topic in <?php 
    bbp_forum_title();
    ?>
"><i class="fa fa-pencil"></i>New Topic</a>
Example #20
0
/**
 *  widget for the community navigation
 *
 * @package Custom Community
 * @since 1.8.3
 */
function widget_community_nav($sidebar_id = false)
{
    ?>
		<?php 
    global $cap;
    if ($sidebar_id == 'leftsidebar' && $cap->bg_leftsidebar_default_nav && $cap->bg_leftsidebar_default_nav == 'no') {
        return;
    }
    ?>
  		<div id="community-nav" class="widget widget-title" >
        	<h3 class="widgettitle"><?php 
    _e('Community', 'cc');
    ?>
</h3>
  				<ul class="item-list">
					
			  		<?php 
    if ('activity' != bp_dtheme_page_on_front() && bp_is_active('activity')) {
        ?>
                                        <li<?php 
        if (bp_is_activity_component()) {
            ?>
 class="selected"<?php 
        }
        ?>
>
							<a href="<?php 
        echo site_url();
        ?>
/<?php 
        echo BP_ACTIVITY_SLUG;
        ?>
/" title="<?php 
        _e('Activity', 'cc');
        ?>
"><?php 
        _e('Activity', 'cc');
        ?>
</a>
						</li>
					<?php 
    }
    ?>

                                        <li<?php 
    if (bp_is_members_component() || bp_is_user()) {
        ?>
 class="selected"<?php 
    }
    ?>
>
                                                <a href="<?php 
    echo site_url();
    ?>
/<?php 
    echo BP_MEMBERS_SLUG;
    ?>
/" title="<?php 
    _e('Members', 'cc');
    ?>
"><?php 
    _e('Members', 'cc');
    ?>
</a>
                                        </li>
			
                                    <?php 
    if (bp_is_active('groups')) {
        ?>
                                            <li<?php 
        if (bp_is_groups_component() || bp_is_group()) {
            ?>
 class="selected"<?php 
        }
        ?>
>
                                                    <a href="<?php 
        echo site_url();
        ?>
/<?php 
        echo BP_GROUPS_SLUG;
        ?>
/" title="<?php 
        _e('Groups', 'cc');
        ?>
"><?php 
        _e('Groups', 'cc');
        ?>
</a>
                                            </li>
			
                                        <?php 
        if (bp_is_active('forums') && (function_exists('bp_forums_is_installed_correctly') && !(int) bp_get_option('bp-disable-forum-directory')) && bp_forums_is_installed_correctly()) {
            ?>
                                                <li<?php 
            if (bp_is_forums_component()) {
                ?>
 class="selected"<?php 
            }
            ?>
>
                                                        <a href="<?php 
            echo site_url();
            ?>
/<?php 
            echo BP_FORUMS_SLUG;
            ?>
/" title="<?php 
            _e('Forums', 'cc');
            ?>
"><?php 
            _e('Forums', 'cc');
            ?>
</a>
                                                </li>
                                        <?php 
        }
        ?>
					<?php 
    }
    ?>
					<?php 
    if (bp_is_active('blogs') && is_multisite()) {
        ?>
                                                        <li<?php 
        if (bp_is_blogs_component()) {
            ?>
 class="selected"<?php 
        }
        ?>
>
							<a href="<?php 
        echo site_url();
        ?>
/<?php 
        echo BP_BLOGS_SLUG;
        ?>
/" title="<?php 
        _e('Blogs', 'cc');
        ?>
"><?php 
        _e('Blogs', 'cc');
        ?>
</a>
						</li>
					<?php 
    }
    ?>
  				</ul>
				
   <?php 
    if (bp_is_single_item() || bp_is_user()) {
        ?>
	   	<?php 
        if (bp_is_group()) {
            ?>
		<div id="community-single-nav" class="widget-title" >
		  <ul class="item-list">
		  <h3 class="widgettitle"><?php 
            _e('@ Group', 'cc');
            ?>
</h3>
				<?php 
            bp_get_options_nav();
            ?>
				<?php 
            do_action('bp_group_options_nav');
            ?>
			</ul>
		
		</div>	
		<?php 
        }
        ?>

		<?php 
        if (bp_is_user()) {
            ?>
		<div id="community-single-nav" class="widget-title" >
		  <ul class="item-list">
		  <h3 class="widgettitle"><?php 
            _e('@ Member', 'cc');
            ?>
</h3>
		  <?php 
            bp_get_displayed_user_nav();
            ?>
				<?php 
            do_action('bp_group_options_nav');
            ?>
			</ul>
		
		</div>	
		<?php 
        }
        ?>
  	<?php 
    }
    ?>
  	</div>
<?php 
}
Example #21
0
 /**
  * Sets up the title for pages and <title>
  *
  * @global obj $bp
  */
 function setup_title()
 {
     global $bp;
     // Adjust title based on view
     if (bp_is_forums_component()) {
         if (bp_is_my_profile()) {
             $bp->bp_options_title = __('Forums', 'buddypress');
         } else {
             $bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb'));
             $bp->bp_options_title = $bp->displayed_user->fullname;
         }
     }
     parent::setup_title();
 }