Changeset 2695
- Timestamp:
- 02/12/2010 12:31:49 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r2692 r2695 90 90 } 91 91 add_action( 'bp_setup_globals', 'bp_activity_setup_globals' ); 92 add_action( 'admin_menu', 'bp_activity_setup_globals', 2 );93 92 94 93 function bp_activity_check_installed() { 95 94 global $wpdb, $bp; 96 95 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 ) 98 97 bp_activity_install(); 99 98 } -
trunk/bp-activity/bp-activity-templatetags.php
r2692 r2695 23 23 24 24 /* 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']; 26 26 27 27 /* Get an array of the logged in user's favorite activities */ … … 165 165 'sort' => 'DESC', // sort DESC or ASC 166 166 'page' => 1, // which page to load 167 'per_page' => 2 5, // number of items per page167 'per_page' => 20, // number of items per page 168 168 'max' => false, // max number to return 169 169 'show_hidden' => $show_hidden, // Show activity items that are hidden site-wide? -
trunk/bp-blogs.php
r2684 r2695 64 64 65 65 // 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() ) { 67 67 bp_blogs_record_existing_blogs(); 68 68 add_site_option( 'bp-blogs-first-install', 1 ); … … 78 78 if ( is_site_admin() && bp_core_is_multisite() ) { 79 79 /* 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 ) 81 81 bp_blogs_install(); 82 82 } … … 103 103 } 104 104 add_action( 'bp_setup_globals', 'bp_blogs_setup_globals' ); 105 add_action( 'admin_menu', 'bp_blogs_setup_globals', 2 );106 105 107 106 function bp_blogs_setup_root_component() { … … 383 382 384 383 /* 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 ) 386 385 return false; 387 386 … … 408 407 if ( (int)get_blog_option( $blog_id, 'blog_public' ) || !bp_core_is_multisite() ) { 409 408 /* Record this in activity streams */ 410 $post_permalink = bp_post_get_permalink( $post, $blog_id );409 $post_permalink = get_permalink( $post_id ); 411 410 412 411 $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 206 206 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 ) ) ); 207 207 } 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'); }211 208 212 209 function bp_blog_permalink() { … … 302 299 303 300 function bp_blog_signup_enabled() { 304 $active_signup = get_site_option( 'registration' ); 301 global $bp; 302 303 $active_signup = $bp->site_options['registration']; 305 304 306 305 if ( !$active_signup ) -
trunk/bp-core.php
r2678 r2695 23 23 define( 'BP_ROOT_BLOG', 1 ); 24 24 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. */ 26 26 if ( !defined( 'CUSTOM_USER_TABLE' ) ) 27 27 define( 'CUSTOM_USER_TABLE', $wpdb->base_prefix . 'users' ); … … 40 40 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-notifications.php' ); 41 41 require ( 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. */ 44 if ( 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. */ 45 48 if ( !defined( 'BP_DISABLE_ADMIN_BAR' ) ) 46 49 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-adminbar.php' ); … … 61 64 if ( !defined( 'BP_SEARCH_SLUG' ) ) 62 65 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' );67 66 68 67 /* Register BuddyPress themes contained within the bp-theme folder */ … … 142 141 } 143 142 143 /* Fetches all of the core database based BuddyPress settings in one foul swoop */ 144 $bp->site_options = bp_core_get_site_options(); 145 144 146 /* Sets up the array container for the component navigation rendered by bp_get_nav() */ 145 147 $bp->bp_nav = array(); … … 148 150 $bp->bp_options_nav = array(); 149 151 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 156 152 /* Contains an array of all the active components. The key is the slug, value the internal ID of the component */ 157 153 $bp->active_components = array(); 158 154 159 155 /* 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'] ); 161 157 $bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', 'identicon' ); 162 158 $bp->grav_default->blog = apply_filters( 'bp_blog_gravatar_default', 'identicon' ); … … 183 179 } 184 180 add_action( 'bp_setup_globals', 'bp_core_setup_globals' ); 185 add_action( '_admin_menu', 'bp_core_setup_globals', 2 ); // must be _admin_menu hook.186 187 181 188 182 /** … … 202 196 bp_core_add_root_component( BP_ACTIVATION_SLUG ); 203 197 bp_core_add_root_component( BP_SEARCH_SLUG ); 204 bp_core_add_root_component( BP_HOME_BLOG_SLUG );205 198 } 206 199 add_action( 'plugins_loaded', 'bp_core_setup_root_uris', 2 ); … … 274 267 275 268 /* 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 ) 277 270 bp_core_install(); 278 271 } … … 558 551 return apply_filters( 'bp_core_get_user_domain', $domain ); 559 552 } 560 /* DEPRECATED */561 function bp_core_get_userurl( $uid ) { return bp_core_get_user_domain( $uid ); }562 553 563 554 /** … … 1077 1068 * @return str The link text based on passed parameters. 1078 1069 */ 1079 function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false , $deprecated = false, $with_s = false) {1070 function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false ) { 1080 1071 $display_name = bp_core_get_user_displayname( $user_id ); 1081 1072 … … 1083 1074 return false; 1084 1075 1085 if ( $with_s )1086 $display_name = sprintf( __( "%s's", 'buddypress' ), $display_name );1087 1088 1076 if ( $no_anchor ) 1089 1077 return $display_name; … … 1095 1083 return $url; 1096 1084 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 ); 1098 1086 } 1099 1087 … … 1533 1521 1534 1522 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 */ 1534 function 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 ); 1535 1579 } 1536 1580 -
trunk/bp-core/bp-core-adminbar.php
r2632 r2695 7 7 return false; 8 8 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() ) 10 10 return false; 11 11 -
trunk/bp-core/bp-core-avatars.php
r2418 r2695 8 8 * Set up the constants we need for avatar support 9 9 */ 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' ); 10 function 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 } 47 add_action( 'bp_init', 'bp_core_set_avatar_constants' ); 44 48 45 49 function bp_core_fetch_avatar( $args = '' ) { -
trunk/bp-core/bp-core-catchuri.php
r2525 r2695 214 214 status_header( 200 ); 215 215 $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; 219 217 } 220 218 -
trunk/bp-core/bp-core-classes.php
r2576 r2695 207 207 * 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) 208 208 */ 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 */ 216 216 $paged_users = BP_Core_User::get_user_extras( &$paged_users, $user_ids, $type ); 217 } 217 218 218 219 return array( 'users' => $paged_users, 'total' => $total_users ); -
trunk/bp-core/bp-core-cssjs.php
r2599 r2695 173 173 */ 174 174 function 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() ) ) { 176 178 ?> 177 179 <style type="text/css">body { padding-top: 0 !important; } #wp-admin-bar { display: none; }</style> -
trunk/bp-core/bp-core-settings.php
r2576 r2695 22 22 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() ) ); 23 23 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'] ) 25 25 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() ) ); 26 26 } -
trunk/bp-core/bp-core-signup.php
r2617 r2695 71 71 /* Finally, let's check the blog details, if the user wants a blog and blog creation is enabled */ 72 72 if ( isset( $_POST['signup_with_blog'] ) ) { 73 $active_signup = get_site_option( 'registration' );73 $active_signup = $bp->site_options['registration']; 74 74 75 75 if ( 'blog' == $active_signup || 'all' == $active_signup ) { … … 95 95 96 96 /* No errors! Let's register those deets. */ 97 $active_signup = get_site_option( 'registration' );97 $active_signup = $bp->site_options['registration']; 98 98 99 99 if ( 'none' != $active_signup ) { -
trunk/bp-core/bp-core-templatetags.php
r2690 r2695 393 393 </form> 394 394 <?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 else409 echo $bp->root_domain;410 395 } 411 396 … … 475 460 echo apply_filters( 'bp_logout_nav_link', $logout_link ); 476 461 } 477 /* DEPRECATED - use bp_get_loggedin_user_nav() */478 function bp_get_nav() { bp_get_loggedin_user_nav(); }479 462 480 463 /** … … 508 491 } 509 492 } 510 /* DEPRECATED - use bp_get_displayed_user_nav() */511 function bp_get_user_nav() { bp_get_displayed_user_nav(); }512 493 513 494 /** … … 874 855 global $bp, $is_member_page, $wp_query; 875 856 876 if ( $bp->current_component == BP_HOME_BLOG_SLUG )877 return true;878 879 857 if ( $wp_query->is_home && !$bp->is_directory ) 880 858 return true; … … 1001 979 } 1002 980 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'] ) { 1004 982 $selection_box .= '<option value="forums">' . __( 'Forums', 'buddypress' ) . '</option>'; 1005 983 } … … 1036 1014 1037 1015 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 <?php1056 do_action( 'bp_nav_items' );1057 1016 } 1058 1017 … … 1240 1199 } 1241 1200 function bp_get_signup_allowed() { 1201 global $bp; 1202 1242 1203 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' ) ) ) 1244 1205 return true; 1245 1206 } else { … … 1254 1215 } 1255 1216 function bp_get_blog_signup_allowed() { 1217 global $bp; 1218 1256 1219 if ( !bp_core_is_multisite() ) 1257 1220 return false; 1258 1221 1259 $status = get_site_option( 'registration' );1222 $status = $bp->site_options['registration']; 1260 1223 if ( 'none' != $status && 'user' != $status ) 1261 1224 return true; … … 1284 1247 } 1285 1248 1249 function bp_get_option( $option_name ) { 1250 global $bp; 1251 1252 return apply_filters( 'bp_get_option', $bp->site_options[$option_name] ); 1253 } 1286 1254 1287 1255 /*** CUSTOM LOOP TEMPLATE CLASSES *******************/ -
trunk/bp-core/bp-core-widgets.php
r2669 r2695 87 87 . $after_title; ?> 88 88 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' ) ) : ?> 90 90 <div class="item-options" id="members-list-options"> 91 91 <span class="ajax-loader" id="ajax-loader-members"></span> … … 255 255 global $bp; 256 256 257 check_ajax_referer( 'bp_core_widget_members');257 check_ajax_referer( 'bp_core_widget_members' ); 258 258 259 259 switch ( $_POST['filter'] ) { … … 267 267 $type = 'popular'; 268 268 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. ?> 272 273 <div class="avatar-block"> 273 274 <?php while ( bp_members() ) : bp_the_member(); ?> … … 279 280 <div class="item"> 280 281 <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 ) : ?> 282 283 <div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div> 283 284 <?php else : ?> -
trunk/bp-forums.php
r2678 r2695 21 21 22 22 $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']; 24 24 $bp->forums->slug = BP_FORUMS_SLUG; 25 25 … … 30 30 } 31 31 add_action( 'bp_setup_globals', 'bp_forums_setup' ); 32 add_action( 'admin_head', 'bp_forums_setup', 2 );33 32 34 33 function bp_forums_is_installed_correctly() { … … 51 50 52 51 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' ) ) 54 53 return false; 55 54 -
trunk/bp-forums/bp-forums-templatetags.php
r2641 r2695 209 209 return apply_filters( 'bp_has_topics', $forum_template->has_topics(), &$forum_template ); 210 210 } 211 /* DEPRECATED use bp_has_forum_topics() */212 function bp_has_topics( $args = '' ) { return bp_has_forum_topics( $args ); }213 211 214 212 function bp_forum_topics() { … … 216 214 return $forum_template->user_topics(); 217 215 } 218 /* DEPRECATED use bp_has_forum_topics() */219 function bp_topics() { return bp_forum_topics(); }220 216 221 217 function bp_the_forum_topic() { … … 223 219 return $forum_template->the_topic(); 224 220 } 225 /* DEPRECATED use bp_the_forum_topic() */226 function bp_the_topic() { return bp_the_forum_topic(); }227 221 228 222 function bp_the_topic_id() { … … 823 817 return apply_filters( 'bp_has_topic_posts', $topic_template->has_posts(), &$topic_template ); 824 818 } 825 /* DEPRECATED use bp_has_forum_topic_posts() */826 function bp_has_topic_posts() { return bp_has_forum_topic_posts( $args ); }827 819 828 820 function bp_forum_topic_posts() { … … 830 822 return $topic_template->user_posts(); 831 823 } 832 /* DEPRECATED use bp_forum_topic_posts() */833 function bp_topic_posts() { return bp_forum_topic_posts(); }834 824 835 825 function bp_the_forum_topic_post() { … … 837 827 return $topic_template->the_post(); 838 828 } 839 /* DEPRECATED use bp_the_forum_topic_post() */840 function bp_the_topic_post() { return bp_the_forum_topic_post(); }841 829 842 830 function bp_the_topic_post_id() { -
trunk/bp-friends.php
r2678 r2695 49 49 } 50 50 add_action( 'bp_setup_globals', 'friends_setup_globals' ); 51 add_action( 'admin_menu', 'friends_setup_globals', 2 );52 51 53 52 function friends_check_installed() { … … 58 57 59 58 /* 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 ) 61 60 friends_install(); 62 61 } -
trunk/bp-groups.php
r2684 r2695 100 100 } 101 101 add_action( 'bp_setup_globals', 'groups_setup_globals' ); 102 add_action( 'admin_menu', 'groups_setup_globals', 2 );103 102 104 103 function groups_setup_root_component() { … … 110 109 function groups_check_installed() { 111 110 /* 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 ) 113 112 groups_install(); 114 113 } -
trunk/bp-groups/bp-groups-templatetags.php
r2626 r2695 255 255 } 256 256 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(); 257 function bp_group_id() { 258 echo bp_get_group_id(); 265 259 } 266 260 function bp_get_group_id( $group = false ) { … … 273 267 } 274 268 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(); 269 function bp_group_name() { 270 echo bp_get_group_name(); 282 271 } 283 272 function bp_get_group_name( $group = false ) { … … 363 352 } 364 353 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(); 354 function bp_group_last_active() { 355 echo bp_get_group_last_active(); 370 356 } 371 357 function bp_get_group_last_active( $group = false ) { … … 387 373 } 388 374 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(); 375 function bp_group_permalink() { 376 echo bp_get_group_permalink(); 394 377 } 395 378 function bp_get_group_permalink( $group = false ) { … … 402 385 } 403 386 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(); 387 function bp_group_admin_permalink() { 388 echo bp_get_group_admin_permalink(); 409 389 } 410 390 function bp_get_group_admin_permalink( $group = false ) { … … 429 409 } 430 410 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(); 411 function bp_group_description() { 412 echo bp_get_group_description(); 436 413 } 437 414 function bp_get_group_description( $group = false ) { … … 444 421 } 445 422 446 function bp_group_description_editable( $deprecated = false) {423 function bp_group_description_editable() { 447 424 echo bp_get_group_description_editable(); 448 425 } … … 456 433 } 457 434 458 function bp_group_description_excerpt( $deprecated = false) {435 function bp_group_description_excerpt() { 459 436 echo bp_get_group_description_excerpt(); 460 437 } … … 469 446 470 447 471 function bp_group_public_status( $deprecated = false) {448 function bp_group_public_status() { 472 449 echo bp_get_group_public_status(); 473 450 } … … 485 462 } 486 463 487 function bp_group_is_public( $deprecated = false) {464 function bp_group_is_public() { 488 465 echo bp_get_group_is_public(); 489 466 } … … 497 474 } 498 475 499 function bp_group_date_created( $deprecated = false) {476 function bp_group_date_created() { 500 477 echo bp_get_group_date_created(); 501 478 } … … 521 498 } 522 499 523 function bp_group_list_admins( $ deprecated = true, $group = false ) {500 function bp_group_list_admins( $group = false ) { 524 501 global $groups_template; 525 502 … … 541 518 } 542 519 543 function bp_group_list_mods( $ deprecated = true, $group = false ) {520 function bp_group_list_mods( $group = false ) { 544 521 global $groups_template; 545 522 … … 561 538 } 562 539 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(); 540 function bp_group_all_members_permalink() { 541 echo bp_get_group_all_members_permalink(); 573 542 } 574 543 function bp_get_group_all_members_permalink( $group = false ) { … … 636 605 } 637 606 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 ) { 607 function bp_group_total_members() { 608 echo bp_get_group_total_members(); 609 } 610 function bp_get_group_total_members( $group = false ) { 645 611 global $groups_template; 646 612 … … 663 629 } 664 630 665 function bp_group_forum_permalink( $deprecated = false) {631 function bp_group_forum_permalink() { 666 632 echo bp_get_group_forum_permalink(); 667 633 } … … 902 868 } 903 869 904 function bp_group_member_demote_link( $user_id = false , $deprecated = false) {870 function bp_group_member_demote_link( $user_id = false ) { 905 871 global $members_template; 906 872 … … 922 888 } 923 889 924 function bp_group_member_ban_link( $user_id = false , $deprecated = false) {890 function bp_group_member_ban_link( $user_id = false ) { 925 891 global $members_template; 926 892 … … 939 905 } 940 906 941 function bp_group_member_unban_link( $user_id = false , $deprecated = false) {907 function bp_group_member_unban_link( $user_id = false ) { 942 908 global $members_template; 943 909 … … 996 962 } 997 963 998 function bp_group_form_action( $page , $deprecated = false) {964 function bp_group_form_action( $page ) { 999 965 echo bp_get_group_form_action( $page ); 1000 966 } … … 1008 974 } 1009 975 1010 function bp_group_admin_form_action( $page = false , $deprecated = false) {976 function bp_group_admin_form_action( $page = false ) { 1011 977 echo bp_get_group_admin_form_action( $page ); 1012 978 } … … 1050 1016 } 1051 1017 1052 function bp_group_accept_invite_link( $deprecated = false) {1018 function bp_group_accept_invite_link() { 1053 1019 echo bp_get_group_accept_invite_link(); 1054 1020 } … … 1062 1028 } 1063 1029 1064 function bp_group_reject_invite_link( $deprecated = false) {1030 function bp_group_reject_invite_link() { 1065 1031 echo bp_get_group_reject_invite_link(); 1066 1032 } … … 1074 1040 } 1075 1041 1076 function bp_group_leave_confirm_link( $deprecated = false) {1042 function bp_group_leave_confirm_link() { 1077 1043 echo bp_get_group_leave_confirm_link(); 1078 1044 } … … 1086 1052 } 1087 1053 1088 function bp_group_leave_reject_link( $deprecated = false) {1054 function bp_group_leave_reject_link() { 1089 1055 echo bp_get_group_leave_reject_link(); 1090 1056 } … … 1098 1064 } 1099 1065 1100 function bp_group_send_invite_form_action( $deprecated = false) {1066 function bp_group_send_invite_form_action() { 1101 1067 echo bp_get_group_send_invite_form_action(); 1102 1068 } -
trunk/bp-messages.php
r2678 r2695 84 84 } 85 85 add_action( 'bp_setup_globals', 'messages_setup_globals' ); 86 add_action( 'admin_menu', 'messages_setup_globals', 2 );87 86 88 87 function messages_check_installed() { … … 93 92 94 93 /* 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 ) 96 95 messages_install(); 97 96 } -
trunk/bp-themes/bp-default/_inc/css/adminbar.css
r2670 r2695 11 11 font-size: 11px; 12 12 width: 100%; 13 z-index: 1000; 13 14 } 14 15 #wp-admin-bar .padder { -
trunk/bp-themes/bp-default/blogs/blogs-loop.php
r2580 r2695 22 22 <li> 23 23 <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> 25 25 </div> 26 26 -
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() ) : ?> 2 2 3 3 <form action="<?php bp_forum_topic_action() ?>" method="post" id="forum-topic-form" class="standard-form"> … … 25 25 26 26 <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(); ?> 28 28 29 29 <li id="post-<?php bp_the_topic_post_id() ?>"> -
trunk/bp-themes/bp-default/header.php
r2649 r2695 64 64 </li> 65 65 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() ) : ?> 67 67 <li<?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?> class="selected"<?php endif; ?>> 68 68 <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 13 13 <div class="item-list-tabs no-ajax" id="object-nav"> 14 14 <ul> 15 <?php bp_get_ user_nav() ?>15 <?php bp_get_displayed_user_nav() ?> 16 16 17 17 <?php do_action( 'bp_members_directory_member_types' ) ?> -
trunk/bp-themes/bp-default/members/single/plugins.php
r2504 r2695 13 13 <div class="item-list-tabs no-ajax" id="object-nav"> 14 14 <ul> 15 <?php bp_get_ user_nav() ?>15 <?php bp_get_displayed_user_nav() ?> 16 16 17 17 <?php do_action( 'bp_members_directory_member_types' ) ?> -
trunk/bp-themes/bp-default/members/single/profile/change-avatar.php
r2558 r2695 3 3 <?php do_action( 'bp_before_profile_avatar_upload_content' ) ?> 4 4 5 <?php if ( !(int) get_site_option( 'bp-disable-avatar-uploads' ) ) : ?>5 <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?> 6 6 7 7 <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 228 228 <?php endif; ?> 229 229 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' ) ) : ?> 231 231 232 232 <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?> -
trunk/bp-xprofile.php
r2678 r2695 12 12 require ( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-cssjs.php' ); 13 13 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 18 14 /** 19 15 * xprofile_install() … … 32 28 $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; 33 29 34 if ( '' == get_site_option( 'bp-xprofile-base-group-name') )30 if ( empty( $bp->option['bp-xprofile-base-group-name'] ) ) 35 31 update_site_option( 'bp-xprofile-base-group-name', 'Base' ); 36 32 37 if ( '' == get_site_option( 'bp-xprofile-fullname-field-name') )33 if ( empty( $bp->option['bp-xprofile-fullname-field-name'] ) ) 38 34 update_site_option( 'bp-xprofile-fullname-field-name', 'Name' ); 39 35 … … 76 72 ) {$charset_collate};"; 77 73 78 if ( '' == get_site_option( 'bp-xprofile-db-version') ) {74 if ( empty( $bp->option['bp-xprofile-db-version'] ) ) { 79 75 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 );"; 81 77 82 78 if ( !$wpdb->get_var( "SELECT id FROM {$bp->profile->table_name_fields} WHERE id = 1" ) ) { … … 84 80 id, group_id, parent_id, type, name, is_required, can_delete 85 81 ) VALUES ( 86 1, 1, 0, 'textbox', '" . get_site_option( 'bp-xprofile-fullname-field-name' ). "', 1, 082 1, 1, 0, 'textbox', '" . $bp->option['bp-xprofile-fullname-field-name'] . "', 1, 0 87 83 );"; 88 84 } … … 110 106 global $bp, $wpdb; 111 107 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 112 112 /* For internal identification */ 113 113 $bp->profile->id = 'profile'; … … 129 129 } 130 130 add_action( 'bp_setup_globals', 'xprofile_setup_globals' ); 131 add_action( 'admin_menu', 'xprofile_setup_globals', 2 );132 131 133 132 /** … … 157 156 158 157 /* 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 ) 160 159 xprofile_install(); 161 160 } … … 868 867 global $bp, $wpdb; 869 868 870 if ( (int) get_site_option( 'bp-disable-profile-sync' ))869 if ( (int)$bp->option['bp-disable-profile-sync'] ) 871 870 return true; 872 871 -
trunk/bp-xprofile/bp-xprofile-templatetags.php
r2635 r2695 170 170 return $profile_template->has_fields(); 171 171 } 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 177 172 178 173 function bp_field_css_class( $class = false ) { … … 625 620 global $bp; 626 621 627 if ( !(int) get_site_option( 'bp-disable-avatar-uploads' ))622 if ( !(int)$bp->site_options['bp-disable-avatar-uploads'] ) 628 623 bp_core_avatar_admin( null, $bp->loggedin_user->domain . $bp->profile->slug . '/change-avatar/', $bp->loggedin_user->domain . $bp->profile->slug . '/delete-avatar/' ); 629 624 else
Note: See TracChangeset
for help on using the changeset viewer.