Changeset 5712 for trunk/bp-friends/bp-friends-template.php
- Timestamp:
- 02/11/2012 04:42:04 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-friends/bp-friends-template.php (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-friends/bp-friends-template.php
r5704 r5712 1 1 <?php 2 3 /** 4 * BuddyPress Friends Template Functions 5 * 6 * @package BuddyPress 7 * @subpackage FriendsTemplate 8 */ 9 2 10 // Exit if accessed directly 3 11 if ( !defined( 'ABSPATH' ) ) exit; … … 58 66 */ 59 67 function bp_friends_header_tabs() { 60 global $bp;?>68 ?> 61 69 62 70 <li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/recently-active' ) ?>"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li> … … 91 99 92 100 function bp_friends_random_friends() { 93 global $bp;94 101 95 102 if ( !$friend_ids = wp_cache_get( 'friends_friend_ids_' . bp_displayed_user_id(), 'bp' ) ) { … … 123 130 124 131 <?php } ?> 132 125 133 <div class="clear"></div> 126 134 </div> 135 127 136 <?php 128 137 } … … 138 147 */ 139 148 function bp_friends_random_members( $total_members = 5 ) { 140 global $bp;141 149 142 150 if ( !$user_ids = wp_cache_get( 'friends_random_users', 'bp' ) ) { … … 196 204 197 205 function bp_friend_search_form() { 198 global $friends_template, $bp;199 206 200 207 $action = bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/search/'; 201 $label = __( 'Filter Friends', 'buddypress' ); ?>208 $label = __( 'Filter Friends', 'buddypress' ); ?> 202 209 203 210 <form action="<?php echo $action ?>" id="friend-search-form" method="post"> … … 228 235 229 236 function bp_member_total_friend_count() { 230 global $members_template;231 232 237 echo bp_get_member_total_friend_count(); 233 238 } … … 257 262 * Returns the ID of the potential friend 258 263 * 259 * @global object $bp260 264 * @global object $friends_template 261 265 * @param int $user_id … … 263 267 */ 264 268 function bp_get_potential_friend_id( $user_id = 0 ) { 265 global $ bp, $friends_template;269 global $friends_template; 266 270 267 271 if ( empty( $user_id ) && isset( $friends_template->friendship->friend ) ) … … 278 282 * Returns - 'is_friend', 'not_friends', 'pending' 279 283 * 280 * @global object $bp281 284 * @param int $potential_friend_id 282 285 * @return string 283 286 */ 284 287 function bp_is_friend( $user_id = 0 ) { 285 global $bp;286 288 287 289 if ( !is_user_logged_in() ) … … 301 303 } 302 304 function bp_get_add_friend_button( $potential_friend_id = 0, $friend_status = false ) { 303 global $bp, $friends_template;304 305 305 306 if ( empty( $potential_friend_id ) ) … … 367 368 368 369 function bp_get_friend_ids( $user_id = 0 ) { 369 global $bp; 370 371 if ( !$user_id ) 370 371 if ( empty( $user_id ) ) 372 372 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id(); 373 373 … … 380 380 } 381 381 function bp_get_friendship_requests() { 382 global $bp;383 384 382 return apply_filters( 'bp_get_friendship_requests', implode( ',', (array) friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) ) ); 385 383 } … … 389 387 } 390 388 function bp_get_friend_friendship_id() { 391 global $members_template , $bp;389 global $members_template; 392 390 393 391 if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) { … … 403 401 } 404 402 function bp_get_friend_accept_request_link() { 405 global $members_template , $bp;403 global $members_template; 406 404 407 405 if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) { … … 417 415 } 418 416 function bp_get_friend_reject_request_link() { 419 global $members_template , $bp;417 global $members_template; 420 418 421 419 if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) { … … 439 437 } 440 438 function bp_friend_get_total_requests_count( $user_id = 0 ) { 441 global $bp;442 443 439 if ( empty( $user_id ) ) 444 440 $user_id = bp_loggedin_user_id();
Note: See TracChangeset
for help on using the changeset viewer.