Ticket #3456: 3456.01.patch
| File 3456.01.patch, 28.8 KB (added by , 14 years ago) |
|---|
-
bp-activity/bp-activity-template.php
class BP_Activity_Template { 174 174 'format' => '', 175 175 'total' => ceil( (int)$this->total_activity_count / (int)$this->pag_num ), 176 176 'current' => (int)$this->pag_page, 177 'prev_text' => '←',178 'next_text' => '→',177 'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '←', 'Activity pagination previous text', 'buddypress' ) ), 178 'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '→', 'Activity pagination next text', 'buddypress' ) ), 179 179 'mid_size' => 1 180 180 ) ); 181 181 } … … function bp_has_activities( $args = '' ) { 269 269 if ( 'public' != $bp->groups->current_group->status && ( groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) || $bp->loggedin_user->is_super_admin ) ) 270 270 $show_hidden = true; 271 271 } 272 272 273 273 // The default scope should recognize custom slugs 274 274 if ( array_key_exists( $bp->current_action, (array)$bp->loaded_components ) ) { 275 275 $scope = $bp->loaded_components[$bp->current_action]; … … function bp_has_activities( $args = '' ) { 280 280 // Support for permalinks on single item pages: /groups/my-group/activity/124/ 281 281 if ( bp_is_current_action( bp_get_activity_slug() ) ) 282 282 $include = bp_action_variable( 0 ); 283 283 284 284 // Note: any params used for filtering can be a single value, or multiple values comma separated. 285 285 $defaults = array( 286 286 'display_comments' => 'threaded', // false for none, stream/threaded - show comments in the stream or threaded under items … … function bp_activity_content() { 754 754 755 755 // Insert the time since. 756 756 $time_since = apply_filters_ref_array( 'bp_activity_time_since', array( '<span class="time-since">' . bp_core_time_since( $activities_template->activity->date_recorded ) . '</span>', &$activities_template->activity ) ); 757 757 758 758 // Insert the permalink 759 759 if ( !bp_is_single_activity() ) 760 760 $content = apply_filters_ref_array( 'bp_activity_permalink', array( sprintf( '%1$s <a href="%2$s" class="view activity-time-since" title="%3$s">%4$s</a>', $content, bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ), esc_attr__( 'View Discussion', 'buddypress' ), $time_since ), &$activities_template->activity ) ); … … function bp_activity_user_can_delete( $activity = false ) { 769 769 770 770 if ( !$activity ) 771 771 $activity = $activities_template->activity; 772 772 773 773 if ( isset( $activity->current_comment ) ) 774 774 $activity = $activity->current_comment; 775 775 … … function bp_activity_comments( $args = '' ) { 860 860 861 861 bp_activity_recurse_comments( $activities_template->activity ); 862 862 } 863 863 864 864 /** 865 865 * Loops through a level of activity comments and loads the template for each 866 866 * … … function bp_activity_comments( $args = '' ) { 874 874 */ 875 875 function bp_activity_recurse_comments( $comment ) { 876 876 global $activities_template, $bp, $counter; 877 877 878 878 if ( !$comment ) 879 879 return false; 880 880 881 881 if ( empty( $comment->children ) ) 882 882 return false; 883 883 … … function bp_activity_comments( $args = '' ) { 887 887 $activities_template->activity->current_comment = $comment_child; 888 888 889 889 $template = locate_template( 'activity/comment.php', false, false ); 890 890 891 891 // Backward compatibility. In older versions of BP, the markup was 892 892 // generated in the PHP instead of a template. This ensures that 893 893 // older themes (which are not children of bp-default and won't … … function bp_activity_comments( $args = '' ) { 895 895 if ( !$template ) { 896 896 $template = BP_PLUGIN_DIR . '/bp-themes/bp-default/activity/comment.php'; 897 897 } 898 898 899 899 load_template( $template, false ); 900 900 901 901 unset( $activities_template->activity->current_comment ); 902 902 } 903 903 echo '</ul>'; … … function bp_activity_comments( $args = '' ) { 914 914 */ 915 915 function bp_activity_current_comment() { 916 916 global $activities_template; 917 917 918 918 $current_comment = !empty( $activities_template->activity->current_comment ) ? $activities_template->activity->current_comment : false; 919 919 920 920 return apply_filters( 'bp_activity_current_comment', $current_comment ); 921 921 } 922 922 … … function bp_activity_comment_id() { 942 942 */ 943 943 function bp_get_activity_comment_id() { 944 944 global $activities_template; 945 945 946 946 $comment_id = isset( $activities_template->activity->current_comment->id ) ? $activities_template->activity->current_comment->id : false; 947 947 948 948 return apply_filters( 'bp_activity_comment_id', $comment_id ); 949 949 } 950 950 … … function bp_activity_comment_user_id() { 969 969 */ 970 970 function bp_get_activity_comment_user_id() { 971 971 global $activities_template; 972 972 973 973 $user_id = isset( $activities_template->activity->current_comment->user_id ) ? $activities_template->activity->current_comment->user_id : false; 974 974 975 975 return apply_filters( 'bp_activity_comment_user_id', $user_id ); 976 976 } 977 977 … … function bp_activity_comment_user_link() { 996 996 */ 997 997 function bp_get_activity_comment_user_link() { 998 998 $user_link = bp_core_get_user_domain( bp_get_activity_comment_user_id() ); 999 999 1000 1000 return apply_filters( 'bp_activity_comment_user_link', $user_link ); 1001 1001 } 1002 1002 … … function bp_activity_comment_name() { 1023 1023 */ 1024 1024 function bp_get_activity_comment_name() { 1025 1025 global $activities_template; 1026 1026 1027 1027 $name = apply_filters( 'bp_acomment_name', $activities_template->activity->current_comment->user_fullname, $activities_template->activity->current_comment ); // backward compatibility 1028 1028 1029 1029 return apply_filters( 'bp_activity_comment_name', $name ); 1030 1030 } 1031 1031 … … function bp_activity_comment_date_recorded() { 1050 1050 */ 1051 1051 function bp_get_activity_comment_date_recorded() { 1052 1052 global $activities_template; 1053 1053 1054 1054 if ( empty( $activities_template->activity->current_comment->date_recorded ) ) 1055 1055 return false; 1056 1056 1057 1057 $date_recorded = bp_core_time_since( $activities_template->activity->current_comment->date_recorded ); 1058 1058 1059 1059 return apply_filters( 'bp_activity_comment_date_recorded', $date_recorded ); 1060 1060 } 1061 1061 … … function bp_activity_comment_delete_link() { 1080 1080 */ 1081 1081 function bp_get_activity_comment_delete_link() { 1082 1082 global $bp; 1083 1083 1084 1084 $link = wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/delete/?cid=' . bp_get_activity_comment_id(), 'bp_activity_delete_link' ); 1085 1085 1086 1086 return apply_filters( 'bp_activity_comment_delete_link', $link ); 1087 1087 } 1088 1088 … … function bp_activity_comment_content() { 1111 1111 */ 1112 1112 function bp_get_activity_comment_content() { 1113 1113 global $activities_template; 1114 1114 1115 1115 $content = apply_filters( 'bp_get_activity_content', $activities_template->activity->current_comment->content ); 1116 1116 1117 1117 return apply_filters( 'bp_activity_comment_content', $content ); 1118 1118 } 1119 1119 -
bp-blogs/bp-blogs-template.php
class BP_Blogs_Template { 132 132 'format' => '', 133 133 'total' => ceil( (int)$this->total_blog_count / (int)$this->pag_num ), 134 134 'current' => (int)$this->pag_page, 135 'prev_text' => '←',136 'next_text' => '→',135 'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '←', 'Blog pagination previous text', 'buddypress' ) ), 136 'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '→', 'Blog pagination next text', 'buddypress' ) ), 137 137 'mid_size' => 1 138 138 ) ); 139 139 } … … function bp_blogs_blog_tabs() { 588 588 function bp_directory_blogs_search_form() { 589 589 global $bp; 590 590 591 $default_search_value = bp_get_search_default_text(); 591 $default_search_value = bp_get_search_default_text(); 592 592 $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?> 593 593 594 594 <form action="" method="get" id="search-blogs-form"> -
bp-forums/bp-forums-template.php
class BP_Forums_Template_Forum { 101 101 $this->__construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset, $number ); 102 102 } 103 103 104 function __construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) { 104 function __construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) { 105 105 global $bp; 106 106 107 107 $this->pag_page = $page; … … class BP_Forums_Template_Forum { 113 113 $this->number = $number; 114 114 115 115 switch ( $type ) { 116 case 'newest': default: 116 case 'newest': default: 117 117 $this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'forum_id' => $forum_id, 'filter' => $search_terms, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies, 'offset' => $offset, 'number' => $number ) ); 118 118 break; 119 119 … … class BP_Forums_Template_Forum { 152 152 } else { 153 153 $this->total_topic_count = (int)$max; 154 154 } 155 155 156 156 if ( $max ) { 157 157 if ( $max >= count($this->topics) ) { 158 158 $this->topic_count = count( $this->topics ); … … class BP_Forums_Template_Forum { 176 176 'format' => '', 177 177 'total' => ceil( (int)$this->total_topic_count / (int)$this->pag_num), 178 178 'current' => $this->pag_page, 179 'prev_text' => '←',180 'next_text' => '→',179 'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '←', 'Forum topic pagination previous text', 'buddypress' ) ), 180 'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '→', 'Forum topic pagination next text', 'buddypress' ) ), 181 181 'mid_size' => 1 182 182 ) ); 183 183 } … … function bp_has_forum_topics( $args = '' ) { 260 260 // User filtering 261 261 if ( !empty( $bp->displayed_user->id ) ) 262 262 $user_id = $bp->displayed_user->id; 263 263 264 264 // "Replied" query must be manually modified 265 265 if ( 'replies' == bp_current_action() ) { 266 266 $user_id = 0; // User id must be handled manually by the filter, not by BB_Query 267 267 268 268 add_filter( 'get_topics_distinct', 'bp_forums_add_replied_distinct_sql', 20 ); 269 269 add_filter( 'get_topics_join', 'bp_forums_add_replied_join_sql', 20 ); 270 270 add_filter( 'get_topics_where', 'bp_forums_add_replied_where_sql', 20 ); … … function bp_has_forum_topics( $args = '' ) { 285 285 // If $_GET['fs'] is set, let's auto populate the search_terms var 286 286 if ( bp_is_directory() && !empty( $_GET['fs'] ) ) 287 287 $search_terms = $_GET['fs']; 288 288 289 289 // Get the pagination arguments from $_REQUEST 290 290 $page = isset( $_REQUEST['p'] ) ? intval( $_REQUEST['p'] ) : 1; 291 291 $per_page = isset( $_REQUEST['n'] ) ? intval( $_REQUEST['n'] ) : 20; 292 292 293 293 // Unless set otherwise, stickies appear in normal order on the global forum directory 294 294 if ( bp_is_directory() && bp_is_forums_component() && !bp_forums_enable_global_directory_stickies() ) 295 295 $do_stickies = false; … … function bp_has_forum_topics( $args = '' ) { 315 315 if ( bp_is_current_action( 'tag' ) && $search_terms = bp_action_variable( 0 ) ) { 316 316 $type = 'tags'; 317 317 } 318 318 319 319 /** Sticky logic ******************************************************************/ 320 320 321 321 if ( $do_stickies ) { 322 322 // Fetch the stickies 323 323 $stickies_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, 0, 0, $max, 'sticky', $search_terms ); 324 324 325 325 // If stickies are found, try merging them 326 326 if ( $stickies_template->has_topics() ) { 327 328 // If stickies are for current $page 327 328 // If stickies are for current $page 329 329 $page_start_num = ( ( $page - 1 ) * $per_page ) + 1; 330 330 $page_end_num = $page * $per_page <= $stickies_template->total_topic_count ? $page * $per_page : $stickies_template->total_topic_count; 331 331 332 332 // Calculate the number of sticky topics that will be shown on this page 333 333 if ( $stickies_template->topic_count < $page_start_num ) { 334 334 $this_page_stickies = 0; 335 } else { 335 } else { 336 336 $this_page_stickies = $stickies_template->topic_count - $per_page * floor( $stickies_template->topic_count / $per_page ) * ( $page - 1 ); // Total stickies minus sticky count through this page 337 337 338 338 // $this_page_stickies cannot be more than $per_page or less than 0 339 339 if ( $this_page_stickies > $per_page ) 340 340 $this_page_stickies = $per_page; 341 341 else if ( $this_page_stickies < 0 ) 342 342 $this_page_stickies = 0; 343 343 } 344 344 345 345 // Calculate the total number of topics that will be shown on this page 346 346 $this_page_topics = $stickies_template->total_topic_count >= ( $page * $per_page ) ? $per_page : $page_end_num - ( $page_start_num - 1 ); 347 347 348 348 // If the number of stickies to be shown is less than $per_page, fetch some 349 349 // non-stickies to fill in the rest 350 350 if ( $this_page_stickies < $this_page_topics ) { 351 351 // How many non-stickies do we need? 352 352 $non_sticky_number = $this_page_topics - $this_page_stickies; 353 354 // Calculate the non-sticky offset 353 354 // Calculate the non-sticky offset 355 355 // How many non-stickies on all pages up to this point? 356 356 $non_sticky_total = $page_end_num - $stickies_template->topic_count; 357 357 358 358 // The offset is the number of total non-stickies, less the number 359 359 // to be shown on this page 360 360 $non_sticky_offset = $non_sticky_total - $non_sticky_number; 361 361 362 362 // Fetch the non-stickies 363 363 $forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, 1, $per_page, $max, 'no', $search_terms, $non_sticky_offset, $non_sticky_number ); 364 364 365 365 // If there are stickies to merge on this page, do it now 366 366 if ( $this_page_stickies ) { 367 367 // Correct the topic_count 368 368 $forum_template->topic_count += (int)$this_page_stickies; 369 369 370 370 // Figure out which stickies need to be included 371 371 $this_page_sticky_topics = array_slice( $stickies_template->topics, 0 - $this_page_stickies ); 372 372 373 373 // Merge these topics into the forum template 374 374 $forum_template->topics = array_merge( $this_page_sticky_topics, (array)$forum_template->topics ); 375 375 } 376 376 } else { 377 377 // This page has no non-stickies 378 378 $forum_template = $stickies_template; 379 379 380 380 // Adjust the topic count and trim the topics 381 381 $forum_template->topic_count = $this_page_stickies; 382 $forum_template->topics = array_slice( $forum_template->topics, $page - 1 ); 382 $forum_template->topics = array_slice( $forum_template->topics, $page - 1 ); 383 383 } 384 384 385 385 // Because we're using a manual offset and number for the topic query, we 386 386 // must set the page number manually, and recalculate the pagination links 387 387 $forum_template->pag_num = $per_page; 388 388 $forum_template->pag_page = $page; 389 389 390 390 $forum_template->pag_links = paginate_links( array( 391 391 'base' => add_query_arg( array( 'p' => '%#%', 'n' => $forum_template->pag_num ) ), 392 392 'format' => '', 393 393 'total' => ceil( (int)$forum_template->total_topic_count / (int)$forum_template->pag_num ), 394 394 'current' => $forum_template->pag_page, 395 'prev_text' => '←',396 'next_text' => '→',395 'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '←', 'Forum topic pagination previous text', 'buddypress' ) ), 396 'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '→', 'Forum topic pagination next text', 'buddypress' ) ), 397 397 'mid_size' => 1 398 398 ) ); 399 399 400 400 } else { 401 401 // Fetch the non-sticky topics if no stickies were found 402 402 $forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, 'all', $search_terms ); … … function bp_has_forum_topics( $args = '' ) { 405 405 // When skipping the sticky logic, just pull up the forum topics like usual 406 406 $forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, 'all', $search_terms ); 407 407 } 408 408 409 409 return apply_filters( 'bp_has_topics', $forum_template->has_topics(), $forum_template ); 410 410 } 411 411 … … function bp_forum_topic_type() { 864 864 */ 865 865 function bp_forums_tag_name() { 866 866 echo bp_get_forums_tag_name(); 867 } 867 } 868 868 /** 869 869 * Outputs the currently viewed tag name 870 870 * … … function bp_forums_tag_name() { 873 873 */ 874 874 function bp_get_forums_tag_name() { 875 875 $tag_name = bp_is_directory() && bp_is_forums_component() ? bp_action_variable( 0 ) : false; 876 876 877 877 return apply_filters( 'bp_get_forums_tag_name', $tag_name ); 878 878 } 879 879 … … class BP_Forums_Template_Topic { 939 939 function BP_Forums_Template_Topic( $topic_id, $per_page, $max, $order ) { 940 940 $this->__construct( $topic_id, $per_page, $max, $order ); 941 941 } 942 942 943 943 function __construct( $topic_id, $per_page, $max, $order ) { 944 944 global $bp, $current_user, $forum_template; 945 945 … … class BP_Forums_Template_Topic { 973 973 $this->post_count = count( $this->posts ); 974 974 } 975 975 } 976 976 977 977 // Load topic tags 978 978 $this->topic_tags = bb_get_topic_tags( $this->topic_id ); 979 979 … … class BP_Forums_Template_Topic { 983 983 'format' => '', 984 984 'total' => ceil( (int)$this->total_post_count / (int)$this->pag_num ), 985 985 'current' => $this->pag_page, 986 'prev_text' => '←',987 'next_text' => '→',986 'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '←', 'Forum thread pagination previous text', 'buddypress' ) ), 987 'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '→', 'Forum thread pagination next text', 'buddypress' ) ), 988 988 'mid_size' => 1 989 989 ) ); 990 990 … … function bp_has_forum_topic_posts( $args = '' ) { 1068 1068 if ( bp_is_groups_component() && $topic_template->forum_id != groups_get_groupmeta( bp_get_current_group_id(), 'forum_id' ) ) 1069 1069 return false; 1070 1070 } 1071 1071 1072 1072 return apply_filters( 'bp_has_topic_posts', $topic_template->has_posts(), $topic_template ); 1073 1073 } 1074 1074 … … function bp_forum_topic_tag_list() { 1334 1334 */ 1335 1335 function bp_get_forum_topic_tag_list( $format = 'string' ) { 1336 1336 global $topic_template; 1337 1337 1338 1338 $tags_data = !empty( $topic_template->topic_tags ) ? $topic_template->topic_tags : false; 1339 1339 1340 1340 $tags = array(); 1341 1341 1342 1342 if ( $tags_data ) { 1343 1343 foreach( $tags_data as $tag_data ) { 1344 1344 $tags[] = $tag_data->name; 1345 1345 } 1346 1346 } 1347 1347 1348 1348 if ( 'string' == $format ) 1349 1349 $tags = implode( ', ', $tags ); 1350 1350 1351 1351 return apply_filters( 'bp_forum_topic_tag_list', $tags, $format ); 1352 1352 } 1353 1353 … … function bp_forum_topic_tag_list() { 1361 1361 */ 1362 1362 function bp_forum_topic_has_tags() { 1363 1363 global $topic_template; 1364 1364 1365 1365 $has_tags = false; 1366 1366 1367 1367 if ( !empty( $topic_template->topic_tags ) ) 1368 1368 $has_tags = true; 1369 1369 1370 1370 return apply_filters( 'bp_forum_topic_has_tags', $has_tags ); 1371 1371 } 1372 1372 -
bp-groups/bp-groups-template.php
class BP_Groups_Template { 168 168 'format' => '', 169 169 'total' => ceil( (int)$this->total_group_count / (int)$this->pag_num ), 170 170 'current' => $this->pag_page, 171 'prev_text' => '←',172 'next_text' => '→',171 'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '←', 'Group pagination previous text', 'buddypress' ) ), 172 'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '→', 'Group pagination next text', 'buddypress' ) ), 173 173 'mid_size' => 1 174 174 ) ); 175 175 } … … function bp_group_admin_ids( $group = false, $format = 'string' ) { 625 625 626 626 $admin_ids = array(); 627 627 628 if ( $group->admins ) { 628 if ( $group->admins ) { 629 629 foreach( $group->admins as $admin ) { 630 630 $admin_ids[] = $admin->user_id; 631 631 } 632 632 } 633 634 if ( 'string' == $format ) 633 634 if ( 'string' == $format ) 635 635 $admin_ids = implode( ',', $admin_ids ); 636 636 637 637 return apply_filters( 'bp_group_admin_ids', $admin_ids ); 638 638 } 639 639 … … function bp_group_mod_ids( $group = false, $format = 'string' ) { 655 655 656 656 $mod_ids = array(); 657 657 658 if ( $group->mods ) { 658 if ( $group->mods ) { 659 659 foreach( $group->mods as $mod ) { 660 660 $mod_ids[] = $mod->user_id; 661 661 } 662 662 } 663 664 if ( 'string' == $format ) 663 664 if ( 'string' == $format ) 665 665 $mod_ids = implode( ',', $mod_ids ); 666 666 667 667 return apply_filters( 'bp_group_mod_ids', $mod_ids ); 668 668 } 669 669 … … function bp_group_show_status_setting( $setting, $group = false ) { 896 896 * @param str $setting The setting you want to check against ('members', 'mods', or 'admins') 897 897 * @param obj $group (optional) The group whose status you want to check 898 898 */ 899 function bp_group_show_invite_status_setting( $setting, $group = false ) { 899 function bp_group_show_invite_status_setting( $setting, $group = false ) { 900 900 $group_id = isset( $group->id ) ? $group->id : false; 901 901 902 902 $invite_status = bp_group_get_invite_status( $group_id ); 903 903 904 904 if ( $setting == $invite_status ) 905 905 echo ' checked="checked"'; 906 906 } … … function bp_group_show_invite_status_setting( $setting, $group = false ) { 924 924 */ 925 925 function bp_group_get_invite_status( $group_id = false ) { 926 926 global $bp, $groups_template; 927 927 928 928 if ( !$group_id ) { 929 929 if ( isset( $bp->groups->current_group->id ) ) { 930 930 // Default to the current group first … … function bp_group_get_invite_status( $group_id = false ) { 936 936 return false; 937 937 } 938 938 } 939 939 940 940 $invite_status = groups_get_groupmeta( $group_id, 'invite_status' ); 941 941 942 942 // Backward compatibility. When 'invite_status' is not set, fall back to a default value … … function bp_group_get_invite_status( $group_id = false ) { 957 957 * @param int $group_id (optional) The id of the group whose status you want to check 958 958 * @return bool $can_send_invites 959 959 */ 960 function bp_groups_user_can_send_invites( $group_id = false ) { 961 global $bp; 960 function bp_groups_user_can_send_invites( $group_id = false ) { 961 global $bp; 962 962 963 963 $can_send_invites = false; 964 964 $invite_status = false; 965 965 966 966 if ( is_user_logged_in() ) { 967 if ( is_super_admin() ) { 968 // Super admins can always send invitations 967 if ( is_super_admin() ) { 968 // Super admins can always send invitations 969 969 $can_send_invites = true; 970 970 971 971 } else { … … function bp_groups_user_can_send_invites( $group_id = false ) { 982 982 return false; 983 983 984 984 switch ( $invite_status ) { 985 case 'admins' : 986 if ( groups_is_user_admin( bp_loggedin_user_id(), $group_id ) ) 985 case 'admins' : 986 if ( groups_is_user_admin( bp_loggedin_user_id(), $group_id ) ) 987 987 $can_send_invites = true; 988 988 break; 989 989 … … function bp_groups_user_can_send_invites( $group_id = false ) { 1001 1001 } 1002 1002 1003 1003 return apply_filters( 'bp_groups_user_can_send_invites', $can_send_invites, $group_id, $invite_status ); 1004 } 1004 } 1005 1005 1006 1006 /** 1007 1007 * Since BuddyPress 1.0, this generated the group settings admin/member screen. … … class BP_Groups_Group_Members_Template { 1668 1668 var $total_group_count; 1669 1669 1670 1670 function bp_groups_group_members_template( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ) { 1671 $this->__construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ); 1671 $this->__construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ); 1672 1672 } 1673 1673 1674 1674 function __construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ) { 1675 1675 global $bp; 1676 1676 … … class BP_Groups_Membership_Requests_Template { 2398 2398 function bp_groups_membership_requests_template( $group_id, $per_page, $max ) { 2399 2399 $this->__construct( $group_id, $per_page, $max ); 2400 2400 } 2401 2402 2401 2402 2403 2403 function __construct( $group_id, $per_page, $max ) { 2404 2404 2405 2405 global $bp; 2406 2406 2407 2407 $this->pag_page = isset( $_REQUEST['mrpage'] ) ? intval( $_REQUEST['mrpage'] ) : 1; … … class BP_Groups_Invite_Template { 2572 2572 var $total_invite_count; 2573 2573 2574 2574 function bp_groups_invite_template( $user_id, $group_id ) { 2575 $this->__construct( $user_id, $group_id ); 2575 $this->__construct( $user_id, $group_id ); 2576 2576 } 2577 2577 2578 2578 function __construct( $user_id, $group_id ) { 2579 2579 2580 2580 global $bp; 2581 2581 2582 2582 $this->invites = groups_get_invites_for_group( $user_id, $group_id ); 2583 2583 $this->invite_count = count( $this->invites ); 2584 2584 … … function bp_group_activity_feed_link() { 2752 2752 */ 2753 2753 function bp_current_group_id() { 2754 2754 echo bp_get_current_group_id(); 2755 } 2755 } 2756 2756 /** 2757 2757 * Returns the ID of the current group 2758 2758 * … … function bp_current_group_id() { 2760 2760 * @since 1.5 2761 2761 * @uses apply_filters() Filter bp_get_current_group_id to modify this output 2762 2762 * 2763 * @return int $current_group_id The id of the current group, if there is one 2763 * @return int $current_group_id The id of the current group, if there is one 2764 2764 */ 2765 2765 function bp_get_current_group_id() { 2766 2766 $current_group = groups_get_current_group(); 2767 2767 2768 2768 $current_group_id = isset( $current_group->id ) ? (int)$current_group->id : 0; 2769 2769 2770 2770 return apply_filters( 'bp_get_current_group_id', $current_group_id, $current_group ); 2771 2771 } 2772 2772 … … function bp_current_group_id() { 2778 2778 */ 2779 2779 function bp_current_group_slug() { 2780 2780 echo bp_get_current_group_slug(); 2781 } 2781 } 2782 2782 /** 2783 2783 * Returns the slug of the current group 2784 2784 * … … function bp_current_group_slug() { 2786 2786 * @since 1.5 2787 2787 * @uses apply_filters() Filter bp_get_current_group_slug to modify this output 2788 2788 * 2789 * @return str $current_group_slug The slug of the current group, if there is one 2789 * @return str $current_group_slug The slug of the current group, if there is one 2790 2790 */ 2791 2791 function bp_get_current_group_slug() { 2792 2792 $current_group = groups_get_current_group(); 2793 2793 2794 2794 $current_group_slug = isset( $current_group->slug ) ? $current_group->slug : ''; 2795 2795 2796 2796 return apply_filters( 'bp_get_current_group_slug', $current_group_slug, $current_group ); 2797 2797 } 2798 2798 … … function bp_current_group_name() { 2811 2811 * @since 1.5 2812 2812 * @uses apply_filters() Filter bp_get_current_group_name to modify this output 2813 2813 * 2814 * @return str The name of the current group, if there is one 2814 * @return str The name of the current group, if there is one 2815 2815 */ 2816 2816 function bp_get_current_group_name() { 2817 2817 global $bp; -
bp-members/bp-members-template.php
class BP_Core_Members_Template { 174 174 175 175 function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) { 176 176 global $bp; 177 177 178 178 $this->pag_page = !empty( $_REQUEST['upage'] ) ? intval( $_REQUEST['upage'] ) : (int)$page_number; 179 179 $this->pag_num = !empty( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : (int)$per_page; 180 180 $this->type = $type; … … class BP_Core_Members_Template { 209 209 'format' => '', 210 210 'total' => ceil( (int)$this->total_member_count / (int)$this->pag_num ), 211 211 'current' => (int) $this->pag_page, 212 'prev_text' => '←',213 'next_text' => '→',212 'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', __( '←', 'buddypress' ) ), 213 'next_text' => apply_filters( 'bp_loop_pagination_next_text', __( '→', 'buddypress' ) ), 214 214 'mid_size' => 1 215 215 ) ); 216 216 } … … function bp_has_members( $args = '' ) { 296 296 297 297 'user_id' => $user_id, // Pass a user_id to only show friends of this user 298 298 'search_terms' => $search_terms, // Pass search_terms to filter users by their profile data 299 299 300 300 'meta_key' => false, // Only return users with this usermeta 301 301 'meta_value' => false, // Only return users where the usermeta value matches. Requires meta_key 302 302 … … function bp_member_name() { 523 523 */ 524 524 function bp_get_member_name() { 525 525 global $members_template; 526 526 527 527 // Generally, this only fires when xprofile is disabled 528 528 if ( empty( $members_template->member->fullname ) ) { 529 529 // Our order of preference for alternative fullnames … … function bp_last_activity( $user_id = 0 ) { 815 815 $last_activity = bp_core_get_last_activity( bp_get_user_meta( $user_id, 'last_activity', true ), __('active %s', 'buddypress') ); 816 816 817 817 return apply_filters( 'bp_get_last_activity', $last_activity ); 818 } 818 } 819 819 820 820 function bp_user_firstname() { 821 821 echo bp_get_user_firstname(); -
bp-messages/bp-messages-template.php
Class BP_Messages_Box_Template { 72 72 'format' => '', 73 73 'total' => ceil( (int)$this->total_thread_count / (int)$this->pag_num ), 74 74 'current' => $this->pag_page, 75 'prev_text' => '←',76 'next_text' => '→',75 'prev_text' => apply_filters( 'bp_loop_pagination_prev_text', _x( '←', 'Message pagination previous text', 'buddypress' ) ), 76 'next_text' => apply_filters( 'bp_loop_pagination_next_text', _x( '→', 'Message pagination next text', 'buddypress' ) ), 77 77 'mid_size' => 1 78 78 ) ); 79 79 }