Changeset 5301
- Timestamp:
- 11/08/2011 01:14:31 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 46 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-functions.php
r5262 r5301 251 251 // Fallback to logged in user if no user_id is passed 252 252 if ( empty( $user_id ) ) 253 $user_id = $bp->displayed_user->id;253 $user_id = bp_displayed_user_id(); 254 254 255 255 // Get favorites for user … … 431 431 // Fallback on displayed user, and then logged in user 432 432 if ( empty( $user_id ) ) 433 $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id: $bp->loggedin_user->id;433 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : $bp->loggedin_user->id; 434 434 435 435 return BP_Activity_Activity::total_favorite_count( $user_id ); -
trunk/bp-activity/bp-activity-loader.php
r5300 r5301 124 124 125 125 // Stop if there is no user displayed or logged in 126 if ( !is_user_logged_in() && ! isset( $bp->displayed_user->id) )126 if ( !is_user_logged_in() && !bp_displayed_user_id() ) 127 127 return; 128 128 … … 308 308 } else { 309 309 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 310 'item_id' => $bp->displayed_user->id,310 'item_id' => bp_displayed_user_id(), 311 311 'type' => 'thumb' 312 312 ) ); -
trunk/bp-activity/bp-activity-screens.php
r5259 r5301 268 268 global $bp; 269 269 270 if ( !$mention = bp_get_user_meta( $bp->displayed_user->id, 'notification_activity_new_mention', true ) )270 if ( !$mention = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_mention', true ) ) 271 271 $mention = 'yes'; 272 272 273 if ( !$reply = bp_get_user_meta( $bp->displayed_user->id, 'notification_activity_new_reply', true ) )273 if ( !$reply = bp_get_user_meta( bp_displayed_user_id(), 'notification_activity_new_reply', true ) ) 274 274 $reply = 'yes'; ?> 275 275 … … 287 287 <tr id="activity-notification-settings-mentions"> 288 288 <td> </td> 289 <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) ?></td>289 <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( bp_displayed_user_id(), $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) ?></td> 290 290 <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php checked( $mention, 'yes', true ) ?>/></td> 291 291 <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php checked( $mention, 'no', true ) ?>/></td> -
trunk/bp-activity/bp-activity-template.php
r5262 r5301 265 265 266 266 // User filtering 267 if ( !empty( $bp->displayed_user->id) )268 $user_id = $bp->displayed_user->id;267 if ( bp_displayed_user_id() ) 268 $user_id = bp_displayed_user_id(); 269 269 270 270 // Group filtering … … 325 325 // determine which user_id applies 326 326 if ( empty( $user_id ) ) 327 $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id: $bp->loggedin_user->id;327 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : $bp->loggedin_user->id; 328 328 329 329 // are we displaying user specific activity? … … 361 361 break; 362 362 case 'mentions': 363 $user_nicename = ( !empty( $bp->displayed_user->id) ) ? $bp->displayed_user->userdata->user_nicename : $bp->loggedin_user->userdata->user_nicename;364 $user_login = ( !empty( $bp->displayed_user->id) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;363 $user_nicename = ( bp_displayed_user_id() ) ? $bp->displayed_user->userdata->user_nicename : $bp->loggedin_user->userdata->user_nicename; 364 $user_login = ( bp_displayed_user_id() ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login; 365 365 $search_terms = '@' . bp_core_get_username( $user_id, $user_nicename, $user_login ) . '<'; // Start search at @ symbol and stop search at closing tag delimiter. 366 366 $display_comments = 'stream'; … … 2044 2044 2045 2045 if ( !$user_id ) 2046 $user_id = $bp->displayed_user->id;2046 $user_id = bp_displayed_user_id(); 2047 2047 2048 2048 if ( bp_core_is_user_spammer( $user_id ) || bp_core_is_user_deleted( $user_id ) ) … … 2310 2310 return false; 2311 2311 2312 return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_activity_slug() . '/?r=' . bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );2312 return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_activity_slug() . '/?r=' . bp_core_get_username( bp_displayed_user_id(), $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) ); 2313 2313 } 2314 2314 -
trunk/bp-activity/feeds/bp-activity-favorites-feed.php
r5109 r5301 36 36 37 37 <?php 38 $favs = bp_activity_get_user_favorites( $bp->displayed_user->id);38 $favs = bp_activity_get_user_favorites( bp_displayed_user_id() ); 39 39 $fav_ids = implode( ',', (array)$favs ); 40 40 ?> -
trunk/bp-activity/feeds/bp-activity-mentions-feed.php
r5109 r5301 34 34 <?php do_action('bp_activity_mentions_feed_head'); ?> 35 35 36 <?php if ( bp_has_activities( 'max=50&display_comments=stream&search_terms=@' . bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) ) : ?>36 <?php if ( bp_has_activities( 'max=50&display_comments=stream&search_terms=@' . bp_core_get_username( bp_displayed_user_id(), $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) ) : ?> 37 37 <?php while ( bp_activities() ) : bp_the_activity(); ?> 38 38 <item> -
trunk/bp-activity/feeds/bp-activity-personal-feed.php
r5109 r5301 34 34 <?php do_action('bp_activity_personal_feed_head'); ?> 35 35 36 <?php if ( bp_has_activities( 'user_id=' . $bp->displayed_user->id. '&max=50&display_comments=stream' ) ) : ?>36 <?php if ( bp_has_activities( 'user_id=' . bp_displayed_user_id() . '&max=50&display_comments=stream' ) ) : ?> 37 37 <?php while ( bp_activities() ) : bp_the_activity(); ?> 38 38 <item> -
trunk/bp-blogs/bp-blogs-classes.php
r4819 r5301 15 15 global $bp, $wpdb; 16 16 17 $user_id = $bp->displayed_user->id;17 $user_id = bp_displayed_user_id(); 18 18 19 19 if ( $id ) { … … 151 151 152 152 if ( !$user_id ) 153 $user_id = $bp->displayed_user->id;153 $user_id = bp_displayed_user_id(); 154 154 155 155 // Show logged in users their hidden blogs. … … 177 177 178 178 if ( !$user_id ) 179 $user_id = $bp->displayed_user->id;179 $user_id = bp_displayed_user_id(); 180 180 181 181 return $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$bp->blogs->table_name} WHERE user_id = %d", $user_id ) ); … … 192 192 193 193 if ( !$user_id ) 194 $user_id = $bp->displayed_user->id;194 $user_id = bp_displayed_user_id(); 195 195 196 196 // If the user is logged in return the blog count including their hidden blogs. -
trunk/bp-blogs/bp-blogs-functions.php
r5248 r5301 411 411 412 412 if ( !$user_id ) 413 $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id: $bp->loggedin_user->id;413 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : $bp->loggedin_user->id; 414 414 415 415 if ( !$count = wp_cache_get( 'bp_total_blogs_for_user_' . $user_id, 'bp' ) ) { -
trunk/bp-blogs/bp-blogs-loader.php
r5300 r5301 182 182 } else { 183 183 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 184 'item_id' => $bp->displayed_user->id,184 'item_id' => bp_displayed_user_id(), 185 185 'type' => 'thumb' 186 186 ) ); -
trunk/bp-blogs/bp-blogs-template.php
r4961 r5301 204 204 205 205 /* User filtering */ 206 if ( !empty( $bp->displayed_user->id) )207 $user_id = $bp->displayed_user->id;206 if ( bp_displayed_user_id() ) 207 $user_id = bp_displayed_user_id(); 208 208 209 209 $defaults = array( -
trunk/bp-core/bp-core-avatars.php
r5233 r5301 115 115 if ( !$item_id ) { 116 116 if ( 'user' == $object ) 117 $item_id = $bp->displayed_user->id;117 $item_id = bp_displayed_user_id(); 118 118 else if ( bp_is_active( 'groups' ) && 'group' == $object ) 119 119 $item_id = $bp->groups->current_group->id; … … 327 327 if ( !$item_id ) { 328 328 if ( 'user' == $object ) 329 $item_id = $bp->displayed_user->id;329 $item_id = bp_displayed_user_id(); 330 330 else if ( 'group' == $object ) 331 331 $item_id = $bp->groups->current_group->id; -
trunk/bp-core/bp-core-catchuri.php
r5238 r5301 238 238 239 239 // Switch the displayed_user based on compatbility mode 240 if ( bp_is_username_compatibility_mode() ) 240 if ( bp_is_username_compatibility_mode() ) { 241 241 $bp->displayed_user->id = (int) bp_core_get_userid( urldecode( $bp_uri[$uri_offset + 1] ) ); 242 else242 } else { 243 243 $bp->displayed_user->id = (int) bp_core_get_userid_from_nicename( urldecode( $bp_uri[$uri_offset + 1] ) ); 244 245 if ( empty( $bp->displayed_user->id ) ) { 244 } 245 246 if ( !bp_displayed_user_id() ) { 247 246 248 // Prevent components from loading their templates 247 249 $bp->current_component = ''; … … 253 255 // If the displayed user is marked as a spammer, 404 (unless logged- 254 256 // in user is a super admin) 255 if ( !empty( $bp->displayed_user->id ) && bp_core_is_user_spammer( $bp->displayed_user->id) ) {257 if ( bp_displayed_user_id() && bp_core_is_user_spammer( bp_displayed_user_id() ) ) { 256 258 if ( is_super_admin() ) { 257 259 bp_core_add_message( __( 'This user has been marked as a spammer. Only site admins can view this profile.', 'buddypress' ), 'error' ); -
trunk/bp-core/bp-core-template.php
r5153 r5301 200 200 $youtext = bp_core_ucfirst($youtext); 201 201 202 if ( $bp->displayed_user->id== $bp->loggedin_user->id ) {202 if ( bp_displayed_user_id() == $bp->loggedin_user->id ) { 203 203 if ( $echo ) 204 204 echo apply_filters( 'bp_word_or_name', $youtext ); … … 1083 1083 global $bp; 1084 1084 1085 if ( is_user_logged_in() && $bp->loggedin_user->id == $bp->displayed_user->id)1085 if ( is_user_logged_in() && $bp->loggedin_user->id == bp_displayed_user_id() ) 1086 1086 $my_profile = true; 1087 1087 else … … 1094 1094 global $bp; 1095 1095 1096 if ( !empty( $bp->displayed_user->id) )1096 if ( bp_displayed_user_id() ) 1097 1097 return true; 1098 1098 -
trunk/bp-core/deprecated/1.5.php
r5296 r5301 130 130 global $bp; 131 131 132 $ud = get_userdata( $bp->displayed_user->id); ?>132 $ud = get_userdata( bp_displayed_user_id() ); ?> 133 133 134 134 <div class="bp-widget wp-profile"> -
trunk/bp-forums/bp-forums-functions.php
r5245 r5301 316 316 317 317 if ( !$user_id ) 318 $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id: $bp->loggedin_user->id;318 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : $bp->loggedin_user->id; 319 319 320 320 if ( class_exists( 'BB_Query' ) ) { -
trunk/bp-forums/bp-forums-loader.php
r5300 r5301 104 104 105 105 // Stop if there is no user displayed or logged in 106 if ( !is_user_logged_in() && ! isset( $bp->displayed_user->id) )106 if ( !is_user_logged_in() && !bp_displayed_user_id() ) 107 107 return; 108 108 … … 238 238 } else { 239 239 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 240 'item_id' => $bp->displayed_user->id,240 'item_id' => bp_displayed_user_id(), 241 241 'type' => 'thumb' 242 242 ) ); -
trunk/bp-forums/bp-forums-template.php
r5206 r5301 269 269 270 270 // User filtering 271 if ( !empty( $bp->displayed_user->id) )272 $user_id = $bp->displayed_user->id;271 if ( bp_displayed_user_id() ) 272 $user_id = bp_displayed_user_id(); 273 273 274 274 // "Replied" query must be manually modified -
trunk/bp-friends/bp-friends-classes.php
r4934 r5301 42 42 43 43 // if running from ajax. 44 if ( ! $bp->displayed_user->id)44 if ( !bp_displayed_user_id() ) 45 45 $bp->displayed_user->id = $creds['current_userid']; 46 46 47 47 if ( $this->populate_friend_details ) { 48 if ( $this->friend_user_id == $bp->displayed_user->id) {48 if ( $this->friend_user_id == bp_displayed_user_id() ) { 49 49 $this->friend = new BP_Core_User( $this->initiator_user_id ); 50 50 } else { … … 127 127 128 128 if ( !$user_id ) 129 $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id: $bp->loggedin_user->id;129 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : $bp->loggedin_user->id; 130 130 131 131 /* This is stored in 'total_friend_count' usermeta. -
trunk/bp-friends/bp-friends-functions.php
r4961 r5301 58 58 59 59 // Remove the activity stream item for the user who canceled the friendship 60 friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_accepted', 'user_id' => $bp->displayed_user->id) );60 friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_accepted', 'user_id' => bp_displayed_user_id() ) ); 61 61 62 62 do_action( 'friends_friendship_deleted', $friendship_id, $initiator_userid, $friend_userid ); … … 152 152 153 153 if ( !$user_id ) 154 $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id: $bp->loggedin_user->id;154 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : $bp->loggedin_user->id; 155 155 156 156 if ( !$count = wp_cache_get( 'bp_total_friend_count_' . $user_id, 'bp' ) ) { -
trunk/bp-friends/bp-friends-loader.php
r5300 r5301 197 197 } else { 198 198 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 199 'item_id' => $bp->displayed_user->id,199 'item_id' => bp_displayed_user_id(), 200 200 'type' => 'thumb' 201 201 ) ); -
trunk/bp-friends/bp-friends-screens.php
r4961 r5301 55 55 global $bp; 56 56 57 if ( !$send_requests = bp_get_user_meta( $bp->displayed_user->id, 'notification_friends_friendship_request', true ) )57 if ( !$send_requests = bp_get_user_meta( bp_displayed_user_id(), 'notification_friends_friendship_request', true ) ) 58 58 $send_requests = 'yes'; 59 59 60 if ( !$accept_requests = bp_get_user_meta( $bp->displayed_user->id, 'notification_friends_friendship_accepted', true ) )60 if ( !$accept_requests = bp_get_user_meta( bp_displayed_user_id(), 'notification_friends_friendship_accepted', true ) ) 61 61 $accept_requests = 'yes'; 62 62 ?> -
trunk/bp-friends/bp-friends-template.php
r4961 r5301 93 93 global $bp; 94 94 95 if ( !$friend_ids = wp_cache_get( 'friends_friend_ids_' . $bp->displayed_user->id, 'bp' ) ) {96 $friend_ids = BP_Friends_Friendship::get_random_friends( $bp->displayed_user->id);97 wp_cache_set( 'friends_friend_ids_' . $bp->displayed_user->id, $friend_ids, 'bp' );95 if ( !$friend_ids = wp_cache_get( 'friends_friend_ids_' . bp_displayed_user_id(), 'bp' ) ) { 96 $friend_ids = BP_Friends_Friendship::get_random_friends( bp_displayed_user_id() ); 97 wp_cache_set( 'friends_friend_ids_' . bp_displayed_user_id(), $friend_ids, 'bp' ); 98 98 } ?> 99 99 100 100 <div class="info-group"> 101 <h4><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?> (<?php echo BP_Friends_Friendship::total_friend_count( $bp->displayed_user->id) ?>) <span><a href="<?php echo $bp->displayed_user->domain . bp_get_friends_slug() ?>"><?php _e('See All', 'buddypress') ?></a></span></h4>101 <h4><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?> (<?php echo BP_Friends_Friendship::total_friend_count( bp_displayed_user_id() ) ?>) <span><a href="<?php echo $bp->displayed_user->domain . bp_get_friends_slug() ?>"><?php _e('See All', 'buddypress') ?></a></span></h4> 102 102 103 103 <?php if ( $friend_ids ) { ?> … … 208 208 <?php wp_nonce_field( 'friends_search', '_wpnonce_friend_search' ) ?> 209 209 210 <input type="hidden" name="initiator" id="initiator" value="<?php echo esc_attr( $bp->displayed_user->id) ?>" />210 <input type="hidden" name="initiator" id="initiator" value="<?php echo esc_attr( bp_displayed_user_id() ) ?>" /> 211 211 212 212 </form> … … 268 268 $user_id = $friends_template->friendship->friend->id; 269 269 else if ( empty( $user_id ) && !isset( $friends_template->friendship->friend ) ) 270 $user_id = $bp->displayed_user->id;270 $user_id = bp_displayed_user_id(); 271 271 272 272 return apply_filters( 'bp_get_potential_friend_id', (int)$user_id ); … … 370 370 371 371 if ( !$user_id ) 372 $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id: $bp->loggedin_user->id;372 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : $bp->loggedin_user->id; 373 373 374 374 $friend_ids = friends_get_friend_user_ids( $user_id ); -
trunk/bp-groups/bp-groups-classes.php
r5139 r5301 176 176 177 177 if ( !$user_id ) 178 $user_id = $bp->displayed_user->id;178 $user_id = bp_displayed_user_id(); 179 179 180 180 $filter = like_escape( $wpdb->escape( $filter ) ); … … 937 937 938 938 if ( !$user_id ) 939 $user_id = $bp->displayed_user->id;939 $user_id = bp_displayed_user_id(); 940 940 941 941 if ( $user_id != $bp->loggedin_user->id && !is_super_admin() ) { -
trunk/bp-groups/bp-groups-functions.php
r5140 r5301 398 398 399 399 if ( !$user_id ) 400 $user_id = $bp->displayed_user->id;400 $user_id = bp_displayed_user_id(); 401 401 402 402 return BP_Groups_Member::get_group_ids( $user_id, $pag_num, $pag_page ); … … 407 407 408 408 if ( !$user_id ) 409 $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id: $bp->loggedin_user->id;409 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : $bp->loggedin_user->id; 410 410 411 411 if ( !$count = wp_cache_get( 'bp_total_groups_for_user_' . $user_id, 'bp' ) ) { -
trunk/bp-groups/bp-groups-loader.php
r5300 r5301 448 448 449 449 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 450 'item_id' => $bp->displayed_user->id,450 'item_id' => bp_displayed_user_id(), 451 451 'type' => 'thumb' 452 452 ) ); -
trunk/bp-groups/bp-groups-screens.php
r5204 r5301 812 812 global $bp; 813 813 814 if ( !$group_invite = bp_get_user_meta( $bp->displayed_user->id, 'notification_groups_invite', true ) )814 if ( !$group_invite = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_invite', true ) ) 815 815 $group_invite = 'yes'; 816 816 817 if ( !$group_update = bp_get_user_meta( $bp->displayed_user->id, 'notification_groups_group_updated', true ) )817 if ( !$group_update = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_group_updated', true ) ) 818 818 $group_update = 'yes'; 819 819 820 if ( !$group_promo = bp_get_user_meta( $bp->displayed_user->id, 'notification_groups_admin_promotion', true ) )820 if ( !$group_promo = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_admin_promotion', true ) ) 821 821 $group_promo = 'yes'; 822 822 823 if ( !$group_request = bp_get_user_meta( $bp->displayed_user->id, 'notification_groups_membership_request', true ) )823 if ( !$group_request = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_membership_request', true ) ) 824 824 $group_request = 'yes'; 825 825 ?> -
trunk/bp-groups/bp-groups-template.php
r5189 r5301 238 238 239 239 // User filtering 240 if ( !empty( $bp->displayed_user->id) )241 $user_id = $bp->displayed_user->id;240 if ( bp_displayed_user_id() ) 241 $user_id = bp_displayed_user_id(); 242 242 243 243 // Type … … 698 698 699 699 function bp_group_show_no_groups_message() { 700 global $bp; 701 702 if ( !groups_total_groups_for_user( $bp->displayed_user->id ) ) 700 if ( !groups_total_groups_for_user( bp_displayed_user_id() ) ) 703 701 return true; 704 702 -
trunk/bp-members/bp-members-actions.php
r4961 r5301 123 123 global $bp; 124 124 125 if ( !is_super_admin() || bp_is_my_profile() || ! $bp->displayed_user->id)125 if ( !is_super_admin() || bp_is_my_profile() || !bp_displayed_user_id() ) 126 126 return false; 127 127 … … 133 133 do_action( 'bp_core_before_action_delete_user', $errors ); 134 134 135 if ( bp_core_delete_account( $bp->displayed_user->id) ) {135 if ( bp_core_delete_account( bp_displayed_user_id() ) ) { 136 136 bp_core_add_message( sprintf( __( '%s has been deleted from the system.', 'buddypress' ), $bp->displayed_user->fullname ) ); 137 137 } else { -
trunk/bp-members/bp-members-adminbar.php
r5289 r5301 109 109 // User avatar 110 110 $avatar = bp_core_fetch_avatar( array( 111 'item_id' => $bp->displayed_user->id,111 'item_id' => bp_displayed_user_id(), 112 112 'email' => $bp->displayed_user->userdata->user_email, 113 113 'width' => 16, -
trunk/bp-members/bp-members-buddybar.php
r4961 r5301 92 92 93 93 // Only show if viewing a user 94 if ( ! $bp->displayed_user->id)94 if ( !bp_displayed_user_id() ) 95 95 return false; 96 96 … … 112 112 <li><a href="<?php bp_members_component_link( 'profile', 'change-avatar' ); ?>"><?php printf( __( "Edit %s's Avatar", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ) ?></a></li> 113 113 114 <?php if ( !bp_core_is_user_spammer( $bp->displayed_user->id) ) : ?>114 <?php if ( !bp_core_is_user_spammer( bp_displayed_user_id() ) ) : ?> 115 115 116 116 <li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain . 'admin/mark-spammer/', 'mark-unmark-spammer' ) ?>" class="confirm"><?php printf( __( "Mark as Spammer", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ); ?></a></li> -
trunk/bp-members/bp-members-functions.php
r5238 r5301 218 218 219 219 // User ID matches displayed in user 220 } elseif ( isset( $bp->displayed_user->id ) && $bp->displayed_user->id== $user_id ) {220 } elseif ( bp_displayed_user_id() == $user_id ) { 221 221 $userdata = &$bp->displayed_user->userdata; 222 222 … … 290 290 291 291 // User ID matches displayed in user 292 } elseif ( isset( $bp->displayed_user->id ) && $bp->displayed_user->id== $user_id ) {292 } elseif ( bp_displayed_user_id() == $user_id ) { 293 293 $userdata = &$bp->displayed_user->userdata; 294 294 … … 576 576 577 577 if ( empty( $user_id ) ) 578 $user_id = $bp->displayed_user->id;578 $user_id = bp_displayed_user_id(); 579 579 580 580 return apply_filters( 'bp_core_get_all_posts_for_user', $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d AND post_status = 'publish' AND post_type = 'post'", $user_id ) ) ); -
trunk/bp-members/bp-members-loader.php
r5300 r5301 89 89 /** Displayed user ****************************************************/ 90 90 91 // The user id of the user currently being viewed:92 // $bp->displayed_user->id is set in /bp-core/bp-core-catchuri.php93 if ( empty( $bp->displayed_user->id ) )94 $bp->displayed_user->id = 0;95 96 91 // The domain for the user currently being displayed 97 $bp->displayed_user->domain = bp_core_get_user_domain( $bp->displayed_user->id);92 $bp->displayed_user->domain = bp_core_get_user_domain( bp_displayed_user_id() ); 98 93 99 94 // The core userdata of the user who is currently being displayed 100 $bp->displayed_user->userdata = bp_core_get_core_userdata( $bp->displayed_user->id);95 $bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() ); 101 96 102 97 // Fetch the full name displayed user 103 $bp->displayed_user->fullname = bp_core_get_user_displayname( $bp->displayed_user->id);98 $bp->displayed_user->fullname = bp_core_get_user_displayname( bp_displayed_user_id() ); 104 99 105 100 /** Profiles Fallback *************************************************/ … … 120 115 } 121 116 122 if ( !$bp->current_component && $bp->displayed_user->id)117 if ( !$bp->current_component && bp_displayed_user_id() ) 123 118 $bp->current_component = $bp->default_component; 124 119 } … … 178 173 } elseif( bp_is_user() ) { 179 174 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 180 'item_id' => $bp->displayed_user->id,175 'item_id' => bp_displayed_user_id(), 181 176 'type' => 'thumb' 182 177 ) ); -
trunk/bp-members/bp-members-template.php
r5271 r5301 282 282 283 283 // User filtering 284 if ( !empty( $bp->displayed_user->id) )285 $user_id = $bp->displayed_user->id;284 if ( bp_displayed_user_id() ) 285 $user_id = bp_displayed_user_id(); 286 286 287 287 // type: active ( default ) | random | newest | popular | online | alphabetical … … 610 610 if ( !empty( $members_template->member->id ) ) 611 611 $user_id = $members_template->member->id; 612 elseif ( !empty( $bp->displayed_user->id) )613 $user_id = $bp->displayed_user->id;612 elseif ( bp_displayed_user_id() ) 613 $user_id = bp_displayed_user_id(); 614 614 615 615 $defaults = array( … … 716 716 then check to see if the two users are friends. if they are, add a highlight CSS class 717 717 to the friends nav item if it exists. */ 718 if ( !bp_is_my_profile() && $bp->displayed_user->id) {718 if ( !bp_is_my_profile() && bp_displayed_user_id() ) { 719 719 $selected = ''; 720 720 721 721 if ( bp_is_active( 'friends' ) ) { 722 722 if ( $nav_item['css_id'] == $bp->friends->id ) { 723 if ( friends_check_friendship( $bp->loggedin_user->id, $bp->displayed_user->id) )723 if ( friends_check_friendship( $bp->loggedin_user->id, bp_displayed_user_id() ) ) 724 724 $selected = ' class="current selected"'; 725 725 } … … 804 804 extract( $r, EXTR_SKIP ); 805 805 806 return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( array( 'item_id' => $bp->displayed_user->id, 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) );806 return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_displayed_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) ); 807 807 } 808 808 … … 829 829 830 830 if ( empty( $user_id ) ) 831 $user_id = $bp->displayed_user->id;831 $user_id = bp_displayed_user_id(); 832 832 833 833 $last_activity = bp_core_get_last_activity( bp_get_user_meta( $user_id, 'last_activity', true ), __('active %s', 'buddypress') ); … … 871 871 872 872 function bp_displayed_user_id() { 873 global $bp; 874 return apply_filters( 'bp_displayed_user_id', !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0 ); 873 874 static $id = 0; 875 876 if ( empty( $id ) ) { 877 global $bp; 878 $id = !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0; 879 } 880 881 return apply_filters( 'bp_displayed_user_id', $id ); 875 882 } 876 883 function bp_current_user_id() { return bp_displayed_user_id(); } 877 884 878 885 function bp_loggedin_user_id() { 879 global $bp; 880 return apply_filters( 'bp_loggedin_user_id', !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0 ); 886 887 static $id = 0; 888 889 if ( empty( $id ) ) { 890 global $bp; 891 $id = !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0; 892 } 893 894 return apply_filters( 'bp_loggedin_user_id', $id ); 881 895 } 882 896 … … 915 929 global $bp; 916 930 917 if ( !empty( $bp->displayed_user->id) ) {918 $username = bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login );931 if ( bp_displayed_user_id() ) { 932 $username = bp_core_get_username( bp_displayed_user_id(), $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ); 919 933 } else { 920 934 $username = ''; … … 1171 1185 1172 1186 // Must be displayed user 1173 if ( empty( $bp->displayed_user->id) )1187 if ( !bp_displayed_user_id() ) 1174 1188 return; 1175 1189 -
trunk/bp-messages/bp-messages-loader.php
r5300 r5301 242 242 } else { 243 243 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 244 'item_id' => $bp->displayed_user->id,244 'item_id' => bp_displayed_user_id(), 245 245 'type' => 'thumb' 246 246 ) ); -
trunk/bp-messages/bp-messages-screens.php
r4961 r5301 136 136 } 137 137 138 if ( !$new_messages = bp_get_user_meta( $bp->displayed_user->id, 'notification_messages_new_message', true ) )138 if ( !$new_messages = bp_get_user_meta( bp_displayed_user_id(), 'notification_messages_new_message', true ) ) 139 139 $new_messages = 'yes'; 140 140 141 if ( !$new_notices = bp_get_user_meta( $bp->displayed_user->id, 'notification_messages_new_notice', true ) )141 if ( !$new_notices = bp_get_user_meta( bp_displayed_user_id(), 'notification_messages_new_notice', true ) ) 142 142 $new_notices = 'yes'; 143 143 ?> -
trunk/bp-messages/bp-messages-template.php
r5072 r5301 171 171 172 172 if ( 'notices' == $bp->current_action && !is_super_admin() ) { 173 wp_redirect( $bp->displayed_user->id);173 wp_redirect( bp_displayed_user_id() ); 174 174 } else { 175 175 if ( 'inbox' == $bp->current_action ) … … 562 562 return false; 563 563 564 return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );564 return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( bp_displayed_user_id(), $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) ); 565 565 } 566 566 -
trunk/bp-settings/bp-settings-actions.php
r5232 r5301 22 22 23 23 // Validate the user again for the current password when making a big change 24 if ( is_super_admin() || ( !empty( $_POST['pwd'] ) && $_POST['pwd'] != '' && wp_check_password( $_POST['pwd'], $bp->displayed_user->userdata->user_pass, $bp->displayed_user->id) ) ) {24 if ( is_super_admin() || ( !empty( $_POST['pwd'] ) && $_POST['pwd'] != '' && wp_check_password( $_POST['pwd'], $bp->displayed_user->userdata->user_pass, bp_displayed_user_id() ) ) ) { 25 25 26 $update_user = get_userdata( $bp->displayed_user->id);26 $update_user = get_userdata( bp_displayed_user_id() ); 27 27 28 28 // Make sure changing an email address does not already exist … … 83 83 // Make sure these changes are in $bp for the current page load 84 84 if ( ( false === $email_error ) && ( false === $pass_error ) && ( wp_update_user( get_object_vars( $update_user ) ) ) ) { 85 $bp->displayed_user->userdata = bp_core_get_core_userdata( $bp->displayed_user->id);85 $bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() ); 86 86 $bp_settings_updated = true; 87 87 } … … 129 129 foreach ( (array)$_POST['notifications'] as $key => $value ) { 130 130 if ( $meta_key = bp_get_user_meta_key( $key ) ) 131 bp_update_user_meta( (int) $bp->displayed_user->id, $meta_key, $value );131 bp_update_user_meta( (int)bp_displayed_user_id(), $meta_key, $value ); 132 132 } 133 133 } … … 156 156 157 157 // delete the users account 158 if ( bp_core_delete_account( $bp->displayed_user->id) ) {158 if ( bp_core_delete_account( bp_displayed_user_id() ) ) { 159 159 bp_core_redirect( home_url() ); 160 160 } -
trunk/bp-themes/bp-default/_inc/ajax.php
r5262 r5301 40 40 if ( !empty( $_BP_COOKIE['bp-' . $object . '-scope'] ) ) { 41 41 if ( 'personal' == $_BP_COOKIE['bp-' . $object . '-scope'] ) { 42 $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id: $bp->loggedin_user->id;42 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : $bp->loggedin_user->id; 43 43 $qs[] = 'user_id=' . $user_id; 44 44 } 45 if ( 'all' != $_BP_COOKIE['bp-' . $object . '-scope'] && empty( $bp->displayed_user->id) && !$bp->is_single_item )45 if ( 'all' != $_BP_COOKIE['bp-' . $object . '-scope'] && !bp_displayed_user_id() && !$bp->is_single_item ) 46 46 $qs[] = 'scope=' . $_BP_COOKIE['bp-' . $object . '-scope']; // Activity stream scope only on activity directory. 47 47 } -
trunk/bp-xprofile/bp-xprofile-actions.php
r5072 r5301 33 33 return false; 34 34 35 if ( bp_core_delete_existing_avatar( array( 'item_id' => $bp->displayed_user->id) ) )35 if ( bp_core_delete_existing_avatar( array( 'item_id' => bp_displayed_user_id() ) ) ) 36 36 bp_core_add_message( __( 'Your avatar was deleted successfully!', 'buddypress' ) ); 37 37 else -
trunk/bp-xprofile/bp-xprofile-activity.php
r4961 r5301 120 120 return false; 121 121 122 $user_id = apply_filters( 'bp_xprofile_new_avatar_user_id', $bp->displayed_user->id);122 $user_id = apply_filters( 'bp_xprofile_new_avatar_user_id', bp_displayed_user_id() ); 123 123 124 124 $userlink = bp_core_get_userlink( $user_id ); -
trunk/bp-xprofile/bp-xprofile-classes.php
r5293 r5301 113 113 $defaults = array( 114 114 'profile_group_id' => false, 115 'user_id' => $bp->displayed_user->id,115 'user_id' => bp_displayed_user_id(), 116 116 'hide_empty_groups' => false, 117 117 'hide_empty_fields' => false, … … 945 945 946 946 if ( !$user_ids ) 947 $user_ids = $bp->displayed_user->id;947 $user_ids = bp_displayed_user_id(); 948 948 949 949 if ( is_array( $user_ids ) ) { … … 964 964 965 965 if ( !$user_id ) 966 $user_id = $bp->displayed_user->id;966 $user_id = bp_displayed_user_id(); 967 967 968 968 $field_sql = ''; … … 1040 1040 1041 1041 if ( !$user_id ) 1042 $user_id = $bp->displayed_user->id;1042 $user_id = bp_displayed_user_id(); 1043 1043 1044 1044 $field_name = bp_xprofile_fullname_field_name(); -
trunk/bp-xprofile/bp-xprofile-functions.php
r5167 r5301 156 156 157 157 if ( empty( $user_id ) ) 158 $user_id = $bp->displayed_user->id;158 $user_id = bp_displayed_user_id(); 159 159 160 160 if ( empty( $user_id ) ) … … 355 355 356 356 if ( empty( $user_id ) ) 357 $user_id = $bp->displayed_user->id;357 $user_id = bp_displayed_user_id(); 358 358 359 359 if ( empty( $directory ) ) -
trunk/bp-xprofile/bp-xprofile-loader.php
r5300 r5301 221 221 } else { 222 222 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 223 'item_id' => $bp->displayed_user->id,223 'item_id' => bp_displayed_user_id(), 224 224 'type' => 'thumb' 225 225 ) ); -
trunk/bp-xprofile/bp-xprofile-screens.php
r5268 r5301 99 99 $value = $_POST['field_' . $field_id]; 100 100 101 if ( !xprofile_set_field_data( $field_id, $bp->displayed_user->id, $value, $is_required[$field_id] ) )101 if ( !xprofile_set_field_data( $field_id, bp_displayed_user_id(), $value, $is_required[$field_id] ) ) 102 102 $errors = true; 103 103 else … … 105 105 } 106 106 107 do_action( 'xprofile_updated_profile', $bp->displayed_user->id, $posted_field_ids, $errors );107 do_action( 'xprofile_updated_profile', bp_displayed_user_id(), $posted_field_ids, $errors ); 108 108 109 109 // Set the feedback messages … … 162 162 check_admin_referer( 'bp_avatar_cropstore' ); 163 163 164 if ( !bp_core_avatar_handle_crop( array( 'item_id' => $bp->displayed_user->id, 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) )164 if ( !bp_core_avatar_handle_crop( array( 'item_id' => bp_displayed_user_id(), 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) ) 165 165 bp_core_add_message( __( 'There was a problem cropping your avatar, please try uploading it again', 'buddypress' ), 'error' ); 166 166 else { -
trunk/bp-xprofile/bp-xprofile-template.php
r5230 r5301 159 159 160 160 $defaults = array( 161 'user_id' => $bp->displayed_user->id,161 'user_id' => bp_displayed_user_id(), 162 162 'profile_group_id' => false, 163 163 'hide_empty_groups' => true, … … 689 689 $defaults = array( 690 690 'field' => false, // Field name or ID. 691 'user_id' => $bp->displayed_user->id691 'user_id' => bp_displayed_user_id() 692 692 ); 693 693 … … 774 774 global $bp; 775 775 776 $last_updated = bp_get_user_meta( $bp->displayed_user->id, 'profile_last_updated', true );776 $last_updated = bp_get_user_meta( bp_displayed_user_id(), 'profile_last_updated', true ); 777 777 778 778 if ( $last_updated ) … … 804 804 global $bp; 805 805 806 if ( !bp_core_fetch_avatar( array( 'item_id' => $bp->displayed_user->id, 'no_grav' => true ) ) )806 if ( !bp_core_fetch_avatar( array( 'item_id' => bp_displayed_user_id(), 'no_grav' => true ) ) ) 807 807 return false; 808 808
Note: See TracChangeset
for help on using the changeset viewer.