Skip to:
Content

BuddyPress.org

Changeset 1250 for trunk/bp-core.php


Ignore:
Timestamp:
03/25/2009 04:01:43 PM (15 years ago)
Author:
apeatling
Message:

Removed blogs, groups and members directory from the home theme into the BuddyPress member theme. The directories now have their own templates and theme based CSS and provide much easier editing.

Moved the $bp global setup to a higher priority action - from the 'wp' action to the 'plugins_loaded' action. This stops occurrences where the $bp global was not defined yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r1245 r1250  
    3535require ( 'bp-core/bp-core-signup.php' );
    3636require ( 'bp-core/bp-core-activation.php' );
    37 require ( 'bp-core/directories/bp-core-directory-members.php' );
    3837
    3938/* Define the slug for member pages and the members directory (e.g. domain.com/[members] ) */
     
    7574    global $displayed_user_id;
    7675    global $action_variables;
     76   
     77    $current_user = wp_get_current_user();
    7778
    7879    /* The domain for the root of the site where the main blog resides */   
     
    147148        $bp->current_component = $bp->default_component;
    148149}
    149 add_action( 'wp', 'bp_core_setup_globals', 1 );
     150add_action( 'plugins_loaded', 'bp_core_setup_globals', 3 );
    150151add_action( '_admin_menu', 'bp_core_setup_globals', 1 ); // must be _admin_menu hook.
    151152
     
    158159    bp_core_add_root_component( HOME_BLOG_SLUG );
    159160}
    160 add_action( 'plugins_loaded', 'bp_core_setup_root_components' );
     161add_action( 'plugins_loaded', 'bp_core_setup_root_components', 1 );
    161162
    162163function bp_core_setup_session() {
     
    305306add_action( 'wp', 'bp_core_setup_nav', 2 );
    306307add_action( 'admin_menu', 'bp_core_setup_nav', 2 );
     308
     309function bp_core_directory_members() {
     310    global $bp;
     311   
     312    if ( !is_home() && is_null( $bp->displayed_user->id ) && $bp->current_component == $bp->default_component ) {
     313        $bp->is_directory = true;
     314        $bp->current_component = false;
     315
     316        wp_enqueue_script( 'bp-core-directory-members', WPMU_PLUGIN_URL . '/bp-core/js/directory-members.js', array( 'jquery', 'jquery-livequery-pack' ) );
     317        bp_core_load_template( 'directories/members/index' );
     318    }
     319}
     320add_action( 'wp', 'bp_core_directory_members', 5 );
    307321
    308322/**
     
    11671181 */
    11681182function bp_core_referrer() {
    1169     $referer = explode( '/', $_SERVER['HTTP_REFERER'] );
     1183    $referer = explode( '/', wp_get_referer() );
    11701184    unset( $referer[0], $referer[1], $referer[2] );
    11711185    return implode( '/', $referer );
     
    13421356    global $wpdb;
    13431357    ?>
    1344 <!-- Generated in <?php timer_stop(1); ?> seconds. -->
     1358<!-- Generated in <?php timer_stop(1); ?> seconds. <?php echo $wpdb->num_queries; ?> queries. -->
    13451359    <?php
    13461360}
Note: See TracChangeset for help on using the changeset viewer.