Changeset 2576
- Timestamp:
- 02/03/2010 09:06:27 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-classes.php
r2541 r2576 319 319 320 320 /* Now fetch the activity comments and parse them into the correct position in the activities array. */ 321 foreach( $activities as $activity ) {321 foreach( (array)$activities as $activity ) { 322 322 if ( 'activity_comment' != $activity->type && $activity->mptt_left && $activity->mptt_right ) 323 323 $activity_comments[$activity->id] = BP_Activity_Activity::get_activity_comments( $activity->id, $activity->mptt_left, $activity->mptt_right ); … … 325 325 326 326 /* Merge the comments with the activity items */ 327 foreach( $activities as $key => $activity )327 foreach( (array)$activities as $key => $activity ) 328 328 $activities[$key]->children = $activity_comments[$activity->id]; 329 329 … … 345 345 346 346 /* Loop descendants and build an assoc array */ 347 foreach ( $descendants as $d ) {347 foreach ( (array)$descendants as $d ) { 348 348 $d->children = array(); 349 349 … … 373 373 374 374 /* Loop the descendants and recalculate the left and right values */ 375 foreach ( $descendants as $descendant )375 foreach ( (array)$descendants as $descendant ) 376 376 $right = BP_Activity_Activity::rebuild_activity_comment_tree( $descendant->id, $right ); 377 377 -
trunk/bp-activity/bp-activity-templatetags.php
r2559 r2576 502 502 $parent_activity = false; 503 503 504 foreach( $activities_template->activities as $activity ) {504 foreach( (array)$activities_template->activities as $activity ) { 505 505 if ( $parent_id == $activity->id ) { 506 506 /* Need a copy not a reference, this was the only PHP4 compat way I could find. */ … … 563 563 564 564 $content .= '<ul>'; 565 foreach ( $comment->children as $comment ) {565 foreach ( (array)$comment->children as $comment ) { 566 566 if ( !$comment->user_fullname ) 567 567 $comment->user_fullname = $comment->display_name; … … 609 609 return $count; 610 610 611 foreach ( $comment->children as $comment ) {611 foreach ( (array)$comment->children as $comment ) { 612 612 $count++; 613 613 $count = bp_activity_recurse_comment_count( $comment, $count ); -
trunk/bp-blogs.php
r2460 r2576 322 322 323 323 if ( $blog_ids ) { 324 foreach( $blog_ids as $blog_id ) {324 foreach( (array)$blog_ids as $blog_id ) { 325 325 $users = get_users_of_blog( $blog_id ); 326 326 327 327 if ( $users ) { 328 foreach ( $users as $user ) {328 foreach ( (array)$users as $user ) { 329 329 $role = unserialize( $user->meta_value ); 330 330 -
trunk/bp-blogs/bp-blogs-classes.php
r2553 r2576 102 102 if ( !empty( $search_terms ) ) { 103 103 $filter = like_escape( $wpdb->escape( $search_terms ) ); 104 $paged_blogs = $wpdb->get_results( $wpdb->prepare( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name, bm3.meta_value as description FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$bp->blogs->table_name_blogmeta} bm3, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND b.blog_id = bm3.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm3.meta_key = 'description' AND ( bm2.meta_value LIKE '%%$filter%%' || bm3.meta_value LIKE '%%$filter%%' ) {$user_sql} {$order_sql} {$pag_sql}" ));105 $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND bm.blog_id = b.blog_id AND bm2.blog_id = b.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'name' AND bm2.meta_key = 'description' AND ( bm.meta_value LIKE '%%$filter%%' || bm2.meta_value LIKE '%%$filter%%' ) {$user_sql}" ));104 $paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name, bm3.meta_value as description FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$bp->blogs->table_name_blogmeta} bm3, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND b.blog_id = bm3.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm3.meta_key = 'description' AND ( bm2.meta_value LIKE '%%$filter%%' || bm3.meta_value LIKE '%%$filter%%' ) {$user_sql} {$order_sql} {$pag_sql}" ); 105 $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND bm.blog_id = b.blog_id AND bm2.blog_id = b.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'name' AND bm2.meta_key = 'description' AND ( bm.meta_value LIKE '%%$filter%%' || bm2.meta_value LIKE '%%$filter%%' ) {$user_sql}" ); 106 106 } else { 107 107 $paged_blogs = $wpdb->get_results( $wpdb->prepare( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name, bm3.meta_value as description FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$bp->blogs->table_name_blogmeta} bm3, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND b.blog_id = bm3.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm3.meta_key = 'description' {$order_sql} {$pag_sql}" ) ); … … 109 109 } 110 110 111 foreach ( $paged_blogs as $blog ) $blog_ids[] = $blog->blog_id;111 foreach ( (array)$paged_blogs as $blog ) $blog_ids[] = $blog->blog_id; 112 112 $blog_ids = $wpdb->escape( join( ',', (array)$blog_ids ) ); 113 113 $paged_blogs = BP_Blogs_Blog::get_blog_extras( &$paged_blogs, $blog_ids, $type ); … … 284 284 285 285 for ( $i = 0; $i < count( $paged_blogs ); $i++ ) { 286 foreach ( $post_ids as $post ) {286 foreach ( (array)$post_ids as $post ) { 287 287 if ( $post->blog_id == $paged_blogs[$i]->blog_id ) { 288 288 $paged_blogs[$i]->latest_post = $wpdb->get_row( "SELECT post_title, guid FROM {$wpdb->base_prefix}" . $post->blog_id . "_posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY id DESC LIMIT 1" ); -
trunk/bp-blogs/bp-blogs-templatetags.php
r2536 r2576 746 746 return false; 747 747 748 foreach ( $terms as $term ) {748 foreach ( (array)$terms as $term ) { 749 749 $link = get_blog_option( BP_ROOT_BLOG, 'siteurl') . '/tag/' . $term->slug; 750 750 $link = apply_filters('term_link', $link); -
trunk/bp-blogs/bp-blogs-widgets.php
r2168 r2576 34 34 </div> 35 35 <ul id="recent-posts" class="item-list"> 36 <?php foreach ( $posts as $post ) : ?>36 <?php foreach ( (array)$posts as $post ) : ?> 37 37 <li> 38 38 <div class="item-avatar"> -
trunk/bp-core.php
r2525 r2576 730 730 return false; 731 731 732 foreach ( $bp->bp_nav as $slug => $nav_item ) {732 foreach ( (array)$bp->bp_nav as $slug => $nav_item ) { 733 733 if ( empty( $temp[$nav_item['position']]) ) 734 734 $temp[$nav_item['position']] = $nav_item; … … 809 809 return false; 810 810 811 foreach ( $bp->bp_options_nav as $parent_slug => $subnav_items ) {811 foreach ( (array)$bp->bp_options_nav as $parent_slug => $subnav_items ) { 812 812 if ( !is_array( $subnav_items ) ) 813 813 continue; 814 814 815 foreach ( $subnav_items as $subnav_item ) {815 foreach ( (array)$subnav_items as $subnav_item ) { 816 816 if ( empty( $temp[$subnav_item['position']]) ) 817 817 $temp[$subnav_item['position']] = $subnav_item; … … 847 847 /* Unset subnav items for this nav item */ 848 848 if ( is_array( $bp->bp_options_nav[$parent_id] ) ) { 849 foreach( $bp->bp_options_nav[$parent_id] as $subnav_item ) {849 foreach( (array)$bp->bp_options_nav[$parent_id] as $subnav_item ) { 850 850 bp_core_remove_subnav_item( $parent_id, $subnav_item['slug'] ); 851 851 } … … 1582 1582 1583 1583 if ( is_array( $current ) ) { 1584 foreach( $bp_illegal_names as $bp_illegal_name ) {1584 foreach( (array)$bp_illegal_names as $bp_illegal_name ) { 1585 1585 if ( !in_array( $bp_illegal_name, $current ) ) 1586 1586 $current[] = $bp_illegal_name; … … 2007 2007 global $wpdb; 2008 2008 2009 foreach( $comments as $comment ) {2009 foreach( (array)$comments as $comment ) { 2010 2010 if ( $comment->user_id ) 2011 2011 $user_ids[] = $comment->user_id; … … 2020 2020 return $comments; 2021 2021 2022 foreach( $userdata as $user )2022 foreach( (array)$userdata as $user ) 2023 2023 $users[$user->user_id] = bp_core_get_user_domain( $user->user_id, $user->user_nicename, $user->user_login ); 2024 2024 2025 foreach( $comments as $i => $comment ) {2025 foreach( (array)$comments as $i => $comment ) { 2026 2026 if ( !empty( $comment->user_id ) ) { 2027 2027 if ( !empty( $users[$comment->user_id] ) ) -
trunk/bp-core/bp-core-activation.php
r2381 r2576 31 31 $profile_field_ids = explode( ',', $signup['meta']['profile_field_ids'] ); 32 32 33 foreach( $profile_field_ids as $field_id ) {33 foreach( (array)$profile_field_ids as $field_id ) { 34 34 $current_field = $signup['meta']["field_{$field_id}"]; 35 35 -
trunk/bp-core/bp-core-admin.php
r2480 r2576 11 11 12 12 // Settings form submitted, now save the settings. 13 foreach ( $_POST['bp-admin'] as $key => $value ) {13 foreach ( (array)$_POST['bp-admin'] as $key => $value ) { 14 14 15 15 if ( function_exists( 'xprofile_install' ) ) { … … 144 144 145 145 // Settings form submitted, now save the settings. 146 foreach ( $_POST['bp_components'] as $key => $value ) {146 foreach ( (array)$_POST['bp_components'] as $key => $value ) { 147 147 if ( !(int) $value ) 148 148 $disabled[$key] = 1; -
trunk/bp-core/bp-core-adminbar.php
r2479 r2576 61 61 /* Loop through each navigation item */ 62 62 $counter = 0; 63 foreach( $bp->bp_nav as $nav_item ) {63 foreach( (array)$bp->bp_nav as $nav_item ) { 64 64 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; 65 65 … … 71 71 $sub_counter = 0; 72 72 73 foreach( $bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) {73 foreach( (array)$bp->bp_options_nav[$nav_item['slug']] as $subnav_item ) { 74 74 $alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : ''; 75 75 echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>'; … … 112 112 if ( is_array( $blogs['blogs'] ) && (int)$blogs['count'] ) { 113 113 $counter = 0; 114 foreach ( $blogs['blogs'] as $blog ) {114 foreach ( (array)$blogs['blogs'] as $blog ) { 115 115 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; 116 116 … … 192 192 193 193 echo '<ul class="author-list">'; 194 foreach( $authors as $author ) {194 foreach( (array)$authors as $author ) { 195 195 $author = new BP_Core_User( $author->user_id ); 196 196 echo '<li>'; -
trunk/bp-core/bp-core-classes.php
r2533 r2576 181 181 182 182 /* Get paginated results */ 183 $paged_users = $wpdb->get_results( $wpdb->prepare( join( ' ', (array)$sql )) );183 $paged_users = $wpdb->get_results( join( ' ', (array)$sql ) ); 184 184 185 185 /* Re-jig the SQL so we can get the total user count */ … … 201 201 202 202 /* Get total user results */ 203 $total_users = $wpdb->get_var( $wpdb->prepare( join( ' ', (array)$sql )) );203 $total_users = $wpdb->get_var( join( ' ', (array)$sql ) ); 204 204 205 205 /*** … … 207 207 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join) 208 208 */ 209 foreach ( $paged_users as $user )209 foreach ( (array)$paged_users as $user ) 210 210 $user_ids[] = $user->id; 211 211 … … 241 241 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join) 242 242 */ 243 foreach ( $paged_users as $user )243 foreach ( (array)$paged_users as $user ) 244 244 $user_ids[] = $user->id; 245 245 … … 300 300 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join) 301 301 */ 302 foreach ( $paged_users as $user )302 foreach ( (array)$paged_users as $user ) 303 303 $user_ids[] = $user->id; 304 304 … … 322 322 $names = $wpdb->get_results( $wpdb->prepare( "SELECT pd.user_id as id, pd.value as fullname FROM {$bp->profile->table_name_fields} pf, {$bp->profile->table_name_data} pd WHERE pf.id = pd.field_id AND pf.name = %s AND pd.user_id IN ( {$user_ids} )", BP_XPROFILE_FULLNAME_FIELD_NAME ) ); 323 323 for ( $i = 0; $i < count( $paged_users ); $i++ ) { 324 foreach ( $names as $name ) {324 foreach ( (array)$names as $name ) { 325 325 if ( $name->id == $paged_users[$i]->id ) 326 326 $paged_users[$i]->fullname = $name->fullname; … … 333 333 $friend_count = $wpdb->get_results( "SELECT user_id as id, meta_value as total_friend_count FROM " . CUSTOM_USER_META_TABLE . " WHERE meta_key = 'total_friend_count' AND user_id IN ( {$user_ids} )" ); 334 334 for ( $i = 0; $i < count( $paged_users ); $i++ ) { 335 foreach ( $friend_count as $count ) {335 foreach ( (array)$friend_count as $count ) { 336 336 if ( $count->id == $paged_users[$i]->id ) 337 337 $paged_users[$i]->total_friend_count = (int)$count->total_friend_count; … … 344 344 $friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids} ) ) OR (initiator_user_id IN ( {$user_ids} ) AND friend_user_id = %d )", $bp->loggedin_user->id, $bp->loggedin_user->id ) ); 345 345 for ( $i = 0; $i < count( $paged_users ); $i++ ) { 346 foreach ( $friend_status as $status ) {346 foreach ( (array)$friend_status as $status ) { 347 347 if ( $status->initiator_user_id == $paged_users[$i]->id || $status->friend_user_id == $paged_users[$i]->id ) 348 348 $paged_users[$i]->is_friend = $status->is_confirmed; … … 354 354 $user_activity = $wpdb->get_results( "SELECT user_id as id, meta_value as last_activity FROM " . CUSTOM_USER_META_TABLE . " WHERE meta_key = 'last_activity' AND user_id IN ( {$user_ids} )" ); 355 355 for ( $i = 0; $i < count( $paged_users ); $i++ ) { 356 foreach ( $user_activity as $activity ) {356 foreach ( (array)$user_activity as $activity ) { 357 357 if ( $activity->id == $paged_users[$i]->id ) 358 358 $paged_users[$i]->last_activity = $activity->last_activity; … … 365 365 $user_activity = $wpdb->get_results( "SELECT user_id as id, meta_value as last_activity FROM " . CUSTOM_USER_META_TABLE . " WHERE meta_key = 'last_activity' AND user_id IN ( {$user_ids} )" ); 366 366 for ( $i = 0; $i < count( $paged_users ); $i++ ) { 367 foreach ( $user_activity as $activity ) {367 foreach ( (array)$user_activity as $activity ) { 368 368 if ( $activity->id == $paged_users[$i]->id ) 369 369 $paged_users[$i]->last_activity = $activity->last_activity; … … 375 375 $user_update = $wpdb->get_results( "SELECT user_id as id, meta_value as latest_update FROM " . CUSTOM_USER_META_TABLE . " WHERE meta_key = 'bp_latest_update' AND user_id IN ( {$user_ids} )" ); 376 376 for ( $i = 0; $i < count( $paged_users ); $i++ ) { 377 foreach ( $user_update as $update ) {377 foreach ( (array)$user_update as $update ) { 378 378 if ( $update->id == $paged_users[$i]->id ) 379 379 $paged_users[$i]->latest_update = $update->latest_update; -
trunk/bp-core/bp-core-notifications.php
r2077 r2576 51 51 52 52 /* Calculated a renderable outcome for each notification type */ 53 foreach ( $grouped_notifications as $component_name => $action_arrays ) {53 foreach ( (array)$grouped_notifications as $component_name => $action_arrays ) { 54 54 if ( !$action_arrays ) 55 55 continue; 56 56 57 foreach ( $action_arrays as $component_action_name => $component_action_items ) {57 foreach ( (array)$action_arrays as $component_action_name => $component_action_items ) { 58 58 $action_item_count = count($component_action_items); 59 59 -
trunk/bp-core/bp-core-settings.php
r2389 r2576 114 114 115 115 if ( $_POST['notifications'] ) { 116 foreach ( $_POST['notifications'] as $key => $value ) {116 foreach ( (array)$_POST['notifications'] as $key => $value ) { 117 117 update_usermeta( (int)$current_user->id, $key, $value ); 118 118 } -
trunk/bp-core/bp-core-signup.php
r2493 r2576 87 87 /* Add any errors to the action for the field in the template for display. */ 88 88 if ( !empty( $bp->signup->errors ) ) { 89 foreach ( $bp->signup->errors as $fieldname => $error_message )89 foreach ( (array)$bp->signup->errors as $fieldname => $error_message ) 90 90 add_action( 'bp_' . $fieldname . '_errors', create_function( '', 'echo "<div class=\"error\">' . $error_message . '</div>";' ) ); 91 91 } else { … … 208 208 $profile_field_ids = explode( ',', $usermeta['profile_field_ids'] ); 209 209 210 foreach( $profile_field_ids as $field_id ) {210 foreach( (array)$profile_field_ids as $field_id ) { 211 211 $current_field = $usermeta["field_{$field_id}"]; 212 212 -
trunk/bp-core/bp-core-templatetags.php
r2539 r2576 501 501 global $bp; 502 502 503 foreach ( $bp->bp_nav as $user_nav_item ) {503 foreach ( (array)$bp->bp_nav as $user_nav_item ) { 504 504 if ( !$user_nav_item['show_for_displayed_user'] && !bp_is_my_profile() ) 505 505 continue; … … 545 545 546 546 /* Loop through each navigation item */ 547 foreach ( $bp->bp_options_nav[$bp->current_component] as $subnav_item ) {547 foreach ( (array)$bp->bp_options_nav[$bp->current_component] as $subnav_item ) { 548 548 if ( !$subnav_item['user_has_access'] ) 549 549 continue; -
trunk/bp-forums.php
r2547 r2576 341 341 342 342 /* Get the topic ids */ 343 foreach ( $topics as $topic ) $topic_ids[] = $topic->topic_id;343 foreach ( (array)$topics as $topic ) $topic_ids[] = $topic->topic_id; 344 344 $topic_ids = $wpdb->escape( join( ',', (array)$topic_ids ) ); 345 345 … … 347 347 $poster_details = $wpdb->get_results( $wpdb->prepare( "SELECT t.topic_id, t.topic_last_poster, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u, {$bbdb->topics} t WHERE u.ID = t.topic_last_poster AND t.topic_id IN ( {$topic_ids} )" ) ); 348 348 for ( $i = 0; $i < count( $topics ); $i++ ) { 349 foreach ( $poster_details as $poster ) {349 foreach ( (array)$poster_details as $poster ) { 350 350 if ( $poster->topic_id == $topics[$i]->topic_id ) { 351 351 $topics[$i]->topic_last_poster_email = $poster->user_email; … … 361 361 $poster_names = $wpdb->get_results( $wpdb->prepare( "SELECT t.topic_id, pd.value FROM {$bp->profile->table_name_data} pd, {$bbdb->topics} t WHERE pd.user_id = t.topic_last_poster AND pd.field_id = 1 AND t.topic_id IN ( {$topic_ids} )" ) ); 362 362 for ( $i = 0; $i < count( $topics ); $i++ ) { 363 foreach ( $poster_names as $name ) {363 foreach ( (array)$poster_names as $name ) { 364 364 if ( $name->topic_id == $topics[$i]->topic_id ) 365 365 $topics[$i]->topic_last_poster_displayname = $name->value; -
trunk/bp-forums/bp-forums-admin.php
r2274 r2576 206 206 207 207 // Loop through the lines and modify them 208 foreach ( $lines as $line ) {208 foreach ( (array)$lines as $line ) { 209 209 if ( isset( $alterations[substr( $line, 0, 20 )] ) ) { 210 210 $alteration = $alterations[substr( $line, 0, 20 )]; … … 239 239 240 240 // Write lines one by one to avoid OS specific newline hassles 241 foreach ( $modified_lines as $modified_line ) {241 foreach ( (array)$modified_lines as $modified_line ) { 242 242 if ( false !== strpos( $modified_line, '?>' ) ) { 243 243 $modified_line = '?>'; -
trunk/bp-groups.php
r2557 r2576 1129 1129 * we need to loop the step array and fetch the next step that way. 1130 1130 */ 1131 foreach ( $bp->groups->group_creation_steps as $key => $value ) {1131 foreach ( (array)$bp->groups->group_creation_steps as $key => $value ) { 1132 1132 if ( $key == $bp->groups->current_create_step ) { 1133 1133 $next = 1; … … 1203 1203 return false; 1204 1204 1205 foreach ( $bp->groups->group_creation_steps as $slug => $step ) {1205 foreach ( (array)$bp->groups->group_creation_steps as $slug => $step ) { 1206 1206 while ( !empty( $temp[$step['position']] ) ) 1207 1207 $step['position']++; … … 1214 1214 unset($bp->groups->group_creation_steps); 1215 1215 1216 foreach( $temp as $position => $step )1216 foreach( (array)$temp as $position => $step ) 1217 1217 $bp->groups->group_creation_steps[$step['slug']] = array( 'name' => $step['name'], 'position' => $position ); 1218 1218 } -
trunk/bp-groups/bp-groups-classes.php
r2556 r2576 273 273 274 274 if ( $user_id ) { 275 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY g.date_created DESC {$pag_sql}", $user_id ) ); 276 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0", $user_id ) ); 277 } else { 278 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} ORDER BY g.date_created DESC {$pag_sql}" ) ); 279 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql}" ) ); 280 } 281 282 foreach ( $paged_groups as $group ) $group_ids[] = $group->id; 275 $user_id = $wpdb->escape( $user_id ); 276 $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY g.date_created DESC {$pag_sql}" ); 277 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0" ); 278 } else { 279 $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} ORDER BY g.date_created DESC {$pag_sql}" ); 280 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql}" ); 281 } 282 283 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 283 284 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); 284 285 $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'newest' ); … … 302 303 303 304 if ( $user_id ) { 304 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY last_activity DESC {$pag_sql}", $user_id ) ); 305 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0", $user_id ) ); 306 } else { 307 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} ORDER BY last_activity DESC {$pag_sql}" ) ); 308 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql}" ) ); 309 } 310 311 foreach ( $paged_groups as $group ) $group_ids[] = $group->id; 305 $user_id = $wpdb->escape( $user_id ); 306 $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY last_activity DESC {$pag_sql}" ); 307 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0" ); 308 } else { 309 $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} ORDER BY last_activity DESC {$pag_sql}" ); 310 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql}" ); 311 } 312 313 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 312 314 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); 313 315 $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'active' ); … … 332 334 333 335 if ( $user_id ) { 334 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY CONVERT(gm1.meta_value, SIGNED) DESC {$pag_sql}", $user_id ) ); 335 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0", $user_id ) ); 336 } else { 337 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} ORDER BY CONVERT(gm1.meta_value, SIGNED) DESC {$pag_sql}" ) ); 338 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql}" ) ); 339 } 340 341 foreach ( $paged_groups as $group ) $group_ids[] = $group->id; 336 $user_id = $wpdb->escape( $user_id ); 337 $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY CONVERT(gm1.meta_value, SIGNED) DESC {$pag_sql}" ); 338 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0" ); 339 } else { 340 $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} ORDER BY CONVERT(gm1.meta_value, SIGNED) DESC {$pag_sql}" ); 341 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql}" ); 342 } 343 344 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 342 345 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); 343 346 $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'popular' ); … … 361 364 362 365 if ( $user_id ) { 363 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY g.name ASC {$pag_sql}", $user_id ) ); 364 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity' {$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0", $user_id ) ); 365 } else { 366 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} ORDER BY g.name ASC {$pag_sql}" ) ); 367 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql}" ) ); 368 } 369 370 foreach ( $paged_groups as $group ) $group_ids[] = $group->id; 366 $user_id = $wpdb->escape( $user_id ); 367 $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY g.name ASC {$pag_sql}" ); 368 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity' {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0" ); 369 } else { 370 $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} ORDER BY g.name ASC {$pag_sql}" ); 371 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql}" ); 372 } 373 374 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 371 375 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); 372 376 $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'alphabetical' ); … … 394 398 395 399 if ( $user_id ) { 396 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY f.topics DESC {$pag_sql}", $user_id ) ); 397 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0", $user_id ) ); 398 } else { 399 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} ORDER BY f.topics DESC {$pag_sql}" ) ); 400 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql}" ) ); 401 } 402 403 foreach ( $paged_groups as $group ) $group_ids[] = $group->id; 400 $user_id = $wpdb->escape( $user_id ); 401 $paged_groups = $wpdb->get_results( "SELECT DISTINCT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY f.topics DESC {$pag_sql}" ); 402 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0" ); 403 } else { 404 $paged_groups = $wpdb->get_results( "SELECT DISTINCT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql} ORDER BY f.topics DESC {$pag_sql}" ); 405 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql}" ); 406 } 407 408 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 404 409 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); 405 410 $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'most_forum_topics' ); … … 427 432 428 433 if ( $user_id ) { 429 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) {$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY f.posts ASC {$pag_sql}", $user_id ) ); 430 $total_groups = $wpdb->get_results( $wpdb->prepare( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.posts > 0 {$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0", $user_id ) ); 431 } else { 432 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.posts > 0 {$hidden_sql} {$search_sql} ORDER BY f.posts ASC {$pag_sql}" ) ); 433 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) {$hidden_sql} {$search_sql}" ) ); 434 } 435 436 foreach ( $paged_groups as $group ) $group_ids[] = $group->id; 434 $user_id = $wpdb->escape( $user_id ); 435 $paged_groups = $wpdb->get_results( "SELECT DISTINCT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY f.posts ASC {$pag_sql}" ); 436 $total_groups = $wpdb->get_results( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bp->groups->table_name_members} m, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.posts > 0 {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0" ); 437 } else { 438 $paged_groups = $wpdb->get_results( "SELECT DISTINCT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.posts > 0 {$hidden_sql} {$search_sql} ORDER BY f.posts ASC {$pag_sql}" ); 439 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) {$hidden_sql} {$search_sql}" ); 440 } 441 442 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 437 443 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); 438 444 $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'most_forum_posts' ); … … 503 509 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} ORDER BY g.name ASC {$pag_sql}" ) ); 504 510 505 foreach ( $paged_groups as $group ) $group_ids[] = $group->id;511 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 506 512 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); 507 513 $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'letter' ); … … 525 531 526 532 if ( $user_id ) { 527 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY rand() {$pag_sql}", $user_id ) ); 528 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0", $user_id ) ); 529 } else { 530 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} ORDER BY rand() {$pag_sql}" ) ); 531 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql}" ) ); 532 } 533 534 foreach ( $paged_groups as $group ) $group_ids[] = $group->id; 533 $user_id = $wpdb->escape( $user_id ); 534 $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY rand() {$pag_sql}" ); 535 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql} AND m.user_id = {$user_id} AND m.inviter_id = 0 AND m.is_banned = 0" ); 536 } else { 537 $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql} ORDER BY rand() {$pag_sql}" ); 538 $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql}" ); 539 } 540 541 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 535 542 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); 536 543 $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'random' ); … … 548 555 $user_status = $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id IN ( {$group_ids} ) AND is_confirmed = 1 AND is_banned = 0", $bp->loggedin_user->id ) ); 549 556 for ( $i = 0; $i < count( $paged_groups ); $i++ ) { 550 foreach ( $user_status as $group_id ) {557 foreach ( (array)$user_status as $group_id ) { 551 558 if ( $group_id == $paged_groups[$i]->id ) 552 559 $paged_groups[$i]->is_member = true; … … 556 563 $user_banned = $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE is_banned = 1 AND user_id = %d AND group_id IN ( {$group_ids} )", $bp->loggedin_user->id ) ); 557 564 for ( $i = 0; $i < count( $paged_groups ); $i++ ) { 558 foreach ( $user_banned as $group_id ) {565 foreach ( (array)$user_banned as $group_id ) { 559 566 if ( $group_id == $paged_groups[$i]->id ) 560 567 $paged_groups[$i]->is_banned = true; … … 989 996 990 997 /* Fetch whether or not the user is a friend */ 991 foreach ( $members as $user ) $user_ids[] = $user->user_id;998 foreach ( (array)$members as $user ) $user_ids[] = $user->user_id; 992 999 $user_ids = $wpdb->escape( join( ',', (array)$user_ids ) ); 993 1000 … … 995 1002 $friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids} ) ) OR (initiator_user_id IN ( {$user_ids} ) AND friend_user_id = %d )", $bp->loggedin_user->id, $bp->loggedin_user->id ) ); 996 1003 for ( $i = 0; $i < count( $members ); $i++ ) { 997 foreach ( $friend_status as $status ) {1004 foreach ( (array)$friend_status as $status ) { 998 1005 if ( $status->initiator_user_id == $members[$i]->user_id || $status->friend_user_id == $members[$i]->user_id ) 999 1006 $members[$i]->is_friend = $status->is_confirmed; -
trunk/bp-groups/bp-groups-notifications.php
r2575 r2576 8 8 9 9 $user_ids = BP_Groups_Member::get_group_member_ids( $group->id ); 10 foreach ( $user_ids as $user_id ) {10 foreach ( (array)$user_ids as $user_id ) { 11 11 if ( 'no' == get_usermeta( $user_id, 'notification_groups_group_updated' ) ) continue; 12 12 -
trunk/bp-groups/bp-groups-templatetags.php
r2550 r2576 804 804 <?php if ( $admins ) { ?> 805 805 <ul id="admins-list" class="item-list<?php if ( $admin_list ) { ?> single-line<?php } ?>"> 806 <?php foreach ( $admins as $admin ) { ?>806 <?php foreach ( (array)$admins as $admin ) { ?> 807 807 <?php if ( $admin_list ) { ?> 808 808 <li> … … 842 842 <?php if ( $group_mods ) { ?> 843 843 <ul id="mods-list" class="item-list<?php if ( $admin_list ) { ?> single-line<?php } ?>"> 844 <?php foreach ( $group_mods as $mod ) { ?>844 <?php foreach ( (array)$group_mods as $mod ) { ?> 845 845 <?php if ( $admin_list ) { ?> 846 846 <li> … … 1510 1510 $counter = 1; 1511 1511 1512 foreach ( $bp->groups->group_creation_steps as $slug => $step ) {1512 foreach ( (array)$bp->groups->group_creation_steps as $slug => $step ) { 1513 1513 $is_enabled = bp_are_previous_group_creation_steps_complete( $slug ); ?> 1514 1514 … … 1573 1573 $found = true; 1574 1574 1575 foreach ( $step_slugs as $step_slug ) {1575 foreach ( (array)$step_slugs as $step_slug ) { 1576 1576 if ( !in_array( $step_slug, $bp->groups->completed_create_steps ) ) 1577 1577 $found = false; … … 1597 1597 1598 1598 /* Get previous steps */ 1599 foreach ( $bp->groups->group_creation_steps as $slug => $name ) {1599 foreach ( (array)$bp->groups->group_creation_steps as $slug => $name ) { 1600 1600 if ( $slug == $step_slug ) 1601 1601 break; … … 1675 1675 global $bp; 1676 1676 1677 foreach ( $bp->groups->group_creation_steps as $slug => $name ) {1677 foreach ( (array)$bp->groups->group_creation_steps as $slug => $name ) { 1678 1678 if ( $slug == $bp->action_variables[1] ) 1679 1679 break; -
trunk/bp-messages.php
r2558 r2576 453 453 454 454 /* Format this to match existing recipients */ 455 foreach( $recipient_ids as $i => $recipient_id ) {455 foreach( (array)$recipient_ids as $i => $recipient_id ) { 456 456 $message->recipients[$i] = new stdClass; 457 457 $message->recipients[$i]->user_id = $recipient_id; -
trunk/bp-messages/bp-messages-classes.php
r2558 r2576 46 46 $results = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $this->thread_id ) ); 47 47 48 foreach ( $results as $recipient )48 foreach ( (array)$results as $recipient ) 49 49 $recipients[$recipient->user_id] = $recipient; 50 50 … … 97 97 98 98 /* Sort threads by date_sent */ 99 foreach( $thread_ids as $thread ) {99 foreach( (array)$thread_ids as $thread ) { 100 100 $sorted_threads[$thread->thread_id] = strtotime($thread->date_sent); 101 101 } … … 103 103 104 104 $threads = false; 105 foreach ( $sorted_threads as $thread_id => $date_sent )105 foreach ( (array)$sorted_threads as $thread_id => $date_sent ) 106 106 $threads[] = new BP_Messages_Thread( $thread_id ); 107 107 … … 193 193 return count( $recipients ) . __(' Recipients', 'buddypress'); 194 194 195 foreach ( $recipients as $recipient ) {195 foreach ( (array)$recipients as $recipient ) { 196 196 $recipient_links[] = bp_core_get_userlink( $recipient->user_id ); 197 197 } -
trunk/bp-themes/bp-default/_inc/ajax.php
r2573 r2576 246 246 /* Add the new page param */ 247 247 $args = explode( '&', trim( $query_string ) ); 248 foreach( $args as $arg ) {248 foreach( (array)$args as $arg ) { 249 249 if ( false === strpos( $arg, 'page' ) ) 250 250 $new_args[] = $arg; … … 544 544 545 545 if ( $friends['friends'] ) { 546 foreach ( $friends['friends'] as $user_id ) {546 foreach ( (array)$friends['friends'] as $user_id ) { 547 547 $ud = get_userdata($user_id); 548 548 $username = $ud->user_login; -
trunk/bp-themes/bp-default/_inc/global.js
r2574 r2576 104 104 /* List tabs event delegation */ 105 105 j('div.activity-type-tabs').click( function(event) { 106 var target = j(event.target).parent() ;106 var target = j(event.target).parent().parent(); 107 107 108 108 if ( event.target.nodeName != 'A' ) -
trunk/bp-themes/bp-default/comments.php
r2277 r2576 16 16 <?php 17 17 $numTrackBacks = 0; $numComments = 0; 18 foreach ( $comments as $comment ) if ( get_comment_type() != "comment") $numTrackBacks++; else $numComments++;18 foreach ( (array)$comments as $comment ) if ( get_comment_type() != "comment") $numTrackBacks++; else $numComments++; 19 19 ?> 20 20 … … 164 164 165 165 <ul id="trackbacklist"> 166 <?php foreach ( $comments as $comment ) : ?>166 <?php foreach ( (array)$comments as $comment ) : ?> 167 167 168 168 <?php if ( get_comment_type() != 'comment' ) : ?> -
trunk/bp-themes/bp-sn-parent/_inc/ajax.php
r2424 r2576 293 293 294 294 if ( $friends['friends'] ) { 295 foreach ( $friends['friends'] as $user_id ) {295 foreach ( (array)$friends['friends'] as $user_id ) { 296 296 $ud = get_userdata($user_id); 297 297 $username = $ud->user_login; -
trunk/bp-xprofile.php
r2547 r2576 300 300 301 301 /* Loop through the posted fields formatting any datebox values then validate the field */ 302 foreach ( $posted_field_ids as $field_id ) {302 foreach ( (array)$posted_field_ids as $field_id ) { 303 303 if ( !isset( $_POST['field_' . $field_id] ) ) { 304 304 … … 326 326 327 327 /* Now we've checked for required fields, lets save the values. */ 328 foreach ( $posted_field_ids as $field_id ) {328 foreach ( (array)$posted_field_ids as $field_id ) { 329 329 if ( !xprofile_set_field_data( $field_id, $bp->displayed_user->id, $_POST['field_' . $field_id] ) ) 330 330 $errors = true; -
trunk/bp-xprofile/bp-xprofile-classes.php
r2547 r2576 355 355 $counter = 1; 356 356 if ( $options ) { 357 foreach ( $options as $option_key => $option_value ) {357 foreach ( (array)$options as $option_key => $option_value ) { 358 358 $is_default = 0; 359 359 -
trunk/bp-xprofile/bp-xprofile-filters.php
r2439 r2576 65 65 66 66 if ( $values ) { 67 foreach ( $values as $value ) {67 foreach ( (array)$values as $value ) { 68 68 $value = trim( $value ); 69 69 … … 86 86 87 87 function xprofile_filter_comments( $comments, $post_id ) { 88 foreach( $comments as $comment ) {88 foreach( (array)$comments as $comment ) { 89 89 if ( $comment->user_id ) 90 90 $user_ids[] = $comment->user_id; … … 95 95 96 96 if ( $fullnames = BP_XProfile_ProfileData::get_value_byid( 1, $user_ids ) ) { 97 foreach( $fullnames as $user ) {97 foreach( (array)$fullnames as $user ) { 98 98 $users[$user->user_id] = trim($user->value); 99 99 } 100 100 } 101 101 102 foreach( $comments as $i => $comment ) {102 foreach( (array)$comments as $i => $comment ) { 103 103 if ( !empty( $comment->user_id ) ) { 104 104 if ( !empty( $users[$comment->user_id] ) )
Note: See TracChangeset
for help on using the changeset viewer.