Ticket #6097: 6097.patch
| File 6097.patch, 33.0 KB (added by , 11 years ago) |
|---|
-
bp-activity/bp-activity-actions.php
91 91 } 92 92 93 93 // Set redirect to users' activity stream 94 } else if ( ! empty( $activity->user_id ) ) {94 } elseif ( ! empty( $activity->user_id ) ) { 95 95 $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/'; 96 96 } 97 97 … … 339 339 $activity_id = bp_activity_post_update( array( 'content' => $content ) ); 340 340 341 341 // Post to groups object 342 } else if ( 'groups' == $object && bp_is_active( 'groups' ) ) {342 } elseif ( 'groups' == $object && bp_is_active( 'groups' ) ) { 343 343 if ( (int) $item_id ) { 344 344 $activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) ); 345 345 } -
bp-activity/bp-activity-classes.php
169 169 170 170 // If no callback is available, use the literal string from 171 171 // the database row 172 } else if ( ! empty( $row->action ) ) {172 } elseif ( ! empty( $row->action ) ) { 173 173 $this->action = $row->action; 174 174 175 175 // Provide a fallback to avoid PHP notices … … 1110 1110 $comments = false; 1111 1111 1112 1112 // A true cache miss 1113 } else if ( empty( $comments ) ) {1113 } elseif ( empty( $comments ) ) { 1114 1114 1115 1115 // Select the user's fullname with the query 1116 1116 if ( bp_is_active( 'xprofile' ) ) { -
bp-activity/bp-activity-template.php
662 662 // into bp-custom.php or your theme's functions.php 663 663 if ( isset( $_GET['afilter'] ) && apply_filters( 'bp_activity_enable_afilter_support', false ) ) 664 664 $filter = array( 'object' => $_GET['afilter'] ); 665 else if ( ! empty( $user_id ) || ! empty( $object ) || ! empty( $action ) || ! empty( $primary_id ) || ! empty( $secondary_id ) || ! empty( $offset ) || ! empty( $since ) )665 elseif ( ! empty( $user_id ) || ! empty( $object ) || ! empty( $action ) || ! empty( $primary_id ) || ! empty( $secondary_id ) || ! empty( $offset ) || ! empty( $since ) ) 666 666 $filter = array( 'user_id' => $user_id, 'object' => $object, 'action' => $action, 'primary_id' => $primary_id, 'secondary_id' => $secondary_id, 'offset' => $offset, 'since' => $since ); 667 667 else 668 668 $filter = false; … … 3673 3673 } 3674 3674 3675 3675 // On individual group pages, default to 'group' 3676 } else if ( bp_is_active( 'groups' ) && bp_is_group() ) {3676 } elseif ( bp_is_active( 'groups' ) && bp_is_group() ) { 3677 3677 $context = 'group'; 3678 3678 3679 3679 // 'activity' everywhere else -
bp-blogs/bp-blogs-functions.php
438 438 bp_blogs_record_post( $post->ID, $post ); 439 439 440 440 // Unpublishing a previously published post 441 } else if ( 'publish' === $old_status ) {441 } elseif ( 'publish' === $old_status ) { 442 442 // Some form of pending status 443 443 // Only remove the activity entry 444 444 bp_blogs_delete_activity( array( -
bp-core/bp-core-avatars.php
423 423 // Set gravatar size 424 424 if ( false !== $width ) { 425 425 $grav_size = $width; 426 } else if ( 'full' == $type ) {426 } elseif ( 'full' == $type ) { 427 427 $grav_size = bp_core_avatar_full_width(); 428 } else if ( 'thumb' == $type ) {428 } elseif ( 'thumb' == $type ) { 429 429 $grav_size = bp_core_avatar_thumb_width(); 430 430 } 431 431 432 432 // Set gravatar type 433 433 if ( empty( $bp->grav_default->{$object} ) ) { 434 434 $default_grav = 'wavatar'; 435 } else if ( 'mystery' == $bp->grav_default->{$object} ) {435 } elseif ( 'mystery' == $bp->grav_default->{$object} ) { 436 436 $default_grav = apply_filters( 'bp_core_mysteryman_src', 'mm', $grav_size ); 437 437 } else { 438 438 $default_grav = $bp->grav_default->{$object}; … … 442 442 if ( empty( $email ) ) { 443 443 if ( 'user' == $object ) { 444 444 $email = bp_core_get_user_email( $item_id ); 445 } else if ( 'group' == $object || 'blog' == $object ) {445 } elseif ( 'group' == $object || 'blog' == $object ) { 446 446 $email = "{$item_id}-{$object}@{bp_get_root_domain()}"; 447 447 } 448 448 } … … 504 504 if ( empty( $item_id ) ) { 505 505 if ( 'user' == $object ) 506 506 $item_id = bp_displayed_user_id(); 507 else if ( 'group' == $object )507 elseif ( 'group' == $object ) 508 508 $item_id = buddypress()->groups->current_group->id; 509 else if ( 'blog' == $object )509 elseif ( 'blog' == $object ) 510 510 $item_id = $current_blog->id; 511 511 512 512 $item_id = apply_filters( 'bp_core_avatar_item_id', $item_id, $object ); … … 517 517 if ( empty( $avatar_dir ) ) { 518 518 if ( 'user' == $object ) 519 519 $avatar_dir = 'avatars'; 520 else if ( 'group' == $object )520 elseif ( 'group' == $object ) 521 521 $avatar_dir = 'group-avatars'; 522 else if ( 'blog' == $object )522 elseif ( 'blog' == $object ) 523 523 $avatar_dir = 'blog-avatars'; 524 524 525 525 $avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object ); … … 838 838 } 839 839 840 840 // If passed a number, assume it was a $user_id 841 } else if ( is_numeric( $user ) ) {841 } elseif ( is_numeric( $user ) ) { 842 842 $id = $user; 843 843 844 844 // If passed a string and that string returns a user, get the $id … … 1152 1152 $avatar = BP_AVATAR_DEFAULT; 1153 1153 1154 1154 // Use the local default image 1155 } else if ( 'local' === $type ) {1155 } elseif ( 'local' === $type ) { 1156 1156 $avatar = buddypress()->plugin_url . 'bp-core/images/mystery-man.jpg'; 1157 1157 1158 1158 // Use Gravatar's mystery man as fallback … … 1188 1188 $avatar = BP_AVATAR_DEFAULT_THUMB; 1189 1189 1190 1190 // Use the local default image 1191 } else if ( 'local' === $type ) {1191 } elseif ( 'local' === $type ) { 1192 1192 $avatar = buddypress()->plugin_url . 'bp-core/images/mystery-man-50.jpg'; 1193 1193 1194 1194 // Use Gravatar's mystery man as fallback -
bp-core/bp-core-buddybar.php
385 385 386 386 // In the case of a user page, we try to assume a 387 387 // redirect URL 388 } else if ( bp_is_user() ) {388 } elseif ( bp_is_user() ) { 389 389 390 390 // Redirect to the displayed user's default 391 391 // component, as long as that component is -
bp-core/bp-core-catchuri.php
670 670 // Except when the front page is set to the registration page 671 671 // and the current user is logged in. In this case we send to 672 672 // the members directory to avoid redirect loops 673 } else if ( bp_is_register_page() && 'register' == $front_page_component && is_user_logged_in() ) {673 } elseif ( bp_is_register_page() && 'register' == $front_page_component && is_user_logged_in() ) { 674 674 $bp->canonical_stack['canonical_url'] = apply_filters( 'bp_loggedin_register_page_redirect_to', trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) ); 675 675 } 676 676 } -
bp-core/bp-core-classes.php
269 269 if ( 'newest' == $type ) { 270 270 $sql['orderby'] = "ORDER BY u.user_id"; 271 271 $sql['order'] = "DESC"; 272 } else if ( 'random' == $type ) {272 } elseif ( 'random' == $type ) { 273 273 $sql['orderby'] = "ORDER BY rand()"; 274 274 } else { 275 275 $sql['orderby'] = "ORDER BY u.date_recorded"; … … 1981 1981 1982 1982 // No button if viewing your own profile (and not in 1983 1983 // a members loop) 1984 } else if ( bp_is_my_profile() ) {1984 } elseif ( bp_is_my_profile() ) { 1985 1985 return false; 1986 1986 } 1987 1987 } -
bp-core/bp-core-cssjs.php
125 125 $crop_right = $image[0]; 126 126 127 127 // Less than 2x full-width: cropper defaults to full-width 128 } else if ( $image[0] < ( $full_width * 2 ) ) {128 } elseif ( $image[0] < ( $full_width * 2 ) ) { 129 129 $padding_w = round( ( $image[0] - $full_width ) / 2 ); 130 130 $crop_left = $padding_w; 131 131 $crop_right = $image[0] - $padding_w; … … 142 142 $crop_bottom = $image[1]; 143 143 144 144 // Less than double full-height: cropper defaults to full-height 145 } else if ( $image[1] < ( $full_height * 2 ) ) {145 } elseif ( $image[1] < ( $full_height * 2 ) ) { 146 146 $padding_h = round( ( $image[1] - $full_height ) / 2 ); 147 147 $crop_top = $padding_h; 148 148 $crop_bottom = $image[1] - $padding_h; -
bp-core/bp-core-filters.php
375 375 * And the super admin goes in pending accounts to resend it. In this case, as the 376 376 * meta['password'] is not set, the activation url must be WordPress one 377 377 */ 378 } else if ( buddypress()->members->admin->signups_page == get_current_screen()->id ) {378 } elseif ( buddypress()->members->admin->signups_page == get_current_screen()->id ) { 379 379 $is_hashpass_in_meta = maybe_unserialize( $meta ); 380 380 381 381 if ( empty( $is_hashpass_in_meta['password'] ) ) { -
bp-core/bp-core-functions.php
116 116 foreach ( $func_args as $indexi => $index ) { 117 117 if ( isset( $index->' . $key . ' ) ) { 118 118 $values[ $indexi ] = $index->' . $key . '; 119 } else if ( isset( $index["' . $key . '"] ) ) {119 } elseif ( isset( $index["' . $key . '"] ) ) { 120 120 $values[ $indexi ] = $index["' . $key . '"]; 121 121 } 122 122 } … … 125 125 $cmp = strcmp( $values[0], $values[1] ); 126 126 if ( 0 > $cmp ) { 127 127 $retval = -1; 128 } else if ( 0 < $cmp ) {129 No newline at end of file 128 } elseif ( 0 < $cmp ) { 129 No newline at end of file 130 130 $retval = 1; 131 131 } else { -
bp-core/bp-core-theme-compatibility.php
$retval = 0;
288 288 289 289 // Bruteforce check for a BP template 290 290 // Examples are clones of bp-default 291 } else if ( locate_template( 'members/members-loop.php', false, false ) ) {291 } elseif ( locate_template( 'members/members-loop.php', false, false ) ) { 292 292 $theme_compat = false; 293 293 } 294 294 } -
bp-friends/bp-friends-actions.php
40 40 bp_core_add_message( __( 'Friendship requested', 'buddypress' ) ); 41 41 } 42 42 43 } else if ( 'is_friend' == $friendship_status ) {43 } elseif ( 'is_friend' == $friendship_status ) { 44 44 bp_core_add_message( __( 'You are already friends with this user', 'buddypress' ), 'error' ); 45 45 } else { 46 46 bp_core_add_message( __( 'You already have a pending friendship request with this user', 'buddypress' ), 'error' ); … … 78 78 bp_core_add_message( __( 'Friendship canceled', 'buddypress' ) ); 79 79 } 80 80 81 } else if ( 'is_friends' == $friendship_status ) {81 } elseif ( 'is_friends' == $friendship_status ) { 82 82 bp_core_add_message( __( 'You are not yet friends with this user', 'buddypress' ), 'error' ); 83 83 } else { 84 84 bp_core_add_message( __( 'You have a pending friendship request with this user', 'buddypress' ), 'error' ); -
bp-friends/bp-friends-template.php
242 242 243 243 if ( empty( $user_id ) && isset( $friends_template->friendship->friend ) ) 244 244 $user_id = $friends_template->friendship->friend->id; 245 else if ( empty( $user_id ) && !isset( $friends_template->friendship->friend ) )245 elseif ( empty( $user_id ) && !isset( $friends_template->friendship->friend ) ) 246 246 $user_id = bp_displayed_user_id(); 247 247 248 248 return apply_filters( 'bp_get_potential_friend_id', (int) $user_id ); -
bp-groups/bp-groups-actions.php
34 34 $user_has_access = true; 35 35 36 36 // User doesn't have access, so set up redirect args 37 } else if ( is_user_logged_in() ) {37 } elseif ( is_user_logged_in() ) { 38 38 $no_access_args = array( 39 39 'message' => __( 'You do not have access to this group.', 'buddypress' ), 40 40 'root' => bp_get_group_permalink( $current_group ) . 'home/', … … 183 183 184 184 if ( 'private' == $_POST['group-status'] ) 185 185 $group_status = 'private'; 186 else if ( 'hidden' == $_POST['group-status'] )186 elseif ( 'hidden' == $_POST['group-status'] ) 187 187 $group_status = 'hidden'; 188 188 189 189 if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $bp->groups->new_group_id, 'status' => $group_status, 'enable_forum' => $group_enable_forum ) ) ) { -
bp-groups/bp-groups-admin.php
102 102 103 103 bp_core_redirect( $redirect_to ); 104 104 105 } else if ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) {105 } elseif ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) { 106 106 // columns screen option 107 107 add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) ); 108 108 … … 308 308 309 309 if ( 'admin' == $existing_role || 'mod' == $existing_role ) { 310 310 $result = groups_demote_member( $user_id, $group_id ); 311 } else if ( 'banned' == $existing_role ) {311 } elseif ( 'banned' == $existing_role ) { 312 312 $result = groups_unban_member( $user_id, $group_id ); 313 313 } 314 314 … … 419 419 bp_groups_admin_edit(); 420 420 421 421 // Display the group deletion confirmation screen 422 } else if ( 'delete' == $doaction && ! empty( $_GET['gid'] ) ) {422 } elseif ( 'delete' == $doaction && ! empty( $_GET['gid'] ) ) { 423 423 bp_groups_admin_delete(); 424 424 425 425 // Otherwise, display the groups index screen … … 456 456 457 457 if ( ! empty( $errors ) ) { 458 458 $messages[] = __( 'An error occurred when trying to update your group details.', 'buddypress' ); 459 } else if ( ! empty( $updated ) ) {459 } elseif ( ! empty( $updated ) ) { 460 460 $messages[] = __( 'The group has been updated successfully.', 'buddypress' ); 461 461 } 462 462 -
bp-groups/bp-groups-classes.php
1296 1296 $is_member = '1'; 1297 1297 1298 1298 // invite_sent means the user has been invited 1299 } else if ( $user_status[ $gid ]->invite_sent ) {1299 } elseif ( $user_status[ $gid ]->invite_sent ) { 1300 1300 $is_invited = '1'; 1301 1301 1302 1302 // User has sent request, but has not been confirmed … … 1612 1612 $sql['where'][] = "inviter_id = 0"; 1613 1613 1614 1614 // The string 'any' matches any non-zero value (inviter_id != 0) 1615 } else if ( 'any' === $inviter_id ) {1615 } elseif ( 'any' === $inviter_id ) { 1616 1616 $sql['where'][] = "inviter_id != 0"; 1617 1617 1618 1618 // Assume that a list of inviter IDs has been passed … … 3370 3370 // constructor. So we always trust this value 3371 3371 $this->params['show_tab'] = 'noone'; 3372 3372 3373 } else if ( isset( $this->params_raw['enable_nav_item'] ) || isset( $this->params_raw['visibility'] ) ) {3373 } elseif ( isset( $this->params_raw['enable_nav_item'] ) || isset( $this->params_raw['visibility'] ) ) { 3374 3374 // If enable_nav_item or visibility is passed, 3375 3375 // we assume this is a legacy extension. 3376 3376 // Legacy behavior is that enable_nav_item=true + -
bp-groups/bp-groups-functions.php
906 906 groups_accept_membership_request( $membership_id, $user_id, $group_id ); 907 907 908 908 // Otherwise, create a new invitation 909 } else if ( ! groups_is_user_member( $user_id, $group_id ) && ! groups_check_user_has_invite( $user_id, $group_id, 'all' ) ) {909 } elseif ( ! groups_is_user_member( $user_id, $group_id ) && ! groups_check_user_has_invite( $user_id, $group_id, 'all' ) ) { 910 910 $invite = new BP_Groups_Member; 911 911 $invite->group_id = $group_id; 912 912 $invite->user_id = $user_id; -
bp-groups/bp-groups-loader.php
597 597 if ( bp_is_my_profile() && !bp_is_single_item() ) { 598 598 $bp->bp_options_title = _x( 'Memberships', 'My Groups page <title>', 'buddypress' ); 599 599 600 } else if ( !bp_is_my_profile() && !bp_is_single_item() ) {600 } elseif ( !bp_is_my_profile() && !bp_is_single_item() ) { 601 601 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 602 602 'item_id' => bp_displayed_user_id(), 603 603 'type' => 'thumb', … … 607 607 608 608 // We are viewing a single group, so set up the 609 609 // group navigation menu using the $this->current_group global. 610 } else if ( bp_is_single_item() ) {610 } elseif ( bp_is_single_item() ) { 611 611 $bp->bp_options_title = $this->current_group->name; 612 612 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 613 613 'item_id' => $this->current_group->id, -
bp-groups/bp-groups-screens.php
71 71 72 72 bp_core_redirect( $redirect_to ); 73 73 74 } else if ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) {74 } elseif ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) { 75 75 // Check the nonce 76 76 if ( !check_admin_referer( 'groups_reject_invite' ) ) 77 77 return false; … … 179 179 } 180 180 181 181 // Sticky a topic 182 else if ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {182 elseif ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { 183 183 // Check the nonce 184 184 check_admin_referer( 'bp_forums_stick_topic' ); 185 185 … … 194 194 } 195 195 196 196 // Un-Sticky a topic 197 else if ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {197 elseif ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { 198 198 // Check the nonce 199 199 check_admin_referer( 'bp_forums_unstick_topic' ); 200 200 … … 209 209 } 210 210 211 211 // Close a topic 212 else if ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {212 elseif ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { 213 213 // Check the nonce 214 214 check_admin_referer( 'bp_forums_close_topic' ); 215 215 … … 224 224 } 225 225 226 226 // Open a topic 227 else if ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {227 elseif ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { 228 228 // Check the nonce 229 229 check_admin_referer( 'bp_forums_open_topic' ); 230 230 … … 239 239 } 240 240 241 241 // Delete a topic 242 else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) {242 elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) { 243 243 // Fetch the topic 244 244 $topic = bp_forums_get_topic_details( $topic_id ); 245 245 … … 264 264 } 265 265 266 266 // Editing a topic 267 else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) {267 elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) { 268 268 // Fetch the topic 269 269 $topic = bp_forums_get_topic_details( $topic_id ); 270 270 … … 292 292 bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) ); 293 293 294 294 // Delete a post 295 } else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) {295 } elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) { 296 296 // Fetch the post 297 297 $post = bp_forums_get_post( $post_id ); 298 298 … … 316 316 bp_core_redirect( wp_get_referer() ); 317 317 318 318 // Editing a post 319 } else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) {319 } elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) { 320 320 321 321 // Fetch the post 322 322 $post = bp_forums_get_post( $post_id ); … … 379 379 380 380 if ( empty( $_POST['topic_title'] ) ) { 381 381 $error_message = __( 'Please provide a title for your forum topic.', 'buddypress' ); 382 } else if ( empty( $_POST['topic_text'] ) ) {382 } elseif ( empty( $_POST['topic_text'] ) ) { 383 383 $error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' ); 384 384 } 385 385 … … 492 492 if ( ! bp_groups_user_can_send_invites( $group_id ) ) { 493 493 $message = __( 'You are not allowed to send or remove invites', 'buddypress' ); 494 494 $error = 'error'; 495 } else if ( BP_Groups_Member::check_for_membership_request( $friend_id, $group_id ) ) {495 } elseif ( BP_Groups_Member::check_for_membership_request( $friend_id, $group_id ) ) { 496 496 $message = __( 'The member requested to join the group', 'buddypress' ); 497 497 $error = 'error'; 498 } else if ( ! groups_uninvite_user( $friend_id, $group_id ) ) {498 } elseif ( ! groups_uninvite_user( $friend_id, $group_id ) ) { 499 499 $message = __( 'There was an error removing the invite', 'buddypress' ); 500 500 $error = 'error'; 501 501 } -
bp-groups/bp-groups-template.php
233 233 234 234 if ( 'invites' == $type ) { 235 235 $this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page, $exclude ); 236 } else if ( 'single-group' == $type ) {236 } elseif ( 'single-group' == $type ) { 237 237 $this->single_group = true; 238 238 239 239 if ( groups_get_current_group() ) { … … 279 279 $this->total_group_count = (int) $this->groups['total']; 280 280 $this->group_count = (int) $this->groups['total']; 281 281 $this->groups = $this->groups['groups']; 282 } else if ( 'single-group' == $type ) {282 } elseif ( 'single-group' == $type ) { 283 283 if ( empty( $group->id ) ) { 284 284 $this->total_group_count = 0; 285 285 $this->group_count = 0; … … 706 706 707 707 if ( 'public' == $group->status ) { 708 708 $type = __( "Public Group", "buddypress" ); 709 } else if ( 'hidden' == $group->status ) {709 } elseif ( 'hidden' == $group->status ) { 710 710 $type = __( "Hidden Group", "buddypress" ); 711 } else if ( 'private' == $group->status ) {711 } elseif ( 'private' == $group->status ) { 712 712 $type = __( "Private Group", "buddypress" ); 713 713 } else { 714 714 $type = ucwords( $group->status ) . ' ' . __( 'Group', 'buddypress' ); … … 1858 1858 if ( isset( $bp->groups->current_group->id ) ) { 1859 1859 // Default to the current group first 1860 1860 $group_id = $bp->groups->current_group->id; 1861 } else if ( isset( $groups_template->group->id ) ) {1861 } elseif ( isset( $groups_template->group->id ) ) { 1862 1862 // Then see if we're in the loop 1863 1863 $group_id = $groups_template->group->id; 1864 1864 } else { … … 2866 2866 if ( ! bp_group_has_requested_membership() ) { 2867 2867 if ( is_user_logged_in() && bp_group_is_invited() ) { 2868 2868 $message = __( 'You must accept your pending invitation before you can access this private group.', 'buddypress' ); 2869 } else if ( is_user_logged_in() ) {2869 } elseif ( is_user_logged_in() ) { 2870 2870 $message = __( 'This is a private group and you must request group membership in order to join.', 'buddypress' ); 2871 2871 } else { 2872 2872 $message = __( 'This is a private group. To join you must be a registered site member and request group membership.', 'buddypress' ); -
bp-groups/bp-groups-widgets.php
92 92 printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() ); 93 93 if ( 'active' == $instance['group_default'] ) 94 94 printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); 95 else if ( 'popular' == $instance['group_default'] )95 elseif ( 'popular' == $instance['group_default'] ) 96 96 bp_group_member_count(); 97 97 ?> 98 98 </span> … … 202 202 <?php 203 203 if ( 'newest-groups' == $_POST['filter'] ) { 204 204 printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() ); 205 } else if ( 'recently-active-groups' == $_POST['filter'] ) {205 } elseif ( 'recently-active-groups' == $_POST['filter'] ) { 206 206 printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); 207 } else if ( 'popular-groups' == $_POST['filter'] ) {207 } elseif ( 'popular-groups' == $_POST['filter'] ) { 208 208 bp_group_member_count(); 209 209 } 210 210 ?> -
bp-members/bp-members-admin.php
1307 1307 bp_core_redirect( $redirect_to ); 1308 1308 1309 1309 // Handle activated accounts 1310 } else if ( 'do_activate' == $doaction ) {1310 } elseif ( 'do_activate' == $doaction ) { 1311 1311 1312 1312 // nonce check 1313 1313 check_admin_referer( 'signups_activate' ); … … 1334 1334 bp_core_redirect( $redirect_to ); 1335 1335 1336 1336 // Handle sign-ups delete 1337 } else if ( 'do_delete' == $doaction ) {1337 } elseif ( 'do_delete' == $doaction ) { 1338 1338 1339 1339 // nonce check 1340 1340 check_admin_referer( 'signups_delete' ); … … 1703 1703 $ids = false; 1704 1704 if ( ! empty( $_POST['allsignups'] ) ) { 1705 1705 $ids = wp_parse_id_list( $_POST['allsignups'] ); 1706 } else if ( ! empty( $_GET['signup_id'] ) ) {1706 } elseif ( ! empty( $_GET['signup_id'] ) ) { 1707 1707 $ids = absint( $_GET['signup_id'] ); 1708 1708 } 1709 1709 -
bp-members/bp-members-functions.php
1677 1677 1678 1678 // If a user ID is found, this may be a legacy signup, or one 1679 1679 // created locally for backward compatibility. Process it. 1680 } else if ( $key == wp_hash( $user_id ) ) {1680 } elseif ( $key == wp_hash( $user_id ) ) { 1681 1681 // Change the user's status so they become active 1682 1682 if ( ! $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 0 WHERE ID = %d", $user_id ) ) ) { 1683 1683 return new WP_Error( 'invalid_key', __( 'Invalid activation key', 'buddypress' ) ); … … 2100 2100 $is_login = false; 2101 2101 if ( isset( $_GLOBALS['pagenow'] ) && false !== strpos( $GLOBALS['pagenow'], 'wp-login.php' ) ) { 2102 2102 $is_login = true; 2103 } else if ( isset( $_SERVER['SCRIPT_NAME'] ) && false !== strpos( $_SERVER['SCRIPT_NAME'], 'wp-login.php' ) ) {2103 } elseif ( isset( $_SERVER['SCRIPT_NAME'] ) && false !== strpos( $_SERVER['SCRIPT_NAME'], 'wp-login.php' ) ) { 2104 2104 $is_login = true; 2105 2105 } 2106 2106 -
bp-members/bp-members-template.php
535 535 536 536 if ( 'active' == $members_template->type ) 537 537 $pag = sprintf( _n( 'Viewing 1 active member', 'Viewing %1$s - %2$s of %3$s active members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total ); 538 else if ( 'popular' == $members_template->type )538 elseif ( 'popular' == $members_template->type ) 539 539 $pag = sprintf( _n( 'Viewing 1 member with friends', 'Viewing %1$s - %2$s of %3$s members with friends', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total ); 540 else if ( 'online' == $members_template->type )540 elseif ( 'online' == $members_template->type ) 541 541 $pag = sprintf( _n( 'Viewing 1 online member', 'Viewing %1$s - %2$s of %3$s online members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total ); 542 542 else 543 543 $pag = sprintf( _n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total ); … … 1773 1773 // Set default gravatar type 1774 1774 if ( empty( $bp->grav_default->user ) ) 1775 1775 $default_grav = 'wavatar'; 1776 else if ( 'mystery' == $bp->grav_default->user )1776 elseif ( 'mystery' == $bp->grav_default->user ) 1777 1777 $default_grav = $bp->plugin_url . 'bp-core/images/mystery-man.jpg'; 1778 1778 else 1779 1779 $default_grav = $bp->grav_default->user; -
bp-messages/bp-messages-classes.php
349 349 350 350 if ( $type == 'unread' ) 351 351 $type_sql = " AND unread_count != 0 "; 352 else if ( $type == 'read' )352 elseif ( $type == 'read' ) 353 353 $type_sql = " AND unread_count = 0 "; 354 354 355 355 return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(thread_id) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0{$exclude_sender} {$type_sql}", $user_id ) ); -
bp-messages/bp-messages-screens.php
152 152 } else { 153 153 bp_core_add_message( __('Notice deactivated.', 'buddypress') ); 154 154 } 155 } else if ( bp_is_action_variable( 'activate', 0 ) ) {155 } elseif ( bp_is_action_variable( 'activate', 0 ) ) { 156 156 if ( !$notice->activate() ) { 157 157 bp_core_add_message( __('There was a problem activating that notice.', 'buddypress'), 'error' ); 158 158 } else { 159 159 bp_core_add_message( __('Notice activated.', 'buddypress') ); 160 160 } 161 } else if ( bp_is_action_variable( 'delete' ) ) {161 } elseif ( bp_is_action_variable( 'delete' ) ) { 162 162 if ( !$notice->delete() ) { 163 163 bp_core_add_message( __('There was a problem deleting that notice.', 'buddypress'), 'buddypress' ); 164 164 } else { -
bp-messages/bp-messages-template.php
800 800 function bp_get_messages_username_value() { 801 801 if ( isset( $_COOKIE['bp_messages_send_to'] ) ) { 802 802 return apply_filters( 'bp_get_messages_username_value', $_COOKIE['bp_messages_send_to'] ); 803 } else if ( isset( $_GET['r'] ) && !isset( $_COOKIE['bp_messages_send_to'] ) ) {803 } elseif ( isset( $_GET['r'] ) && !isset( $_COOKIE['bp_messages_send_to'] ) ) { 804 804 return apply_filters( 'bp_get_messages_username_value', $_GET['r'] ); 805 805 } 806 806 } -
bp-templates/bp-legacy/buddypress-functions.php
1044 1044 $user_status = 'is_pending'; 1045 1045 1046 1046 // Create the user invitation 1047 } else if ( groups_invite_user( array( 'user_id' => $friend_id, 'group_id' => $group_id ) ) ) {1047 } elseif ( groups_invite_user( array( 'user_id' => $friend_id, 'group_id' => $group_id ) ) ) { 1048 1048 $user_status = 'is_invited'; 1049 1049 1050 1050 // Miscellaneous failure -
bp-xprofile/bp-xprofile-admin.php
43 43 if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'add_field' == $_GET['mode'] ) 44 44 xprofile_admin_manage_field( $_GET['group_id'] ); 45 45 46 else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && isset( $_GET['field_id'] ) && 'edit_field' == $_GET['mode'] )46 elseif ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && isset( $_GET['field_id'] ) && 'edit_field' == $_GET['mode'] ) 47 47 xprofile_admin_manage_field( $_GET['group_id'], $_GET['field_id'] ); 48 48 49 else if ( isset( $_GET['mode'] ) && isset( $_GET['field_id'] ) && 'delete_field' == $_GET['mode'] )49 elseif ( isset( $_GET['mode'] ) && isset( $_GET['field_id'] ) && 'delete_field' == $_GET['mode'] ) 50 50 xprofile_admin_delete_field( $_GET['field_id'], 'field'); 51 51 52 else if ( isset( $_GET['mode'] ) && isset( $_GET['option_id'] ) && 'delete_option' == $_GET['mode'] )52 elseif ( isset( $_GET['mode'] ) && isset( $_GET['option_id'] ) && 'delete_option' == $_GET['mode'] ) 53 53 xprofile_admin_delete_field( $_GET['option_id'], 'option' ); 54 54 55 else if ( isset( $_GET['mode'] ) && 'add_group' == $_GET['mode'] )55 elseif ( isset( $_GET['mode'] ) && 'add_group' == $_GET['mode'] ) 56 56 xprofile_admin_manage_group(); 57 57 58 else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'delete_group' == $_GET['mode'] )58 elseif ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'delete_group' == $_GET['mode'] ) 59 59 xprofile_admin_delete_group( $_GET['group_id'] ); 60 60 61 else if ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'edit_group' == $_GET['mode'] )61 elseif ( isset( $_GET['mode'] ) && isset( $_GET['group_id'] ) && 'edit_group' == $_GET['mode'] ) 62 62 xprofile_admin_manage_group( $_GET['group_id'] ); 63 63 64 64 else { ?> -
bp-xprofile/bp-xprofile-classes.php
161 161 162 162 if ( ! empty( $profile_group_id ) ) { 163 163 $where_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id ); 164 } else if ( $exclude_groups ) {164 } elseif ( $exclude_groups ) { 165 165 $exclude_groups = join( ',', wp_parse_id_list( $exclude_groups ) ); 166 166 $where_sql = "WHERE g.id NOT IN ({$exclude_groups})"; 167 167 } … … 454 454 foreach ( $levels as $level ) { 455 455 if ( 'default_visibility' == $level->meta_key ) { 456 456 $default_visibility_levels[ $level->object_id ]['default'] = $level->meta_value; 457 } else if ( 'allow_custom_visibility' == $level->meta_key ) {457 } elseif ( 'allow_custom_visibility' == $level->meta_key ) { 458 458 $default_visibility_levels[ $level->object_id ]['allow_custom'] = $level->meta_value; 459 459 } 460 460 } … … 1195 1195 if ( $this->exists() && strlen( trim( $this->value ) ) ) { 1196 1196 $result = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_data} SET value = %s, last_updated = %s WHERE user_id = %d AND field_id = %d", $this->value, $this->last_updated, $this->user_id, $this->field_id ) ); 1197 1197 1198 } else if ( $this->exists() && empty( $this->value ) ) {1198 } elseif ( $this->exists() && empty( $this->value ) ) { 1199 1199 // Data removed, delete the entry. 1200 1200 $result = $this->delete(); 1201 1201 … … 1490 1490 for ( $j = 0; $j < count( $fields ); $j++ ) { 1491 1491 if ( $values[$i]->name == $fields[$j] ) { 1492 1492 $new_values[$fields[$j]] = $values[$i]->value; 1493 } else if ( !array_key_exists( $fields[$j], $new_values ) ) {1493 } elseif ( !array_key_exists( $fields[$j], $new_values ) ) { 1494 1494 $new_values[$fields[$j]] = NULL; 1495 1495 } 1496 1496 }