Skip to:
Content

BuddyPress.org

Changeset 2695


Ignore:
Timestamp:
02/12/2010 12:31:49 PM (17 years ago)
Author:
apeatling
Message:

Fixing the use of deprecated template tags in bp-default. Merged the fetching of BP runtime settings into one query to significantly reduce the number of run time database hits. Fixed #1916

Location:
trunk
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r2692 r2695  
    9090}
    9191add_action( 'bp_setup_globals', 'bp_activity_setup_globals' );
    92 add_action( 'admin_menu', 'bp_activity_setup_globals', 2 );
    9392
    9493function bp_activity_check_installed() {
    9594        global $wpdb, $bp;
    9695
    97         if ( get_site_option('bp-activity-db-version') < BP_ACTIVITY_DB_VERSION )
     96        if ( $bp->site_options['bp-activity-db-version'] < BP_ACTIVITY_DB_VERSION )
    9897                bp_activity_install();
    9998}
  • trunk/bp-activity/bp-activity-templatetags.php

    r2692 r2695  
    2323
    2424                /* Check if blog/forum replies are disabled */
    25                 $this->disable_blogforum_replies = get_site_option( 'bp-disable-blogforum-comments' );
     25                $this->disable_blogforum_replies = $bp->site_options['bp-disable-blogforum-comments'];
    2626
    2727                /* Get an array of the logged in user's favorite activities */
     
    165165                'sort' => 'DESC', // sort DESC or ASC
    166166                'page' => 1, // which page to load
    167                 'per_page' => 25, // number of items per page
     167                'per_page' => 20, // number of items per page
    168168                'max' => false, // max number to return
    169169                'show_hidden' => $show_hidden, // Show activity items that are hidden site-wide?
  • trunk/bp-blogs.php

    r2684 r2695  
    6464
    6565        // On first installation - record all existing blogs in the system.
    66         if ( !(int)get_site_option( 'bp-blogs-first-install') && bp_core_is_multisite() ) {
     66        if ( !(int)$bp->site_options['bp-blogs-first-install'] && bp_core_is_multisite() ) {
    6767                bp_blogs_record_existing_blogs();
    6868                add_site_option( 'bp-blogs-first-install', 1 );
     
    7878        if ( is_site_admin() && bp_core_is_multisite() ) {
    7979                /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    80                 if ( get_site_option('bp-blogs-db-version') < BP_BLOGS_DB_VERSION )
     80                if ( $bp->site_options['bp-blogs-db-version'] < BP_BLOGS_DB_VERSION )
    8181                        bp_blogs_install();
    8282        }
     
    103103}
    104104add_action( 'bp_setup_globals', 'bp_blogs_setup_globals' );
    105 add_action( 'admin_menu', 'bp_blogs_setup_globals', 2 );
    106105
    107106function bp_blogs_setup_root_component() {
     
    383382
    384383        /* This is to stop infinate loops with Donncha's sitewide tags plugin */
    385         if ( (int)get_site_option( 'tags_blog_id' ) == (int)$blog_id )
     384        if ( (int)$bp->site_options['tags_blog_id'] == (int)$blog_id )
    386385                return false;
    387386
     
    408407                        if ( (int)get_blog_option( $blog_id, 'blog_public' ) || !bp_core_is_multisite() ) {
    409408                                /* Record this in activity streams */
    410                                 $post_permalink = bp_post_get_permalink( $post, $blog_id );
     409                                $post_permalink = get_permalink( $post_id );
    411410
    412411                                $activity_action = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
  • trunk/bp-blogs/bp-blogs-templatetags.php

    r2678 r2695  
    206206                return apply_filters( 'bp_get_blog_avatar_' . $blogs_template->blog->blog_id, bp_core_fetch_avatar( array( 'item_id' => $blogs_template->blog->admin_user_id, 'type' => $type, 'alt' => $alt, 'width' => $width, 'height' => $height, 'class' => $class, 'email' => $blogs_template->blog->admin_user_email ) ) );
    207207        }
    208                 /* DEPRECATED */
    209                 function bp_blog_avatar_thumb() { echo bp_get_blog_avatar('type=thumb'); }
    210                 function bp_blog_avatar_mini() { echo bp_get_blog_avatar_mini('type=thumb&width=30&height=30'); }
    211208
    212209function bp_blog_permalink() {
     
    302299
    303300function bp_blog_signup_enabled() {
    304         $active_signup = get_site_option( 'registration' );
     301        global $bp;
     302
     303        $active_signup = $bp->site_options['registration'];
    305304
    306305        if ( !$active_signup )
  • trunk/bp-core.php

    r2678 r2695  
    2323        define( 'BP_ROOT_BLOG', 1 );
    2424
    25 /* Define the user and usermeta table names, useful if you are using custom or shared tables */
     25/* Define the user and usermeta table names, useful if you are using custom or shared tables. */
    2626if ( !defined( 'CUSTOM_USER_TABLE' ) )
    2727        define( 'CUSTOM_USER_TABLE', $wpdb->base_prefix . 'users' );
     
    4040require ( BP_PLUGIN_DIR . '/bp-core/bp-core-notifications.php' );
    4141require ( BP_PLUGIN_DIR . '/bp-core/bp-core-signup.php' );
    42 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-activation.php' );
    43 
    44 /* If BP_DISABLE_ADMIN_BAR is defined, do not load the global admin bar */
     42
     43/* Multisite includes built in account activation support. */
     44if ( bp_core_is_multisite() )
     45        require ( BP_PLUGIN_DIR . '/bp-core/bp-core-activation.php' );
     46
     47/* If BP_DISABLE_ADMIN_BAR is defined, do not load the global admin bar. */
    4548if ( !defined( 'BP_DISABLE_ADMIN_BAR' ) )
    4649        require ( BP_PLUGIN_DIR . '/bp-core/bp-core-adminbar.php' );
     
    6164if ( !defined( 'BP_SEARCH_SLUG' ) )
    6265        define( 'BP_SEARCH_SLUG', 'search' );
    63 
    64 /* Define the slug for the search page */
    65 if ( !defined( 'BP_HOME_BLOG_SLUG' ) )
    66         define( 'BP_HOME_BLOG_SLUG', 'blog' );
    6766
    6867/* Register BuddyPress themes contained within the bp-theme folder */
     
    142141        }
    143142
     143        /* Fetches all of the core database based BuddyPress settings in one foul swoop */
     144        $bp->site_options = bp_core_get_site_options();
     145
    144146        /* Sets up the array container for the component navigation rendered by bp_get_nav() */
    145147        $bp->bp_nav = array();
     
    148150        $bp->bp_options_nav = array();
    149151
    150         /* Sets up container used for the title of the current component option and rendered by bp_get_options_title() */
    151         $bp->bp_options_title = '';
    152 
    153         /* Sets up container used for the avatar of the current component being viewed. Rendered by bp_get_options_avatar() */
    154         $bp->bp_options_avatar = '';
    155 
    156152        /* Contains an array of all the active components. The key is the slug, value the internal ID of the component */
    157153        $bp->active_components = array();
    158154
    159155        /* Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar */
    160         $bp->grav_default->user = apply_filters( 'bp_user_gravatar_default', get_site_option( 'user-avatar-default' ) );
     156        $bp->grav_default->user = apply_filters( 'bp_user_gravatar_default', $bp->site_options['user-avatar-default'] );
    161157        $bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', 'identicon' );
    162158        $bp->grav_default->blog = apply_filters( 'bp_blog_gravatar_default', 'identicon' );
     
    183179}
    184180add_action( 'bp_setup_globals', 'bp_core_setup_globals' );
    185 add_action( '_admin_menu', 'bp_core_setup_globals', 2 ); // must be _admin_menu hook.
    186 
    187181
    188182/**
     
    202196        bp_core_add_root_component( BP_ACTIVATION_SLUG );
    203197        bp_core_add_root_component( BP_SEARCH_SLUG );
    204         bp_core_add_root_component( BP_HOME_BLOG_SLUG );
    205198}
    206199add_action( 'plugins_loaded', 'bp_core_setup_root_uris', 2 );
     
    274267
    275268        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    276         if ( get_site_option('bp-core-db-version') < BP_CORE_DB_VERSION )
     269        if ( $bp->site_options['bp-core-db-version'] < BP_CORE_DB_VERSION )
    277270                bp_core_install();
    278271}
     
    558551        return apply_filters( 'bp_core_get_user_domain', $domain );
    559552}
    560 /* DEPRECATED */
    561 function bp_core_get_userurl( $uid ) { return bp_core_get_user_domain( $uid ); }
    562553
    563554/**
     
    10771068 * @return str The link text based on passed parameters.
    10781069 */
    1079 function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false, $deprecated = false, $with_s = false ) {
     1070function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false ) {
    10801071        $display_name = bp_core_get_user_displayname( $user_id );
    10811072
     
    10831074                return false;
    10841075
    1085         if ( $with_s )
    1086                 $display_name = sprintf( __( "%s's", 'buddypress' ), $display_name );
    1087 
    10881076        if ( $no_anchor )
    10891077                return $display_name;
     
    10951083                return $url;
    10961084
    1097         return apply_filters( 'bp_core_get_userlink', '<a href="' . $url . '">' . $display_name . '</a>', $user_id );
     1085        return apply_filters( 'bp_core_get_userlink', '<a href="' . $url . '" title="' . $display_name . '">' . $display_name . '</a>', $user_id );
    10981086}
    10991087
     
    15331521
    15341522        return apply_filters( 'bp_core_get_site_path', $site_path );
     1523}
     1524
     1525/**
     1526 * bp_core_get_site_options()
     1527 *
     1528 * BuddyPress uses site options to store configuration settings. Many of these settings are needed
     1529 * at run time. Instead of fetching them all and adding many initial queries to each page load, let's fetch
     1530 * them all in one go.
     1531 *
     1532 * @package BuddyPress Core
     1533 */
     1534function bp_core_get_site_options() {
     1535        global $bp, $wpdb;
     1536
     1537        $options = apply_filters( 'bp_core_site_options', array(
     1538                'bp-core-db-version',
     1539                'bp-activity-db-version',
     1540                'bp-blogs-db-version',
     1541                'bp-friends-db-version',
     1542                'bp-groups-db-version',
     1543                'bp-messages-db-version',
     1544                'bp-xprofile-db-version',
     1545                'bp-deactivated-components',
     1546                'bp-blogs-first-install',
     1547                'bp-disable-blog-forum-comments',
     1548                'bp-xprofile-base-group-name',
     1549                'bp-xprofile-fullname-field-name',
     1550                'bp-hide-loggedout-adminbar',
     1551                'bp-disable-profile-sync',
     1552                'bp-disable-avatar-uploads',
     1553                'bp-disable-account-deletion',
     1554                'bp-disable-forum-directory',
     1555                'bp-disable-blogforum-comments',
     1556                'bb-config-location',
     1557
     1558                /* Useful WordPress settings used often */
     1559                'user-avatar-default',
     1560                'tags_blog_id',
     1561                'registration',
     1562                'fileupload_maxk'
     1563        ) );
     1564
     1565        $meta_keys = "'" . implode( "','", (array)$options ) ."'";
     1566
     1567        if ( bp_core_is_multisite() )
     1568                $meta = $wpdb->get_results( "SELECT meta_key AS name, meta_value AS value FROM {$wpdb->sitemeta} WHERE meta_key IN ({$meta_keys})" );
     1569        else
     1570                $meta = $wpdb->get_results( "SELECT option_name AS name, option_value AS value FROM {$wpdb->options} WHERE option_name IN ({$meta_keys})" );
     1571
     1572        $site_options = array();
     1573        if ( !empty( $meta ) ) {
     1574                foreach( (array)$meta as $meta_item )
     1575                        $site_options[$meta_item->name] = $meta_item->value;
     1576        }
     1577
     1578        return apply_filters( 'bp_core_get_site_options', $site_options );
    15351579}
    15361580
  • trunk/bp-core/bp-core-adminbar.php

    r2632 r2695  
    77                return false;
    88
    9         if ( (int)get_site_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() )
     9        if ( (int)$bp->site_options['hide-loggedout-adminbar'] && !is_user_logged_in() )
    1010                return false;
    1111
  • trunk/bp-core/bp-core-avatars.php

    r2418 r2695  
    88 * Set up the constants we need for avatar support
    99 */
    10 
    11 if ( !defined( 'BP_AVATAR_UPLOAD_PATH' ) )
    12         define( 'BP_AVATAR_UPLOAD_PATH', bp_core_avatar_upload_path() );
    13 
    14 if ( !defined( 'BP_AVATAR_URL' ) )
    15         define( 'BP_AVATAR_URL', bp_core_avatar_url() );
    16 
    17 if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
    18         define( 'BP_AVATAR_THUMB_WIDTH', 50 );
    19 
    20 if ( !defined( 'BP_AVATAR_THUMB_HEIGHT' ) )
    21         define( 'BP_AVATAR_THUMB_HEIGHT', 50 );
    22 
    23 if ( !defined( 'BP_AVATAR_FULL_WIDTH' ) )
    24         define( 'BP_AVATAR_FULL_WIDTH', 150 );
    25 
    26 if ( !defined( 'BP_AVATAR_FULL_HEIGHT' ) )
    27         define( 'BP_AVATAR_FULL_HEIGHT', 150 );
    28 
    29 if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_WIDTH' ) )
    30         define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 );
    31 
    32 if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) {
    33         if ( !get_site_option( 'fileupload_maxk' ) )
    34                 define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); /* 5mb */
    35         else
    36                 define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', get_site_option( 'fileupload_maxk' ) * 1024 );
    37 }
    38 
    39 if ( !defined( 'BP_AVATAR_DEFAULT' ) )
    40         define( 'BP_AVATAR_DEFAULT', BP_PLUGIN_URL . '/bp-xprofile/images/none.gif' );
    41 
    42 if ( !defined( 'BP_AVATAR_DEFAULT_THUMB' ) )
    43         define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . '/bp-xprofile/images/none-thumbnail.gif' );
     10function bp_core_set_avatar_constants() {
     11        global $bp;
     12
     13        if ( !defined( 'BP_AVATAR_UPLOAD_PATH' ) )
     14                define( 'BP_AVATAR_UPLOAD_PATH', bp_core_avatar_upload_path() );
     15
     16        if ( !defined( 'BP_AVATAR_URL' ) )
     17                define( 'BP_AVATAR_URL', bp_core_avatar_url() );
     18
     19        if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
     20                define( 'BP_AVATAR_THUMB_WIDTH', 50 );
     21
     22        if ( !defined( 'BP_AVATAR_THUMB_HEIGHT' ) )
     23                define( 'BP_AVATAR_THUMB_HEIGHT', 50 );
     24
     25        if ( !defined( 'BP_AVATAR_FULL_WIDTH' ) )
     26                define( 'BP_AVATAR_FULL_WIDTH', 150 );
     27
     28        if ( !defined( 'BP_AVATAR_FULL_HEIGHT' ) )
     29                define( 'BP_AVATAR_FULL_HEIGHT', 150 );
     30
     31        if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_WIDTH' ) )
     32                define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 );
     33
     34        if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) {
     35                if ( !$bp->site_options['fileupload_maxk'] )
     36                        define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); /* 5mb */
     37                else
     38                        define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', $bp->site_options['fileupload_maxk'] * 1024 );
     39        }
     40
     41        if ( !defined( 'BP_AVATAR_DEFAULT' ) )
     42                define( 'BP_AVATAR_DEFAULT', BP_PLUGIN_URL . '/bp-xprofile/images/none.gif' );
     43
     44        if ( !defined( 'BP_AVATAR_DEFAULT_THUMB' ) )
     45                define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . '/bp-xprofile/images/none-thumbnail.gif' );
     46}
     47add_action( 'bp_init', 'bp_core_set_avatar_constants' );
    4448
    4549function bp_core_fetch_avatar( $args = '' ) {
  • trunk/bp-core/bp-core-catchuri.php

    r2525 r2695  
    214214                status_header( 200 );
    215215                $wp_query->is_404 = false;
    216 
    217                 if ( $bp->current_component != BP_HOME_BLOG_SLUG )
    218                         $wp_query->is_page = true;
     216                $wp_query->is_page = true;
    219217        }
    220218
  • trunk/bp-core/bp-core-classes.php

    r2576 r2695  
    207207                 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join)
    208208                 */
    209                 foreach ( (array)$paged_users as $user )
    210                         $user_ids[] = $user->id;
    211 
    212                 $user_ids = $wpdb->escape( join( ',', (array)$user_ids ) );
    213 
    214                 /* Add additional data to the returned results */
    215                 if ( $populate_extras )
     209                if ( $populate_extras ) {
     210                        foreach ( (array)$paged_users as $user )
     211                                $user_ids[] = $user->id;
     212
     213                        $user_ids = $wpdb->escape( join( ',', (array)$user_ids ) );
     214
     215                        /* Add additional data to the returned results */
    216216                        $paged_users = BP_Core_User::get_user_extras( &$paged_users, $user_ids, $type );
     217                }
    217218
    218219                return array( 'users' => $paged_users, 'total' => $total_users );
  • trunk/bp-core/bp-core-cssjs.php

    r2599 r2695  
    173173 */
    174174function bp_core_override_adminbar_css() {
    175         if ( defined( 'BP_DISABLE_ADMIN_BAR' ) || ( get_site_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) ) {
     175        global $bp;
     176
     177        if ( defined( 'BP_DISABLE_ADMIN_BAR' ) || ( $bp->site_options['hide-loggedout-adminbar'] && !is_user_logged_in() ) ) {
    176178        ?>
    177179<style type="text/css">body { padding-top: 0 !important; } #wp-admin-bar { display: none; }</style>
  • trunk/bp-core/bp-core-settings.php

    r2576 r2695  
    2222        bp_core_new_subnav_item( array( 'name' => __( 'Notifications', 'buddypress' ), 'slug' => 'notifications', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_notification_settings', 'position' => 20, 'user_has_access' => bp_is_my_profile() ) );
    2323
    24         if ( !is_site_admin() && !(int) get_site_option( 'bp-disable-account-deletion' ) )
     24        if ( !is_site_admin() && !(int) $bp->site_options['bp-disable-account-deletion'] )
    2525                bp_core_new_subnav_item( array( 'name' => __( 'Delete Account', 'buddypress' ), 'slug' => 'delete-account', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_delete_account', 'position' => 90, 'user_has_access' => bp_is_my_profile() ) );
    2626}
  • trunk/bp-core/bp-core-signup.php

    r2617 r2695  
    7171                /* Finally, let's check the blog details, if the user wants a blog and blog creation is enabled */
    7272                if ( isset( $_POST['signup_with_blog'] ) ) {
    73                         $active_signup = get_site_option( 'registration' );
     73                        $active_signup = $bp->site_options['registration'];
    7474
    7575                        if ( 'blog' == $active_signup || 'all' == $active_signup ) {
     
    9595
    9696                        /* No errors! Let's register those deets. */
    97                         $active_signup = get_site_option( 'registration' );
     97                        $active_signup = $bp->site_options['registration'];
    9898
    9999                        if ( 'none' != $active_signup ) {
  • trunk/bp-core/bp-core-templatetags.php

    r2690 r2695  
    393393        </form>
    394394<?php
    395 }
    396 
    397 function bp_home_blog_url() {
    398         global $bp, $current_blog;
    399 
    400         if ( defined( 'BP_ENABLE_MULTIBLOG' ) ) {
    401                 $blog_id = $current_blog->blog_id;
    402         } else {
    403                 $blog_id = BP_ROOT_BLOG;
    404         }
    405 
    406         if ( 'bphome' == get_blog_option( $blog_id, 'template' ) )
    407                 echo $bp->root_domain . '/' . BP_HOME_BLOG_SLUG;
    408         else
    409                 echo $bp->root_domain;
    410395}
    411396
     
    475460        echo apply_filters( 'bp_logout_nav_link', $logout_link );
    476461}
    477         /* DEPRECATED - use bp_get_loggedin_user_nav() */
    478         function bp_get_nav() { bp_get_loggedin_user_nav(); }
    479462
    480463/**
     
    508491        }
    509492}
    510         /* DEPRECATED - use bp_get_displayed_user_nav() */
    511         function bp_get_user_nav() { bp_get_displayed_user_nav(); }
    512493
    513494/**
     
    874855        global $bp, $is_member_page, $wp_query;
    875856
    876         if ( $bp->current_component == BP_HOME_BLOG_SLUG )
    877                 return true;
    878 
    879857        if ( $wp_query->is_home && !$bp->is_directory )
    880858                return true;
     
    1001979        }
    1002980
    1003         if ( function_exists( 'bp_forums_setup' ) && !(int) get_site_option( 'bp-disable-forum-directory' ) ) {
     981        if ( function_exists( 'bp_forums_setup' ) && !(int) $bp->site_options['bp-disable-forum-directory'] ) {
    1004982                $selection_box .= '<option value="forums">' . __( 'Forums', 'buddypress' ) . '</option>';
    1005983        }
     
    10361014
    10371015        echo apply_filters( 'bp_logout_link', $logout_link );
    1038 }
    1039 
    1040 function bp_nav_items() {
    1041         global $bp;
    1042         // This is deprecated, you should put these navigation items in your template header.php for easy editing.
    1043 ?>
    1044         <li<?php if ( bp_is_page( 'home' ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a></li>
    1045         <li<?php if ( bp_is_page( BP_HOME_BLOG_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_HOME_BLOG_SLUG ?>" title="<?php _e( 'Blog', 'buddypress' ) ?>"><?php _e( 'Blog', 'buddypress' ) ?></a></li>
    1046         <li<?php if ( bp_is_page( BP_MEMBERS_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_MEMBERS_SLUG ?>" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' ) ?></a></li>
    1047 
    1048         <?php if ( function_exists( 'groups_install' ) ) { ?>
    1049                 <li<?php if ( bp_is_page( $bp->groups->slug ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo $bp->groups->slug ?>" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' ) ?></a></li>
    1050         <?php } ?>
    1051 
    1052         <?php if ( function_exists( 'bp_blogs_install' ) ) { ?>
    1053                 <li<?php if ( bp_is_page( $bp->blogs->slug ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo $bp->blogs->slug ?>" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a></li>
    1054         <?php } ?>
    1055 <?php
    1056         do_action( 'bp_nav_items' );
    10571016}
    10581017
     
    12401199}
    12411200        function bp_get_signup_allowed() {
     1201                global $bp;
     1202
    12421203                if ( bp_core_is_multisite() ) {
    1243                         if ( in_array( get_site_option( 'registration' ), array( 'all', 'user' ) ) )
     1204                        if ( in_array( $bp->site_options['registration'], array( 'all', 'user' ) ) )
    12441205                                return true;
    12451206                } else {
     
    12541215}
    12551216        function bp_get_blog_signup_allowed() {
     1217                global $bp;
     1218
    12561219                if ( !bp_core_is_multisite() )
    12571220                        return false;
    12581221
    1259                 $status = get_site_option( 'registration' );
     1222                $status = $bp->site_options['registration'];
    12601223                if ( 'none' != $status && 'user' != $status )
    12611224                        return true;
     
    12841247        }
    12851248
     1249function bp_get_option( $option_name ) {
     1250        global $bp;
     1251
     1252        return apply_filters( 'bp_get_option', $bp->site_options[$option_name] );
     1253}
    12861254
    12871255/*** CUSTOM LOOP TEMPLATE CLASSES *******************/
  • trunk/bp-core/bp-core-widgets.php

    r2669 r2695  
    8787                   . $after_title; ?>
    8888
    89                 <?php if ( bp_has_members( 'user_id=0&type=newest&max=' . $instance['max_members'] ) ) : ?>
     89                <?php if ( bp_has_members( 'user_id=0&type=newest&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?>
    9090                        <div class="item-options" id="members-list-options">
    9191                                <span class="ajax-loader" id="ajax-loader-members"></span>
     
    255255        global $bp;
    256256
    257         check_ajax_referer('bp_core_widget_members');
     257        check_ajax_referer( 'bp_core_widget_members' );
    258258
    259259        switch ( $_POST['filter'] ) {
     
    267267                        $type = 'popular';
    268268                break;
    269         } ?>
    270         <?php if ( bp_has_members( 'user_id=0&type=' . $type . '&per_page=' . $_POST['max-members'] . '&max=' . $_POST['max-members'] ) ) : ?>
    271                 <?php echo '0[[SPLIT]]'; // return valid result. TODO: remove this because it's dumb. ?>
     269        }
     270
     271        if ( bp_has_members( 'user_id=0&type=' . $type . '&per_page=' . $_POST['max-members'] . '&max=' . $_POST['max-members'] . '&populate_extras=0' ) ) : ?>
     272                <?php echo '0[[SPLIT]]'; // return valid result. TODO: remove this. ?>
    272273                <div class="avatar-block">
    273274                        <?php while ( bp_members() ) : bp_the_member(); ?>
     
    279280                                        <div class="item">
    280281                                                <div class="item-title fn"><a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_name() ?></a></div>
    281                                                 <?php if ( 'active' == $type ) : ?>
     282                                                <?php if ( 'active' == $type || 'newest' == $type ) : ?>
    282283                                                        <div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div>
    283284                                                <?php else : ?>
  • trunk/bp-forums.php

    r2678 r2695  
    2121
    2222        $bp->forums->image_base = BP_PLUGIN_URL . '/bp-forums/images';
    23         $bp->forums->bbconfig = get_site_option( 'bb-config-location' );
     23        $bp->forums->bbconfig = $bp->site_options['bb-config-location'];
    2424        $bp->forums->slug = BP_FORUMS_SLUG;
    2525
     
    3030}
    3131add_action( 'bp_setup_globals', 'bp_forums_setup' );
    32 add_action( 'admin_head', 'bp_forums_setup', 2 );
    3332
    3433function bp_forums_is_installed_correctly() {
     
    5150
    5251        if ( $bp->current_component == $bp->forums->slug ) {
    53                 if ( (int) get_site_option( 'bp-disable-forum-directory' ) || !function_exists( 'groups_install' ) )
     52                if ( (int) $bp->site_options['bp-disable-forum-directory'] || !function_exists( 'groups_install' ) )
    5453                        return false;
    5554
  • trunk/bp-forums/bp-forums-templatetags.php

    r2641 r2695  
    209209        return apply_filters( 'bp_has_topics', $forum_template->has_topics(), &$forum_template );
    210210}
    211         /* DEPRECATED use bp_has_forum_topics() */
    212         function bp_has_topics( $args = '' ) { return bp_has_forum_topics( $args ); }
    213211
    214212function bp_forum_topics() {
     
    216214        return $forum_template->user_topics();
    217215}
    218         /* DEPRECATED use bp_has_forum_topics() */
    219         function bp_topics() { return bp_forum_topics(); }
    220216
    221217function bp_the_forum_topic() {
     
    223219        return $forum_template->the_topic();
    224220}
    225         /* DEPRECATED use bp_the_forum_topic() */
    226         function bp_the_topic() { return bp_the_forum_topic(); }
    227221
    228222function bp_the_topic_id() {
     
    823817        return apply_filters( 'bp_has_topic_posts', $topic_template->has_posts(), &$topic_template );
    824818}
    825         /* DEPRECATED use bp_has_forum_topic_posts() */
    826         function bp_has_topic_posts() { return bp_has_forum_topic_posts( $args ); }
    827819
    828820function bp_forum_topic_posts() {
     
    830822        return $topic_template->user_posts();
    831823}
    832         /* DEPRECATED use bp_forum_topic_posts() */
    833         function bp_topic_posts() { return bp_forum_topic_posts(); }
    834824
    835825function bp_the_forum_topic_post() {
     
    837827        return $topic_template->the_post();
    838828}
    839         /* DEPRECATED use bp_the_forum_topic_post() */
    840         function bp_the_topic_post() { return bp_the_forum_topic_post(); }
    841829
    842830function bp_the_topic_post_id() {
  • trunk/bp-friends.php

    r2678 r2695  
    4949}
    5050add_action( 'bp_setup_globals', 'friends_setup_globals' );
    51 add_action( 'admin_menu', 'friends_setup_globals', 2 );
    5251
    5352function friends_check_installed() {
     
    5857
    5958        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    60         if ( get_site_option('bp-friends-db-version') < BP_FRIENDS_DB_VERSION )
     59        if ( $bp->site_options['bp-friends-db-version'] < BP_FRIENDS_DB_VERSION )
    6160                friends_install();
    6261}
  • trunk/bp-groups.php

    r2684 r2695  
    100100}
    101101add_action( 'bp_setup_globals', 'groups_setup_globals' );
    102 add_action( 'admin_menu', 'groups_setup_globals', 2 );
    103102
    104103function groups_setup_root_component() {
     
    110109function groups_check_installed() {
    111110        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    112         if ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION )
     111        if ( $bp->site_options['bp-groups-db-version'] < BP_GROUPS_DB_VERSION )
    113112                groups_install();
    114113}
  • trunk/bp-groups/bp-groups-templatetags.php

    r2626 r2695  
    255255}
    256256
    257 
    258 function bp_group_id( $deprecated = true, $deprecated2 = false ) {
    259         global $groups_template;
    260 
    261         if ( !$deprecated )
    262                 return bp_get_group_id();
    263         else
    264                 echo bp_get_group_id();
     257function bp_group_id() {
     258        echo bp_get_group_id();
    265259}
    266260        function bp_get_group_id( $group = false ) {
     
    273267        }
    274268
    275 function bp_group_name( $deprecated = true, $deprecated2 = false ) {
    276         global $groups_template;
    277 
    278         if ( !$deprecated )
    279                 return bp_get_group_name();
    280         else
    281                 echo bp_get_group_name();
     269function bp_group_name() {
     270        echo bp_get_group_name();
    282271}
    283272        function bp_get_group_name( $group = false ) {
     
    363352        }
    364353
    365 function bp_group_last_active( $deprecated = true, $deprecated2 = false ) {
    366         if ( !$deprecated )
    367                 return bp_get_group_last_active();
    368         else
    369                 echo bp_get_group_last_active();
     354function bp_group_last_active() {
     355        echo bp_get_group_last_active();
    370356}
    371357        function bp_get_group_last_active( $group = false ) {
     
    387373        }
    388374
    389 function bp_group_permalink( $deprecated = false, $deprecated2 = true ) {
    390         if ( !$deprecated2 )
    391                 return bp_get_group_permalink();
    392         else
    393                 echo bp_get_group_permalink();
     375function bp_group_permalink() {
     376        echo bp_get_group_permalink();
    394377}
    395378        function bp_get_group_permalink( $group = false ) {
     
    402385        }
    403386
    404 function bp_group_admin_permalink( $deprecated = true, $deprecated2 = false ) {
    405         if ( !$deprecated )
    406                 return bp_get_group_admin_permalink();
    407         else
    408                 echo bp_get_group_admin_permalink();
     387function bp_group_admin_permalink() {
     388        echo bp_get_group_admin_permalink();
    409389}
    410390        function bp_get_group_admin_permalink( $group = false ) {
     
    429409        }
    430410
    431 function bp_group_description( $deprecated = false, $deprecated2 = true ) {
    432         if ( !$deprecated2 )
    433                 return bp_get_group_description();
    434         else
    435                 echo bp_get_group_description();
     411function bp_group_description() {
     412        echo bp_get_group_description();
    436413}
    437414        function bp_get_group_description( $group = false ) {
     
    444421        }
    445422
    446 function bp_group_description_editable( $deprecated = false ) {
     423function bp_group_description_editable() {
    447424        echo bp_get_group_description_editable();
    448425}
     
    456433        }
    457434
    458 function bp_group_description_excerpt( $deprecated = false ) {
     435function bp_group_description_excerpt() {
    459436        echo bp_get_group_description_excerpt();
    460437}
     
    469446
    470447
    471 function bp_group_public_status( $deprecated = false ) {
     448function bp_group_public_status() {
    472449        echo bp_get_group_public_status();
    473450}
     
    485462        }
    486463
    487 function bp_group_is_public( $deprecated = false ) {
     464function bp_group_is_public() {
    488465        echo bp_get_group_is_public();
    489466}
     
    497474        }
    498475
    499 function bp_group_date_created( $deprecated = false ) {
     476function bp_group_date_created() {
    500477        echo bp_get_group_date_created();
    501478}
     
    521498}
    522499
    523 function bp_group_list_admins( $deprecated = true, $group = false ) {
     500function bp_group_list_admins( $group = false ) {
    524501        global $groups_template;
    525502
     
    541518}
    542519
    543 function bp_group_list_mods( $deprecated = true, $group = false ) {
     520function bp_group_list_mods( $group = false ) {
    544521        global $groups_template;
    545522
     
    561538}
    562539
    563 function bp_group_all_members_permalink( $deprecated = true, $deprecated2 = false ) {
    564         global $groups_template, $bp;
    565 
    566         if ( !$group )
    567                 $group =& $groups_template->group;
    568 
    569         if ( !$deprecated )
    570                 return bp_get_group_all_members_permalink();
    571         else
    572                 echo bp_get_group_all_members_permalink();
     540function bp_group_all_members_permalink() {
     541        echo bp_get_group_all_members_permalink();
    573542}
    574543        function bp_get_group_all_members_permalink( $group = false ) {
     
    636605}
    637606
    638 function bp_group_total_members( $deprecated = true, $deprecated2 = false ) {
    639         if ( !$deprecated )
    640                 return bp_get_group_total_members();
    641         else
    642                 echo bp_get_group_total_members();
    643 }
    644         function bp_get_group_total_members( $echo = true, $group = false ) {
     607function bp_group_total_members() {
     608        echo bp_get_group_total_members();
     609}
     610        function bp_get_group_total_members( $group = false ) {
    645611                global $groups_template;
    646612
     
    663629        }
    664630
    665 function bp_group_forum_permalink( $deprecated = false ) {
     631function bp_group_forum_permalink() {
    666632        echo bp_get_group_forum_permalink();
    667633}
     
    902868        }
    903869
    904 function bp_group_member_demote_link( $user_id = false, $deprecated = false ) {
     870function bp_group_member_demote_link( $user_id = false ) {
    905871        global $members_template;
    906872
     
    922888        }
    923889
    924 function bp_group_member_ban_link( $user_id = false, $deprecated = false ) {
     890function bp_group_member_ban_link( $user_id = false ) {
    925891        global $members_template;
    926892
     
    939905        }
    940906
    941 function bp_group_member_unban_link( $user_id = false, $deprecated = false ) {
     907function bp_group_member_unban_link( $user_id = false ) {
    942908        global $members_template;
    943909
     
    996962        }
    997963
    998 function bp_group_form_action( $page, $deprecated = false ) {
     964function bp_group_form_action( $page ) {
    999965        echo bp_get_group_form_action( $page );
    1000966}
     
    1008974        }
    1009975
    1010 function bp_group_admin_form_action( $page = false, $deprecated = false ) {
     976function bp_group_admin_form_action( $page = false ) {
    1011977        echo bp_get_group_admin_form_action( $page );
    1012978}
     
    10501016}
    10511017
    1052 function bp_group_accept_invite_link( $deprecated = false ) {
     1018function bp_group_accept_invite_link() {
    10531019        echo bp_get_group_accept_invite_link();
    10541020}
     
    10621028        }
    10631029
    1064 function bp_group_reject_invite_link( $deprecated = false ) {
     1030function bp_group_reject_invite_link() {
    10651031        echo bp_get_group_reject_invite_link();
    10661032}
     
    10741040        }
    10751041
    1076 function bp_group_leave_confirm_link( $deprecated = false ) {
     1042function bp_group_leave_confirm_link() {
    10771043        echo bp_get_group_leave_confirm_link();
    10781044}
     
    10861052        }
    10871053
    1088 function bp_group_leave_reject_link( $deprecated = false ) {
     1054function bp_group_leave_reject_link() {
    10891055        echo bp_get_group_leave_reject_link();
    10901056}
     
    10981064        }
    10991065
    1100 function bp_group_send_invite_form_action( $deprecated = false ) {
     1066function bp_group_send_invite_form_action() {
    11011067        echo bp_get_group_send_invite_form_action();
    11021068}
  • trunk/bp-messages.php

    r2678 r2695  
    8484}
    8585add_action( 'bp_setup_globals', 'messages_setup_globals' );
    86 add_action( 'admin_menu', 'messages_setup_globals', 2 );
    8786
    8887function messages_check_installed() {
     
    9392
    9493        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    95         if ( get_site_option('bp-messages-db-version') < BP_MESSAGES_DB_VERSION )
     94        if ( $bp->site_options['bp-messages-db-version'] < BP_MESSAGES_DB_VERSION )
    9695                messages_install();
    9796}
  • trunk/bp-themes/bp-default/_inc/css/adminbar.css

    r2670 r2695  
    1111        font-size: 11px;
    1212        width: 100%;
     13        z-index: 1000;
    1314}
    1415        #wp-admin-bar .padder {
  • trunk/bp-themes/bp-default/blogs/blogs-loop.php

    r2580 r2695  
    2222                <li>
    2323                        <div class="item-avatar">
    24                                 <a href="<?php bp_blog_permalink() ?>"><?php bp_blog_avatar_thumb() ?></a>
     24                                <a href="<?php bp_blog_permalink() ?>"><?php bp_blog_avatar('type=thumb') ?></a>
    2525                        </div>
    2626
  • trunk/bp-themes/bp-default/groups/single/forum/topic.php

    r2626 r2695  
    1 <?php if ( bp_has_topic_posts() ) : ?>
     1<?php if ( bp_has_forum_topic_posts() ) : ?>
    22
    33        <form action="<?php bp_forum_topic_action() ?>" method="post" id="forum-topic-form" class="standard-form">
     
    2525
    2626                <ul id="topic-post-list" class="item-list">
    27                         <?php while ( bp_topic_posts() ) : bp_the_topic_post(); ?>
     27                        <?php while ( bp_forum_topic_posts() ) : bp_the_forum_topic_post(); ?>
    2828
    2929                                <li id="post-<?php bp_the_topic_post_id() ?>">
  • trunk/bp-themes/bp-default/header.php

    r2649 r2695  
    6464                                        </li>
    6565
    66                                         <?php if ( bp_is_active( 'forums' ) && bp_is_active( 'groups' ) && ( function_exists( 'bp_forums_is_installed_correctly' ) && !(int) get_site_option( 'bp-disable-forum-directory' ) ) && bp_forums_is_installed_correctly() ) : ?>
     66                                        <?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() ) : ?>
    6767                                                <li<?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
    6868                                                        <a href="<?php echo site_url() ?>/<?php echo BP_FORUMS_SLUG ?>/" title="<?php _e( 'Forums', 'buddypress' ) ?>"><?php _e( 'Forums', 'buddypress' ) ?></a>
  • trunk/bp-themes/bp-default/members/single/home.php

    r2353 r2695  
    1313                                <div class="item-list-tabs no-ajax" id="object-nav">
    1414                                        <ul>
    15                                                 <?php bp_get_user_nav() ?>
     15                                                <?php bp_get_displayed_user_nav() ?>
    1616
    1717                                                <?php do_action( 'bp_members_directory_member_types' ) ?>
  • trunk/bp-themes/bp-default/members/single/plugins.php

    r2504 r2695  
    1313                                <div class="item-list-tabs no-ajax" id="object-nav">
    1414                                        <ul>
    15                                                 <?php bp_get_user_nav() ?>
     15                                                <?php bp_get_displayed_user_nav() ?>
    1616
    1717                                                <?php do_action( 'bp_members_directory_member_types' ) ?>
  • trunk/bp-themes/bp-default/members/single/profile/change-avatar.php

    r2558 r2695  
    33<?php do_action( 'bp_before_profile_avatar_upload_content' ) ?>
    44
    5 <?php if ( !(int)get_site_option( 'bp-disable-avatar-uploads' ) ) : ?>
     5<?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
    66
    77        <p><?php _e( 'Your avatar will be used on your profile and throughout the site. If there is a <a href="http://gravatar.com">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer.', 'buddypress') ?></p>
  • trunk/bp-themes/bp-default/registration/register.php

    r2626 r2695  
    228228                                <?php endif; ?>
    229229
    230                                 <?php if ( bp_is_active( 'xprofile' ) && !(int)get_site_option( 'bp-disable-avatar-uploads' ) ) : ?>
     230                                <?php if ( bp_is_active( 'xprofile' ) && !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
    231231
    232232                                        <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
  • trunk/bp-xprofile.php

    r2678 r2695  
    1212require ( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-cssjs.php' );
    1313
    14 /* Assign the base group and fullname field names to constants to use in SQL statements */
    15 define ( 'BP_XPROFILE_BASE_GROUP_NAME', get_site_option( 'bp-xprofile-base-group-name' ) );
    16 define ( 'BP_XPROFILE_FULLNAME_FIELD_NAME', get_site_option( 'bp-xprofile-fullname-field-name' ) );
    17 
    1814/**
    1915 * xprofile_install()
     
    3228                $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
    3329
    34         if ( '' == get_site_option( 'bp-xprofile-base-group-name' ) )
     30        if ( empty( $bp->option['bp-xprofile-base-group-name'] ) )
    3531                update_site_option( 'bp-xprofile-base-group-name', 'Base' );
    3632
    37         if ( '' == get_site_option( 'bp-xprofile-fullname-field-name' ) )
     33        if ( empty( $bp->option['bp-xprofile-fullname-field-name'] ) )
    3834                update_site_option( 'bp-xprofile-fullname-field-name', 'Name' );
    3935
     
    7672        ) {$charset_collate};";
    7773
    78         if ( '' == get_site_option( 'bp-xprofile-db-version' ) ) {
     74        if ( empty( $bp->option['bp-xprofile-db-version'] ) ) {
    7975                if ( !$wpdb->get_var( "SELECT id FROM {$bp->profile->table_name_groups} WHERE id = 1" ) )
    80                         $sql[] = "INSERT INTO {$bp->profile->table_name_groups} VALUES ( 1, '" . get_site_option( 'bp-xprofile-base-group-name' ) . "', '', 0 );";
     76                        $sql[] = "INSERT INTO {$bp->profile->table_name_groups} VALUES ( 1, '" . $bp->option['bp-xprofile-base-group-name'] . "', '', 0 );";
    8177
    8278                if ( !$wpdb->get_var( "SELECT id FROM {$bp->profile->table_name_fields} WHERE id = 1" ) ) {
     
    8480                                                id, group_id, parent_id, type, name, is_required, can_delete
    8581                                          ) VALUES (
    86                                                 1, 1, 0, 'textbox', '" . get_site_option( 'bp-xprofile-fullname-field-name' ) . "', 1, 0
     82                                                1, 1, 0, 'textbox', '" . $bp->option['bp-xprofile-fullname-field-name'] . "', 1, 0
    8783                                          );";
    8884                }
     
    110106        global $bp, $wpdb;
    111107
     108        /* Assign the base group and fullname field names to constants to use in SQL statements */
     109        define ( 'BP_XPROFILE_BASE_GROUP_NAME', $bp->site_options['bp-xprofile-base-group-name'] );
     110        define ( 'BP_XPROFILE_FULLNAME_FIELD_NAME', $bp->site_options['bp-xprofile-fullname-field-name'] );
     111
    112112        /* For internal identification */
    113113        $bp->profile->id = 'profile';
     
    129129}
    130130add_action( 'bp_setup_globals', 'xprofile_setup_globals' );
    131 add_action( 'admin_menu', 'xprofile_setup_globals', 2 );
    132131
    133132/**
     
    157156
    158157        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    159         if ( get_site_option('bp-xprofile-db-version') < BP_XPROFILE_DB_VERSION )
     158        if ( $bp->option['bp-xprofile-db-version'] < BP_XPROFILE_DB_VERSION )
    160159                xprofile_install();
    161160}
     
    868867        global $bp, $wpdb;
    869868
    870         if ( (int)get_site_option( 'bp-disable-profile-sync' ) )
     869        if ( (int)$bp->option['bp-disable-profile-sync'] )
    871870                return true;
    872871
  • trunk/bp-xprofile/bp-xprofile-templatetags.php

    r2635 r2695  
    170170        return $profile_template->has_fields();
    171171}
    172         /* Deprecated: Don't use this as it it too easily confused with site groups */
    173         function bp_group_has_fields() {
    174                 return bp_profile_group_has_fields();
    175         }
    176 
    177172
    178173function bp_field_css_class( $class = false ) {
     
    625620        global $bp;
    626621
    627         if ( !(int)get_site_option( 'bp-disable-avatar-uploads' ) )
     622        if ( !(int)$bp->site_options['bp-disable-avatar-uploads'] )
    628623                bp_core_avatar_admin( null, $bp->loggedin_user->domain . $bp->profile->slug . '/change-avatar/', $bp->loggedin_user->domain . $bp->profile->slug . '/delete-avatar/' );
    629624        else
Note: See TracChangeset for help on using the changeset viewer.