Changeset 1844
- Timestamp:
- 09/10/2009 06:34:52 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r1839 r1844 162 162 else 163 163 bp_core_add_message( __( 'There was an error when deleting that activity', 'buddypress' ), 'error' ); 164 165 do_action( 'bp_activity_action_delete_activity', $activity_id ); 164 166 165 167 bp_core_redirect( $_SERVER['HTTP_REFERER'] ); … … 334 336 } 335 337 336 return $content;338 return apply_filters( 'bp_activity_add_timesince_placeholder', $content ); 337 339 } 338 340 … … 341 343 $content = bp_activity_add_timesince_placeholder( $content ); 342 344 343 return BP_Activity_Activity::check_exists_by_content( $content);345 return apply_filters( 'bp_activity_check_exists_by_content', BP_Activity_Activity::check_exists_by_content( $content ) ); 344 346 } 345 347 346 348 function bp_activity_get_last_updated() { 347 return BP_Activity_Activity::get_last_updated();349 return apply_filters( 'bp_activity_get_last_updated', BP_Activity_Activity::get_last_updated() ); 348 350 } 349 351 350 352 function bp_activity_get_sitewide_activity( $max_items = 30, $pag_num = false, $pag_page = false, $filter = false ) { 351 return BP_Activity_Activity::get_sitewide_activity($max_items, $pag_num, $pag_page, $filter );353 return apply_filters( 'bp_activity_get_sitewide_activity', BP_Activity_Activity::get_sitewide_activity( $max_items, $pag_num, $pag_page, $filter ), $max_items, $pag_num, $pag_page, $filter ); 352 354 } 353 355 354 356 function bp_activity_get_user_activity( $user_id, $max_items = 30, $pag_num = false, $pag_page = false, $filter = false ) { 355 return BP_Activity_Activity::get_activity_for_user($user_id, $max_items, $pag_num, $pag_page, $filter );357 return apply_filters( 'bp_activity_get_user_activity', BP_Activity_Activity::get_activity_for_user( $user_id, $max_items, $pag_num, $pag_page, $filter ), $user_id, $max_items, $pag_num, $pag_page, $filter ); 356 358 } 357 359 358 360 function bp_activity_get_friends_activity( $user_id, $max_items = 30, $max_items_per_friend = false, $pag_num = false, $pag_page = false, $filter = false ) { 359 return BP_Activity_Activity::get_activity_for_friends($user_id, $max_items, $max_items_per_friend, $pag_num, $pag_page, $filter );361 return apply_filters( 'bp_activity_get_friends_activity', BP_Activity_Activity::get_activity_for_friends( $user_id, $max_items, $max_items_per_friend, $pag_num, $pag_page, $filter ), $user_id, $max_items, $max_items_per_friend, $pag_num, $pag_page, $filter ); 360 362 } 361 363 … … 372 374 /* Ordering function - don't call this directly */ 373 375 function bp_activity_order_by_date( $a, $b ) { 374 return strcasecmp( $b['date_recorded'], $a['date_recorded']);376 return apply_filters( 'bp_activity_order_by_date', strcasecmp( $b['date_recorded'], $a['date_recorded'] ) ); 375 377 } 376 378 -
trunk/bp-activity/bp-activity-templatetags.php
r1839 r1844 171 171 172 172 $activities_template = new BP_Activity_Template( $type, $user_id, $per_page, $max, $filter ); 173 return $activities_template->has_activities();173 return apply_filters( 'bp_has_activities', $activities_template->has_activities(), &$activities_template ); 174 174 } 175 175 -
trunk/bp-blogs/bp-blogs-templatetags.php
r1771 r1844 309 309 310 310 $blogs_template = new BP_Blogs_User_Blogs_Template( $user_id, $per_page, $max ); 311 return $blogs_template->has_blogs();311 return apply_filters( 'bp_has_blogs', $blogs_template->has_blogs(), &$blogs_template ); 312 312 } 313 313 … … 485 485 486 486 $posts_template = new BP_Blogs_Blog_Post_Template( $user_id, $per_page, $max ); 487 return $posts_template->has_posts();487 return apply_filters( 'bp_has_posts', $posts_template->has_posts(), &$posts_template ); 488 488 } 489 489 … … 920 920 921 921 $comments_template = new BP_Blogs_Post_Comment_Template( $user_id, $per_page, $max ); 922 923 return $comments_template->has_comments(); 922 return apply_filters( 'bp_has_comments', $comments_template->has_comments(), &$comments_template ); 924 923 } 925 924 -
trunk/bp-forums/bp-forums-templatetags.php
r1790 r1844 138 138 return false; 139 139 140 return $forum_template->has_topics();140 return apply_filters( 'bp_has_topics', $forum_template->has_topics(), &$forum_template ); 141 141 } 142 142 … … 600 600 return false; 601 601 602 return $topic_template->has_posts();602 return apply_filters( 'bp_has_topic_posts', $topic_template->has_posts(), &$topic_template ); 603 603 } 604 604 -
trunk/bp-friends/bp-friends-templatetags.php
r1834 r1844 172 172 173 173 $friends_template = new BP_Friendship_Template( $user_id, $type, $per_page, $max, $filter ); 174 return $friends_template->has_friendships();174 return apply_filters( 'bp_has_friendships', $friends_template->has_friendships(), &$friends_template ); 175 175 } 176 176 … … 345 345 346 346 function bp_add_friend_button( $potential_friend_id = false ) { 347 global $bp, $friends_template; 348 349 if ( is_user_logged_in() ) { 350 351 if ( !$potential_friend_id && $friends_template->friendship->friend ) 352 $potential_friend_id = $friends_template->friendship->friend->id; 353 else if ( !$potential_friend_id && !$friends_template->friendship->friend ) 354 $potential_friend_id = $bp->displayed_user->id; 355 356 if ( $bp->loggedin_user->id == $potential_friend_id ) 357 return false; 358 359 $friend_status = BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $potential_friend_id ); 360 361 echo '<div class="generic-button friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">'; 362 if ( 'pending' == $friend_status ) { 363 echo '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '">' . __( 'Friendship Requested', 'buddypress' ) . '</a>'; 364 } else if ( 'is_friend' == $friend_status ) { 365 echo '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id, 'friends_remove_friend' ) . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>'; 366 } else { 367 echo '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id, 'friends_add_friend' ) . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>'; 368 } 369 echo '</div>'; 370 } 371 } 347 echo bp_get_add_friend_button(); 348 } 349 function bp_get_add_friend_button( $potential_friend_id = false ) { 350 global $bp, $friends_template; 351 352 $button = false; 353 354 if ( is_user_logged_in() ) { 355 356 if ( !$potential_friend_id && $friends_template->friendship->friend ) 357 $potential_friend_id = $friends_template->friendship->friend->id; 358 else if ( !$potential_friend_id && !$friends_template->friendship->friend ) 359 $potential_friend_id = $bp->displayed_user->id; 360 361 if ( $bp->loggedin_user->id == $potential_friend_id ) 362 return false; 363 364 $friend_status = BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $potential_friend_id ); 365 366 $button = '<div class="generic-button friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">'; 367 if ( 'pending' == $friend_status ) { 368 $button .= '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '">' . __( 'Friendship Requested', 'buddypress' ) . '</a>'; 369 } else if ( 'is_friend' == $friend_status ) { 370 $button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id, 'friends_remove_friend' ) . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>'; 371 } else { 372 $button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id, 'friends_add_friend' ) . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>'; 373 } 374 $button .= '</div>'; 375 } 376 377 return apply_filters( 'bp_get_add_friend_button', $button ); 378 } 372 379 373 380 function bp_friends_header_tabs() { -
trunk/bp-groups/bp-groups-templatetags.php
r1834 r1844 309 309 310 310 $groups_template = new BP_Groups_User_Groups_Template( $user_id, $type, $per_page, $max, $slug, $filter ); 311 return $groups_template->has_groups();311 return apply_filters( 'bp_has_groups', $groups_template->has_groups(), &$groups_template ); 312 312 } 313 313 … … 1360 1360 1361 1361 $members_template = new BP_Groups_Group_Members_Template( $group_id, $per_page, $max, (int)$exclude_admins_mods, (int)$exclude_banned ); 1362 1363 return $members_template->has_members(); 1362 return apply_filters( 'bp_group_has_members', $members_template->has_members(), &$members_template ); 1364 1363 } 1365 1364 … … 1928 1927 1929 1928 $site_groups_template = new BP_Groups_Site_Groups_Template( $type, $per_page, $max ); 1930 1931 return $site_groups_template->has_groups(); 1929 return apply_filters( 'bp_has_site_groups', $site_groups_template->has_groups(), &$site_groups_template ); 1932 1930 } 1933 1931 … … 2213 2211 2214 2212 $requests_template = new BP_Groups_Membership_Requests_Template( $group_id, $per_page, $max ); 2215 return $requests_template->has_requests();2213 return apply_filters( 'bp_group_has_membership_requests', $requests_template->has_requests(), &$requests_template ); 2216 2214 } 2217 2215 … … 2359 2357 2360 2358 $invites_template = new BP_Groups_Invite_Template( $user_id, $group_id ); 2361 return $invites_template->has_invites();2359 return apply_filters( 'bp_group_has_invites', $invites_template->has_invites(), &$invites_template ); 2362 2360 } 2363 2361 -
trunk/bp-messages/bp-messages-templatetags.php
r1655 r1844 141 141 } 142 142 143 return $messages_template->has_threads();143 return apply_filters( 'bp_has_message_threads', $messages_template->has_threads(), &$messages_template ); 144 144 } 145 145 … … 434 434 435 435 function bp_send_message_button() { 436 global $bp;437 438 if ( bp_is_home() || !is_user_logged_in() )439 return false;440 441 $ud = get_userdata( $bp->displayed_user->id );442 ?>443 <div class="generic-button">444 <a class="send-message" title="<?php _e( 'Send Message', 'buddypress' ) ?>" href="<?php echo $bp->loggedin_user->domain . $bp->messages->slug ?>/compose/?r=<?php echo $ud->user_login ?>"><?php _e( 'Send Message', 'buddypress' ) ?></a>445 </div>446 <?php447 }448 449 function bp_message_loading_im age_src() {436 echo bp_get_send_message_button(); 437 } 438 function bp_get_send_message_button() { 439 global $bp; 440 441 if ( bp_is_home() || !is_user_logged_in() ) 442 return false; 443 444 $ud = get_userdata( $bp->displayed_user->id ); 445 446 return apply_filters( 'bp_get_send_message_button', '<div class="generic-button"><a class="send-message" title="' . __( 'Send Message', 'buddypress' ) . '" href="' . $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . $ud->user_login . '">' . __( 'Send Message', 'buddypress' ) . '</a></div>' ); 447 } 448 449 function bp_message_loading_imAage_src() { 450 450 echo bp_get_message_loading_image_src(); 451 451 } -
trunk/bp-wire/bp-wire-templatetags.php
r1834 r1844 120 120 121 121 $wire_posts_template = new BP_Wire_Posts_Template( $item_id, $component_slug, $can_post, $per_page, $max ); 122 return $wire_posts_template->has_wire_posts();122 return apply_filters( 'bp_has_wire_posts', $wire_posts_template->has_wire_posts(), &$wire_posts_template ); 123 123 } 124 124 -
trunk/bp-xprofile/bp-xprofile-templatetags.php
r1835 r1844 51 51 52 52 $this->group = $this->groups[$this->current_group]; 53 $this->field_count = count($this->group->fields);54 53 55 54 if ( !$fields = wp_cache_get( 'xprofile_fields_' . $this->group->id . '_' . $this->user_id, 'bp' ) ) { 56 for ( $i = 0; $i < $this->field_count; $i++ ) {55 for ( $i = 0; $i < count($this->group->fields); $i++ ) { 57 56 $field = new BP_XProfile_Field( $this->group->fields[$i]->id, $this->user_id ); 58 57 $fields[$i] = $field; … … 62 61 } 63 62 64 $this->group->fields = $fields; 63 $this->group->fields = apply_filters( 'xprofile_group_fields', $fields, $this->group->id ); 64 $this->field_count = count( $this->group->fields ); 65 65 66 66 return $this->group; … … 178 178 179 179 $profile_template = new BP_XProfile_Data_Template( $user_id, $profile_group_id ); 180 181 return $profile_template->has_groups(); 180 return apply_filters( 'bp_has_profile', $profile_template->has_groups(), $profile_template ); 182 181 } 183 182
Note: See TracChangeset
for help on using the changeset viewer.