Changeset 5705
- Timestamp:
- 02/11/2012 03:21:00 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-functions.php
r5684 r5705 131 131 * @param string $format 'string' to get a BuddyBar-compatible notification, 'array' otherwise 132 132 * 133 * @global object $bp BuddyPress global settings134 133 * @uses bp_loggedin_user_domain() 135 134 * @uses bp_get_activity_slug() … … 142 141 */ 143 142 function bp_activity_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { 144 global $bp;145 143 146 144 switch ( $action ) { … … 149 147 $poster_user_id = $secondary_item_id; 150 148 $at_mention_link = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/'; 151 $at_mention_title = sprintf( __( '@%s Mentions', 'buddypress' ), $bp->loggedin_user->userdata->user_nicename);149 $at_mention_title = sprintf( __( '@%s Mentions', 'buddypress' ), bp_get_loggedin_user_username() ); 152 150 153 151 if ( (int)$total_items > 1 ) { 154 $text = sprintf( __( 'You have %1$d new activity mentions', 'buddypress' ), (int) $total_items );152 $text = sprintf( __( 'You have %1$d new activity mentions', 'buddypress' ), (int) $total_items ); 155 153 $filter = 'bp_activity_multiple_at_mentions_notification'; 156 154 } else { … … 1312 1310 // Recursively delete all children of this comment. 1313 1311 if ( $children = BP_Activity_Activity::get_child_comments( $comment_id ) ) { 1314 foreach( (array)$children as $child ) 1312 foreach( (array)$children as $child ) { 1315 1313 bp_activity_delete_children( $activity_id, $child->id ); 1314 } 1316 1315 } 1317 1316 bp_activity_delete( array( 'secondary_item_id' => $comment_id, 'type' => 'activity_comment', 'item_id' => $activity_id ) ); … … 1624 1623 bp_activity_update_meta( $id, $cachekey, $cache ); 1625 1624 } 1625 1626 1626 ?> -
trunk/bp-activity/bp-activity-loader.php
r5704 r5705 111 111 */ 112 112 function setup_nav() { 113 global $bp; 113 114 $sub_nav = array(); 114 115 115 116 // Add 'Activity' to the main navigation … … 227 228 228 229 // Unread message count 229 if ( $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) { 230 $title = sprintf( __( 'Mentions <span class="count">%s</span>', 'buddypress' ), $count ); 230 $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() ); 231 if ( !empty( $count ) ) { 232 $title = sprintf( __( 'Mentions <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) ); 231 233 } else { 232 234 $title = __( 'Mentions', 'buddypress' ); … … 312 314 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 313 315 ) ); 314 $bp->bp_options_title = $bp->displayed_user->fullname;316 $bp->bp_options_title = bp_get_displayed_user_fullname(); 315 317 } 316 318 } -
trunk/bp-activity/bp-activity-screens.php
r5704 r5705 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() ) ) ?></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
r5684 r5705 142 142 } 143 143 144 $this->full_name = $bp->displayed_user->fullname;144 $this->full_name = bp_get_displayed_user_fullname(); 145 145 146 146 // Fetch parent content for activity comments so we do not have to query in the loop … … 324 324 // determine which user_id applies 325 325 if ( empty( $user_id ) ) 326 $user_id = ( bp_displayed_user_id()) ? bp_displayed_user_id() : bp_loggedin_user_id();326 $user_id = bp_displayed_user_id() ? bp_displayed_user_id() : bp_loggedin_user_id(); 327 327 328 328 // are we displaying user specific activity? … … 360 360 break; 361 361 case 'mentions': 362 $user_nicename = ( bp_displayed_user_id() ) ? $bp->displayed_user->userdata->user_nicename : $bp->loggedin_user->userdata->user_nicename; 363 $user_login = ( bp_displayed_user_id() ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;364 $search_terms = '@' . bp_core_get_username( $user_id , $user_nicename, $user_login ) . '<'; // Start search at @ symbol and stop search at closing tag delimiter.362 363 // Start search at @ symbol and stop search at closing tag delimiter. 364 $search_terms = '@' . bp_core_get_username( $user_id ) . '<'; 365 365 $display_comments = 'stream'; 366 366 $user_id = 0; … … 371 371 372 372 // Do not exceed the maximum per page 373 if ( !empty( $max ) && ( (int) $per_page > (int)$max ) )373 if ( !empty( $max ) && ( (int) $per_page > (int) $max ) ) 374 374 $per_page = $max; 375 375 … … 385 385 386 386 // If specific activity items have been requested, override the $hide_spam argument. This prevents backpat errors with AJAX. 387 if ( !empty( $include ) && 'ham_only' == $spam)387 if ( !empty( $include ) && ( 'ham_only' == $spam ) ) 388 388 $spam = 'all'; 389 389 … … 2290 2290 return false; 2291 2291 2292 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 ) ) );2292 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_get_displayed_user_username(), $bp->displayed_user->userdata->user_login ) ) ); 2293 2293 } 2294 2294 -
trunk/bp-activity/feeds/bp-activity-mentions-feed.php
r5394 r5705 36 36 <?php do_action('bp_activity_mentions_feed_head'); ?> 37 37 38 <?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) ) ) : ?>38 <?php if ( bp_has_activities( 'max=50&display_comments=stream&search_terms=@' . bp_core_get_username( bp_displayed_user_id() ) ) ) : ?> 39 39 <?php while ( bp_activities() ) : bp_the_activity(); ?> 40 40 <item> -
trunk/bp-activity/feeds/bp-activity-personal-feed.php
r5394 r5705 29 29 <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" /> 30 30 <link><?php echo bp_displayed_user_domain() . bp_get_activity_slug() . '/feed' ?></link> 31 <description><?php printf( __( '%s - Activity Feed', 'buddypress' ), $bp->displayed_user->fullname) ?></description>31 <description><?php printf( __( '%s - Activity Feed', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description> 32 32 <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate> 33 33 <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator> -
trunk/bp-blogs/bp-blogs-loader.php
r5704 r5705 104 104 return false; 105 105 106 $sub_nav = array(); 107 106 108 // Add 'Sites' to the main navigation 107 109 $main_nav = array( … … 197 199 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 198 200 ) ); 199 $bp->bp_options_title = $bp->displayed_user->fullname;201 $bp->bp_options_title = bp_get_displayed_user_fullname(); 200 202 } 201 203 } -
trunk/bp-core/bp-core-filters.php
r5683 r5705 1 1 <?php 2 2 3 // Exit if accessed directly 3 4 if ( !defined( 'ABSPATH' ) ) exit; … … 55 56 */ 56 57 function bp_core_allow_default_theme( $themes ) { 57 global $ bp, $wpdb;58 global $wpdb; 58 59 59 60 if ( !bp_current_user_can( 'bp_moderate' ) ) … … 141 142 */ 142 143 function bp_core_filter_user_welcome_email( $welcome_email ) { 143 /* Don't touch the email if we don't have a custom registration template */ 144 145 // Don't touch the email if we don't have a custom registration template 144 146 if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) ) 145 147 return $welcome_email; … … 165 167 */ 166 168 function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) { 167 /* Don't touch the email if we don't have a custom registration template */ 169 170 // Don't touch the email if we don't have a custom registration template 168 171 if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) ) 169 172 return $welcome_email; … … 265 268 266 269 // Displayed user 267 if ( !empty( $bp->displayed_user->fullname) && !is_404() ) {270 if ( bp_get_displayed_user_fullname() && !is_404() ) { 268 271 269 272 // Get the component's ID to try and get it's name -
trunk/bp-core/bp-core-template.php
r5668 r5705 207 207 208 208 function bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true ) { 209 global $bp; 210 211 if ( $capitalize ) 212 $youtext = bp_core_ucfirst($youtext); 209 210 if ( !empty( $capitalize ) ) 211 $youtext = bp_core_ucfirst( $youtext ); 213 212 214 213 if ( bp_displayed_user_id() == bp_loggedin_user_id() ) { 215 if ( $echo )214 if ( true == $echo ) { 216 215 echo apply_filters( 'bp_word_or_name', $youtext ); 217 else216 } else { 218 217 return apply_filters( 'bp_word_or_name', $youtext ); 218 } 219 219 } else { 220 $fullname = (array)explode( ' ', $bp->displayed_user->fullname ); 220 $fullname = bp_get_displayed_user_fullname(); 221 $fullname = (array) explode( ' ', $fullname ); 221 222 $nametext = sprintf( $nametext, $fullname[0] ); 222 if ( $echo )223 if ( true == $echo ) { 223 224 echo apply_filters( 'bp_word_or_name', $nametext ); 224 else225 } else { 225 226 return apply_filters( 'bp_word_or_name', $nametext ); 227 } 226 228 } 227 229 } -
trunk/bp-forums/bp-forums-loader.php
r5704 r5705 1 1 <?php 2 2 3 /** 3 4 * BuddyPress Forums Loader … … 119 120 if ( bp_displayed_user_domain() ) { 120 121 $user_domain = bp_displayed_user_domain(); 121 $user_login = $bp->displayed_user->userdata->user_login;122 122 } elseif ( bp_loggedin_user_domain() ) { 123 123 $user_domain = bp_loggedin_user_domain(); 124 $user_login = $bp->loggedin_user->userdata->user_login;125 124 } else { 126 125 return; … … 183 182 184 183 // Setup the logged in user variables 185 $user_domain = bp_loggedin_user_domain(); 186 $user_login = $bp->loggedin_user->userdata->user_login; 187 $forums_link = trailingslashit( $user_domain . $this->slug ); 184 $forums_link = trailingslashit( bp_loggedin_user_domain() . $this->slug ); 188 185 189 186 // Add the "My Account" sub menus … … 241 238 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 242 239 ) ); 243 $bp->bp_options_title = $bp->displayed_user->fullname;240 $bp->bp_options_title = bp_get_displayed_user_fullname(); 244 241 } 245 242 } -
trunk/bp-friends/bp-friends-loader.php
r5704 r5705 91 91 global $bp; 92 92 93 $sub_nav = array(); 94 93 95 // Add 'Friends' to the main navigation 94 96 $main_nav = array( … … 146 148 147 149 // Pending friend requests 148 if ( $count = count( friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) ) ) { 149 $title = sprintf( __( 'Friends <span class="count">%s</span>', 'buddypress' ), $count ); 150 $pending = sprintf( __( 'Pending Requests <span class="count">%s</span>', 'buddypress' ), $count ); 150 $count = count( friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) ); 151 if ( !empty( $count ) ) { 152 $title = sprintf( __( 'Friends <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) ); 153 $pending = sprintf( __( 'Pending Requests <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) ); 151 154 } else { 152 155 $title = __( 'Friends', 'buddypress' ); … … 200 203 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 201 204 ) ); 202 $bp->bp_options_title = $bp->displayed_user->fullname;205 $bp->bp_options_title = bp_get_displayed_user_fullname(); 203 206 } 204 207 } -
trunk/bp-groups/bp-groups-loader.php
r5704 r5705 252 252 */ 253 253 function setup_nav() { 254 global $bp;255 254 256 255 // Define local variables 257 $ main_nav = $sub_nav = array();256 $sub_nav = array(); 258 257 259 258 // Add 'Groups' to the main navigation … … 295 294 if ( bp_is_groups_component() && bp_is_single_item() ) { 296 295 297 unset( $main_nav ); unset( $sub_nav ); 296 // Reset sub nav 297 $sub_nav = array(); 298 298 299 299 // Add 'Groups' to the main navigation … … 475 475 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 476 476 ) ); 477 $bp->bp_options_title = $bp->displayed_user->fullname;477 $bp->bp_options_title = bp_get_displayed_user_fullname(); 478 478 479 479 // We are viewing a single group, so set up the … … 488 488 'alt' => __( 'Group Avatar', 'buddypress' ) 489 489 ) ); 490 if ( empty( $bp->bp_options_avatar ) ) 490 if ( empty( $bp->bp_options_avatar ) ) { 491 491 $bp->bp_options_avatar = '<img src="' . esc_attr( $group->avatar_full ) . '" class="avatar" alt="' . esc_attr( $group->name ) . '" />'; 492 } 492 493 } 493 494 } -
trunk/bp-members/bp-members-actions.php
r5704 r5705 117 117 * 118 118 * @package BuddyPress Core 119 * @global object $bp Global BuddyPress settings object120 119 */ 121 120 function bp_core_action_delete_user() { 122 global $bp;123 121 124 122 if ( !bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile() || !bp_displayed_user_id() ) 125 123 return false; 126 124 127 if ( 'admin' == $bp->current_component && 'delete-user' == $bp->current_action ) { 125 if ( bp_is_current_component( 'admin' ) && bp_is_current_action( 'delete-user' ) ) { 126 128 127 // Check the nonce 129 128 check_admin_referer( 'delete-user' ); … … 133 132 134 133 if ( bp_core_delete_account( bp_displayed_user_id() ) ) { 135 bp_core_add_message( sprintf( __( '%s has been deleted from the system.', 'buddypress' ), $bp->displayed_user->fullname) );134 bp_core_add_message( sprintf( __( '%s has been deleted from the system.', 'buddypress' ), bp_get_displayed_user_fullname() ) ); 136 135 } else { 137 bp_core_add_message( sprintf( __( 'There was an error deleting %s from the system. Please try again.', 'buddypress' ), $bp->displayed_user->fullname), 'error' );136 bp_core_add_message( sprintf( __( 'There was an error deleting %s from the system. Please try again.', 'buddypress' ), bp_get_displayed_user_fullname() ), 'error' ); 138 137 $errors = true; 139 138 } -
trunk/bp-members/bp-members-buddybar.php
r5704 r5705 13 13 if ( !defined( 'ABSPATH' ) ) exit; 14 14 15 // **** "Notifications" Menu ********* 15 /** 16 * Notifications Menu 17 */ 16 18 function bp_adminbar_notifications_menu() { 17 global $bp;18 19 19 20 if ( !is_user_logged_in() ) … … 104 105 * 105 106 * @package BuddyPress XProfile 106 * @global $bp BuddyPress107 107 */ 108 108 function bp_members_adminbar_admin_menu() { 109 global $bp;110 109 111 110 // Only show if viewing a user … … 124 123 <?php if ( bp_is_active( 'xprofile' ) ) : ?> 125 124 126 <li><a href="<?php bp_members_component_link( 'profile', 'edit' ); ?>"><?php printf( __( "Edit %s's Profile", 'buddypress' ), esc_attr( $bp->displayed_user->fullname) ) ?></a></li>125 <li><a href="<?php bp_members_component_link( 'profile', 'edit' ); ?>"><?php printf( __( "Edit %s's Profile", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ) ?></a></li> 127 126 128 127 <?php endif ?> 129 128 130 <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>129 <li><a href="<?php bp_members_component_link( 'profile', 'change-avatar' ); ?>"><?php printf( __( "Edit %s's Avatar", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ) ?></a></li> 131 130 132 131 <?php if ( !bp_is_user_spammer( bp_displayed_user_id() ) ) : ?> 133 132 134 <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>133 <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_get_displayed_user_fullname() ) ); ?></a></li> 135 134 136 135 <?php else : ?> … … 140 139 <?php endif; ?> 141 140 142 <li><a href="<?php echo wp_nonce_url( bp_displayed_user_domain() . 'admin/delete-user/', 'delete-user' ) ?>" class="confirm"><?php printf( __( "Delete %s's Account", 'buddypress' ), esc_attr( $bp->displayed_user->fullname) ); ?></a></li>141 <li><a href="<?php echo wp_nonce_url( bp_displayed_user_domain() . 'admin/delete-user/', 'delete-user' ) ?>" class="confirm"><?php printf( __( "Delete %s's Account", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ); ?></a></li> 143 142 144 143 <?php do_action( 'bp_members_adminbar_admin_menu' ) ?> -
trunk/bp-members/bp-members-functions.php
r5700 r5705 244 244 } 245 245 246 // Pull an audible and use the login over the nicename 247 if ( bp_is_username_compatibility_mode() ) 248 $username = $user_login; 249 else 250 $username = $user_nicename; 246 // Pull an audible and maybe use the login over the nicename 247 $username = bp_is_username_compatibility_mode() ? $user_login : $user_nicename; 251 248 252 249 // Username found in cache so don't update it again -
trunk/bp-members/bp-members-loader.php
r5704 r5705 182 182 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 183 183 ) ); 184 $bp->bp_options_title = $bp->displayed_user->fullname;184 $bp->bp_options_title = bp_get_displayed_user_fullname(); 185 185 } 186 186 -
trunk/bp-members/bp-members-template.php
r5704 r5705 837 837 } 838 838 function bp_get_user_firstname( $name = false ) { 839 global $bp;840 839 841 840 // Try to get displayed user 842 841 if ( empty( $name ) ) 843 $name = $bp->displayed_user->fullname;842 $name = bp_get_displayed_user_fullname(); 844 843 845 844 // Fall back on logged in user 846 845 if ( empty( $name ) ) 847 $name = $bp->loggedin_user->fullname;848 849 $fullname = (array) explode( ' ', $name );846 $name = bp_get_loggedin_user_fullname(); 847 848 $fullname = (array) explode( ' ', $name ); 850 849 851 850 return apply_filters( 'bp_get_user_firstname', $fullname[0], $fullname ); -
trunk/bp-messages/bp-messages-loader.php
r5704 r5705 92 92 */ 93 93 function setup_nav() { 94 global $bp;95 94 96 95 $sub_nav = array(); … … 248 247 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 249 248 ) ); 250 $bp->bp_options_title = $bp->displayed_user->fullname;249 $bp->bp_options_title = bp_get_displayed_user_fullname(); 251 250 } 252 251 } -
trunk/bp-messages/bp-messages-template.php
r5704 r5705 237 237 } 238 238 function bp_get_message_thread_from() { 239 global $messages_template , $bp;239 global $messages_template; 240 240 241 241 return apply_filters( 'bp_get_message_thread_from', bp_core_get_userlink( $messages_template->thread->last_sender_id ) ); … … 571 571 } 572 572 function bp_get_send_private_message_link() { 573 global $bp;574 573 575 574 if ( bp_is_my_profile() || !is_user_logged_in() ) 576 575 return false; 577 576 578 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) ) );577 return apply_filters( 'bp_get_send_private_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( bp_displayed_user_id() ) ) ); 579 578 } 580 579 -
trunk/bp-xprofile/bp-xprofile-loader.php
r5704 r5705 108 108 */ 109 109 function setup_nav() { 110 global $bp;111 110 112 111 $sub_nav = array(); … … 228 227 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 229 228 ) ); 230 $bp->bp_options_title = $bp->displayed_user->fullname;229 $bp->bp_options_title = bp_get_displayed_user_fullname(); 231 230 } 232 231 }
Note: See TracChangeset
for help on using the changeset viewer.