Changeset 1021 for trunk/bp-friends/bp-friends-templatetags.php
- Timestamp:
- 02/06/2009 03:07:48 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/bp-friends/bp-friends-templatetags.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-friends/bp-friends-templatetags.php
r884 r1021 20 20 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : 10; 21 21 22 if ( $bp ['current_action']== 'my-friends' && $_POST['friend-search-box'] != '' ) {22 if ( $bp->current_action == 'my-friends' && $_POST['friend-search-box'] != '' ) { 23 23 24 24 // Search results 25 $this->friendships = friends_search_friends( $_POST['friend-search-box'], $bp ['current_userid'], $this->pag_num, $this->pag_page );25 $this->friendships = friends_search_friends( $_POST['friend-search-box'], $bp->displayed_user->id, $this->pag_num, $this->pag_page ); 26 26 $this->total_friend_count = (int)$this->friendships['total']; 27 27 $this->friendships = $this->friendships['friends']; 28 28 29 } else if ( $bp ['current_action']== 'requests' ) {29 } else if ( $bp->current_action == 'requests' ) { 30 30 31 31 // Friendship Requests 32 $this->friendships = friends_get_friendship_requests( $bp ['current_userid']);32 $this->friendships = friends_get_friendship_requests( $bp->displayed_user->id ); 33 33 $this->total_friend_count = $this->friendships['total']; 34 34 $this->friendships = $this->friendships['requests']; 35 35 36 36 } else { 37 $order = $bp ['action_variables'][0];37 $order = $bp->action_variables[0]; 38 38 39 39 if ( $order == 'newest' ) { 40 $this->friendships = friends_get_newest( $bp ['current_userid'], $this->pag_num, $this->pag_page );40 $this->friendships = friends_get_newest( $bp->displayed_user->id, $this->pag_num, $this->pag_page ); 41 41 } else if ( $order == 'alphabetically' ) { 42 $this->friendships = friends_get_alphabetically( $bp ['current_userid'], $this->pag_num, $this->pag_page );42 $this->friendships = friends_get_alphabetically( $bp->displayed_user->id, $this->pag_num, $this->pag_page ); 43 43 } else { 44 $this->friendships = friends_get_recently_active( $bp ['current_userid'], $this->pag_num, $this->pag_page );44 $this->friendships = friends_get_recently_active( $bp->displayed_user->id, $this->pag_num, $this->pag_page ); 45 45 } 46 46 … … 102 102 $this->friendship = $this->next_friendship(); 103 103 104 if ( $bp ['current_action']== 'requests' ) {104 if ( $bp->current_action == 'requests' ) { 105 105 $this->friendship = new BP_Friends_Friendship( $this->friendship ); 106 106 } else { … … 117 117 global $bp, $friends_template; 118 118 119 $friends_template = new BP_Friendship_Template( $bp ['current_userid']);119 $friends_template = new BP_Friendship_Template( $bp->displayed_user->id ); 120 120 121 121 return $friends_template->has_friendships(); … … 248 248 global $friends_template, $bp; 249 249 250 echo apply_filters( 'bp_friend_accept_request_link', $bp ['loggedin_domain'] . $bp['friends']['slug']. '/requests/accept/' . $friends_template->friendship->id );250 echo apply_filters( 'bp_friend_accept_request_link', $bp->loggedin_user->domain . $bp->friends->slug . '/requests/accept/' . $friends_template->friendship->id ); 251 251 } 252 252 … … 254 254 global $friends_template, $bp; 255 255 256 echo apply_filters( 'bp_friend_reject_request_link', $bp ['loggedin_domain'] . $bp['friends']['slug']. '/requests/reject/' . $friends_template->friendship->id );256 echo apply_filters( 'bp_friend_reject_request_link', $bp->loggedin_user->domain . $bp->friends->slug . '/requests/reject/' . $friends_template->friendship->id ); 257 257 } 258 258 … … 265 265 global $friends_template, $bp; 266 266 267 $action = $bp ['current_domain'] . $bp['friends']['slug']. '/my-friends/search/';267 $action = $bp->displayed_user->domain . $bp->friends->slug . '/my-friends/search/'; 268 268 $label = __( 'Filter Friends', 'buddypress' ); 269 269 ?> 270 270 <form action="<?php echo $action ?>" id="friend-search-form" method="post"> 271 <label for="friend-search-box" id="friend-search-label"><?php echo $label ?> <img id="ajax-loader" src="<?php echo $bp ['friends']['image_base']?>/ajax-loader.gif" height="7" alt="Loading" style="display: none;" /></label>271 <label for="friend-search-box" id="friend-search-label"><?php echo $label ?> <img id="ajax-loader" src="<?php echo $bp->friends->image_base ?>/ajax-loader.gif" height="7" alt="Loading" style="display: none;" /></label> 272 272 <input type="search" name="friend-search-box" id="friend-search-box" value="<?php echo $value ?>"<?php echo $disabled ?> /> 273 273 <?php if ( function_exists('wp_nonce_field') ) 274 274 wp_nonce_field('friend_search' ); 275 275 ?> 276 <input type="hidden" name="initiator" id="initiator" value="<?php echo $bp ['current_userid']?>" />276 <input type="hidden" name="initiator" id="initiator" value="<?php echo $bp->displayed_user->id ?>" /> 277 277 </form> 278 278 <?php … … 281 281 function bp_friend_all_friends_link() { 282 282 global $bp; 283 echo apply_filters( 'bp_friend_all_friends_link', $bp ['current_domain']. 'my-friends/all-friends' );283 echo apply_filters( 'bp_friend_all_friends_link', $bp->displayed_user->domain . 'my-friends/all-friends' ); 284 284 } 285 285 286 286 function bp_friend_latest_update_link() { 287 287 global $bp; 288 echo apply_filters( 'bp_friend_latest_update_link', $bp ['current_domain']. 'my-friends/last-updated' );288 echo apply_filters( 'bp_friend_latest_update_link', $bp->displayed_user->domain . 'my-friends/last-updated' ); 289 289 } 290 290 291 291 function bp_friend_recent_activity_link() { 292 292 global $bp; 293 echo apply_filters( 'bp_friend_recent_activity_link', $bp ['current_domain']. 'my-friends/recently-active' );293 echo apply_filters( 'bp_friend_recent_activity_link', $bp->displayed_user->domain . 'my-friends/recently-active' ); 294 294 } 295 295 296 296 function bp_friend_recent_status_link() { 297 297 global $bp; 298 echo apply_filters( 'bp_friend_recent_status_link', $bp ['current_domain']. 'my-friends/status-updates' );298 echo apply_filters( 'bp_friend_recent_status_link', $bp->displayed_user->domain . 'my-friends/status-updates' ); 299 299 } 300 300 … … 307 307 $potential_friend_id = $friends_template->friendship->friend->id; 308 308 else if ( !$potential_friend_id && !$friends_template->friendship->friend ) 309 $potential_friend_id = $bp ['current_userid'];310 311 if ( $bp ['loggedin_userid']== $potential_friend_id )309 $potential_friend_id = $bp->displayed_user->id; 310 311 if ( $bp->loggedin_user->id == $potential_friend_id ) 312 312 return false; 313 313 314 $friend_status = BP_Friends_Friendship::check_is_friend( $bp ['loggedin_userid'], $potential_friend_id );314 $friend_status = BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $potential_friend_id ); 315 315 316 316 echo '<div class="friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">'; 317 317 if ( $friend_status == 'pending' ) { 318 echo '<a class="requested" href="' . $bp ['loggedin_domain'] . $bp['friends']['slug']. '">' . __( 'Friendship Requested', 'buddypress' ) . '</a>';318 echo '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '">' . __( 'Friendship Requested', 'buddypress' ) . '</a>'; 319 319 } else if ( $friend_status == 'is_friend') { 320 echo '<a href="' . $bp ['loggedin_domain'] . $bp['friends']['slug']. '/remove-friend/' . $potential_friend_id . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>';320 echo '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>'; 321 321 } else { 322 echo '<a href="' . $bp ['loggedin_domain'] . $bp['friends']['slug']. '/add-friend/' . $potential_friend_id . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>';322 echo '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>'; 323 323 } 324 324 echo '</div>'; … … 333 333 global $bp, $create_group_step, $completed_to_step; 334 334 ?> 335 <li<?php if ( !isset($bp ['action_variables'][0]) || $bp['action_variables'][0] == 'recently-active' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp['current_domain'] . $bp['friends']['slug']?>/my-friends/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>336 <li<?php if ( $bp ['action_variables'][0] == 'newest' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp['current_domain'] . $bp['friends']['slug']?>/my-friends/newest"><?php _e( 'Newest', 'buddypress' ) ?></a></li>337 <li<?php if ( $bp ['action_variables'][0] == 'alphabetically' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp['current_domain'] . $bp['friends']['slug']?>/my-friends/alphabetically""><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>335 <li<?php if ( !isset($bp->action_variables[0]) || $bp->action_variables[0] == 'recently-active' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>/my-friends/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li> 336 <li<?php if ( $bp->action_variables[0] == 'newest' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>/my-friends/newest"><?php _e( 'Newest', 'buddypress' ) ?></a></li> 337 <li<?php if ( $bp->action_variables[0] == 'alphabetically' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>/my-friends/alphabetically""><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li> 338 338 <?php 339 339 do_action( 'friends_header_tabs' ); … … 343 343 global $bp; 344 344 345 $current_filter = $bp ['action_variables'][0];345 $current_filter = $bp->action_variables[0]; 346 346 347 347 switch ( $current_filter ) { … … 361 361 global $bp; 362 362 363 $friend_ids = BP_Friends_Friendship::get_random_friends( $bp ['current_userid']);363 $friend_ids = BP_Friends_Friendship::get_random_friends( $bp->displayed_user->id ); 364 364 ?> 365 365 <div class="info-group"> 366 <h4><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?> (<?php echo BP_Friends_Friendship::total_friend_count( $bp ['current_userid'] ) ?>) <a href="<?php echo $bp['current_domain'] . $bp['friends']['slug']?>"><?php _e('See All', 'buddypress') ?> »</a></h4>366 <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 ) ?>) <a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>"><?php _e('See All', 'buddypress') ?> »</a></h4> 367 367 368 368 <?php if ( $friend_ids ) { ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)