Skip to:
Content

Changes from tags/1.6 at r6231 to tags/1.6.2 at r6567


Ignore:
Location:
tags/1.6.2
Files:
37 edited

Legend:

Unmodified
Added
Removed
  • tags/1.6.2/bp-activity/bp-activity-classes.php

    r6231 r6567  
    8585        // If we have an existing ID, update the activity item, otherwise insert it. 
    8686        if ( $this->id ) 
    87             $q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = %s, item_id = %s, secondary_item_id = %s, hide_sitewide = %d, is_spam = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam, $this->id ); 
    88         else 
    89             $q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( %d, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam ); 
     87            $q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = %s, item_id = %d, secondary_item_id = %d, hide_sitewide = %d, is_spam = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam, $this->id ); 
     88        else 
     89            $q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( %d, %s, %s, %s, %s, %s, %s, %d, %d, %d, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam ); 
    9090 
    9191        if ( false === $wpdb->query( $q ) ) 
     
    217217 
    218218        if ( !empty( $the_index ) ) { 
    219             $index_hint_sql = $wpdb->prepare( "USE INDEX ({$the_index})" );  
     219            $index_hint_sql = "USE INDEX ({$the_index})"; 
    220220        } else { 
    221221            $index_hint_sql = ''; 
     
    229229 
    230230            $pag_sql    = $wpdb->prepare( "LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page ); 
    231             $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}" ), $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) ); 
     231            $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) ); 
    232232        } else { 
    233             $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort}" ), $select_sql, $from_sql, $where_sql, $sort ) ); 
    234         } 
    235  
    236         $total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', $wpdb->prepare( "SELECT count(a.id) FROM {$bp->activity->table_name} a {$index_hint_sql} {$where_sql} ORDER BY a.date_recorded {$sort}" ), $where_sql, $sort ); 
     233            $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $select_sql, $from_sql, $where_sql, $sort ) ); 
     234        } 
     235 
     236        $total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(a.id) FROM {$bp->activity->table_name} a {$index_hint_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $where_sql, $sort ); 
    237237 
    238238        $total_activities = $wpdb->get_var( $total_activities_sql ); 
     
    248248            $activity_user_ids = implode( ',', array_unique( (array) $activity_user_ids ) ); 
    249249            if ( !empty( $activity_user_ids ) ) { 
    250                 if ( $names = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, value AS user_fullname FROM {$bp->profile->table_name_data} WHERE field_id = 1 AND user_id IN ({$activity_user_ids})" ) ) ) { 
     250                if ( $names = $wpdb->get_results( "SELECT user_id, value AS user_fullname FROM {$bp->profile->table_name_data} WHERE field_id = 1 AND user_id IN ({$activity_user_ids})" ) ) { 
    251251                    foreach ( (array) $names as $name ) 
    252252                        $tmp_names[$name->user_id] = $name->user_fullname; 
     
    402402 
    403403        // Fetch the activity IDs so we can delete any comments for this activity item 
    404         $activity_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} {$where_sql}" ) ); 
    405  
    406         if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} {$where_sql}" ) ) ) 
     404        $activity_ids = $wpdb->get_col( "SELECT id FROM {$bp->activity->table_name} {$where_sql}" ); 
     405 
     406        if ( !$wpdb->query( "DELETE FROM {$bp->activity->table_name} {$where_sql}" ) ) 
    407407            return false; 
    408408 
     
    425425            $activity_ids = implode ( ',', array_map( 'absint', explode ( ',', $activity_ids ) ) ); 
    426426 
    427         return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND item_id IN ({$activity_ids})" ) ); 
     427        return $wpdb->query( "DELETE FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND item_id IN ({$activity_ids})" ); 
    428428    } 
    429429 
     
    436436            $activity_ids = implode ( ',', array_map( 'absint', explode ( ',', $activity_ids ) ) ); 
    437437 
    438         return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_meta} WHERE activity_id IN ({$activity_ids})" ) ); 
     438        return $wpdb->query( "DELETE FROM {$bp->activity->table_name_meta} WHERE activity_id IN ({$activity_ids})" ); 
    439439    } 
    440440 
     
    561561        global $wpdb, $bp; 
    562562 
    563         return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" ) ); 
     563        return $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" ); 
    564564    } 
    565565 
     
    648648        global $bp, $wpdb; 
    649649 
    650         return $wpdb->get_var( $wpdb->prepare( "SELECT date_recorded FROM {$bp->activity->table_name} ORDER BY date_recorded DESC LIMIT 1" ) ); 
     650        return $wpdb->get_var( "SELECT date_recorded FROM {$bp->activity->table_name} ORDER BY date_recorded DESC LIMIT 1" ); 
    651651    } 
    652652 
  • tags/1.6.2/bp-activity/bp-activity-functions.php

    r6231 r6567  
    11831183    $args = wp_parse_args( $args, $defaults ); 
    11841184 
     1185    do_action( 'bp_before_activity_delete', $args ); 
     1186 
    11851187    // Adjust the new mention count of any mentioned member 
    11861188    bp_activity_adjust_mention_count( $args['id'], 'delete' ); 
     
    11941196    else 
    11951197        $user_id = $args['user_id']; 
    1196  
    1197     do_action( 'bp_before_activity_delete', $args ); 
    11981198 
    11991199    $latest_update = bp_get_user_meta( $user_id, 'bp_latest_update', true ); 
  • tags/1.6.2/bp-blogs/bp-blogs-classes.php

    r6231 r6567  
    114114            $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}" ); 
    115115        } else { 
    116             $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 FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$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 {$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' GROUP BY b.blog_id {$order_sql} {$pag_sql}" ) ); 
    117             $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb WHERE b.blog_id = wb.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql}" ) ); 
     116            $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 FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$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 {$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' GROUP BY b.blog_id {$order_sql} {$pag_sql}" ); 
     117            $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb WHERE b.blog_id = wb.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql}" ); 
    118118        } 
    119119 
     
    231231        $pag_sql = ( $limit && $page ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : ''; 
    232232 
    233         $paged_blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.blog_id FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql} {$pag_sql}" ) ); 
    234         $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql}" ) ); 
     233        $paged_blogs = $wpdb->get_results( "SELECT DISTINCT b.blog_id FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql} {$pag_sql}" ); 
     234        $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql}" ); 
    235235 
    236236        return array( 'blogs' => $paged_blogs, 'total' => $total_blogs ); 
     
    248248            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 
    249249 
    250         $paged_blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT bm.blog_id FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND bm.meta_value LIKE '$letter%%' {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC{$pag_sql}" ) ); 
    251         $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT bm.blog_id) FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND bm.meta_value LIKE '$letter%%' {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC" ) ); 
     250        $paged_blogs = $wpdb->get_results( "SELECT DISTINCT bm.blog_id FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND bm.meta_value LIKE '$letter%%' {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC{$pag_sql}" ); 
     251        $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT bm.blog_id) FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND bm.meta_value LIKE '$letter%%' {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC" ); 
    252252 
    253253        return array( 'blogs' => $paged_blogs, 'total' => $total_blogs ); 
     
    266266 
    267267        /* Fetch the blog description for each blog (as it may be empty we can't fetch it in the main query). */ 
    268         $blog_descs = $wpdb->get_results( $wpdb->prepare( "SELECT blog_id, meta_value as description FROM {$bp->blogs->table_name_blogmeta} WHERE meta_key = 'description' AND blog_id IN ( {$blog_ids} )" ) ); 
     268        $blog_descs = $wpdb->get_results( "SELECT blog_id, meta_value as description FROM {$bp->blogs->table_name_blogmeta} WHERE meta_key = 'description' AND blog_id IN ( {$blog_ids} )" ); 
    269269 
    270270        for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) { 
  • tags/1.6.2/bp-blogs/bp-blogs-functions.php

    r6231 r6567  
    5050 
    5151    if ( is_multisite() ) 
    52         $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0" ) ); 
     52        $blog_ids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0" ); 
    5353    else 
    5454        $blog_ids = 1; 
  • tags/1.6.2/bp-core/admin/bp-core-functions.php

    r6231 r6567  
    218218     */ 
    219219    if ( bp_is_active( 'blogs' ) ) { 
    220         $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$bp->blogs->table_name}" ) ); 
     220        $count = $wpdb->get_var( "SELECT COUNT(*) FROM {$bp->blogs->table_name}" ); 
    221221 
    222222        if ( empty( $count ) ) { 
  • tags/1.6.2/bp-core/admin/css/wizard.dev.css

    r6231 r6567  
    141141    div#bp-wizard table.form-table th img { 
    142142        margin-top: 5px; 
     143        width: 300px; 
    143144    } 
    144145 
     
    146147        margin: 3px 0 0 0; 
    147148    } 
     149 
     150#bp-wizard .widefat th { 
     151    vertical-align: top; 
     152    display: table-cell; 
     153} 
    148154 
    149155div#bp-wizard code, div#bp-wizard kbd { 
  • tags/1.6.2/bp-core/bp-core-avatars.php

    r6231 r6567  
    314314 
    315315            // Return it wrapped in an <img> element 
    316             if ( !empty( $html ) ) { 
     316            if ( true === $html ) { 
    317317                return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '" alt="' . esc_attr( $alt ) . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); 
    318318 
     
    376376    } 
    377377 
    378     if ( !empty( $html ) ) 
     378    if ( true === $html ) 
    379379        return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '" alt="' . esc_attr( $alt ) . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); 
    380380    else 
     
    476476        return true; 
    477477 
    478     require_once( ABSPATH . '/wp-admin/includes/image.php' ); 
    479478    require_once( ABSPATH . '/wp-admin/includes/file.php' ); 
    480479 
     
    515514 
    516515    // Get image size 
    517     $size = @getimagesize( $bp->avatar_admin->original['file'] ); 
     516    $size  = @getimagesize( $bp->avatar_admin->original['file'] ); 
     517    $error = false; 
    518518 
    519519    // Check image size and shrink if too large 
    520520    if ( $size[0] > bp_core_avatar_original_max_width() ) { 
    521         $thumb = wp_create_thumbnail( $bp->avatar_admin->original['file'], bp_core_avatar_original_max_width() ); 
    522  
    523         // Check for thumbnail creation errors 
    524         if ( is_wp_error( $thumb ) ) { 
    525             bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $thumb->get_error_message() ), 'error' ); 
     521        $editor = wp_get_image_editor( $bp->avatar_admin->original['file'] ); 
     522 
     523        if ( ! is_wp_error( $editor ) ) { 
     524            $editor->set_quality( 100 ); 
     525 
     526            $resized = $editor->resize( bp_core_avatar_original_max_width(), bp_core_avatar_original_max_width(), false ); 
     527            if ( ! is_wp_error( $resized ) ) 
     528                $thumb = $editor->save( $editor->generate_filename() ); 
     529            else 
     530                $error = $resized; 
     531 
     532            // Check for thumbnail creation errors 
     533            if ( false === $error && is_wp_error( $thumb ) ) 
     534                $error = $thumb; 
     535 
     536            if ( false === $error ) { 
     537                // Thumbnail is good so proceed 
     538                $bp->avatar_admin->resized = $thumb; 
     539            } 
     540 
     541        } else { 
     542            $error = $editor; 
     543        } 
     544 
     545        if ( false !== $error ) { 
     546            bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $error->get_error_message() ), 'error' ); 
    526547            return false; 
    527548        } 
    528  
    529         // Thumbnail is good so proceed 
    530         $bp->avatar_admin->resized = $thumb; 
    531549    } 
    532550 
     
    535553        $bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->original['file'] ); 
    536554    else { 
    537         $bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->resized ); 
     555        $bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->resized['path'] ); 
    538556        @unlink( $bp->avatar_admin->original['file'] ); 
    539557    } 
  • tags/1.6.2/bp-core/bp-core-cache.php

    r6231 r6567  
    103103    // Get meta info 
    104104    $id_list   = join( ',', $object_ids ); 
    105     $meta_list = $wpdb->get_results( $wpdb->prepare( "SELECT $object_column, meta_key, meta_value FROM $meta_table WHERE $object_column IN ($id_list)" ), ARRAY_A ); 
     105    $meta_list = $wpdb->get_results( "SELECT $object_column, meta_key, meta_value FROM $meta_table WHERE $object_column IN ($id_list)", ARRAY_A ); 
    106106 
    107107    if ( !empty( $meta_list ) ) { 
  • tags/1.6.2/bp-core/bp-core-catchuri.php

    r6231 r6567  
    136136    // Keep the unfiltered URI safe 
    137137    $bp->unfiltered_uri = $bp_uri; 
     138 
     139    // Don't use $bp_unfiltered_uri, this is only for backpat with old plugins. Use $bp->unfiltered_uri. 
     140    $GLOBALS['bp_unfiltered_uri'] = &$bp->unfiltered_uri; 
    138141 
    139142    // Get slugs of pages into array 
     
    682685 
    683686/** 
     687 * Rehook maybe_redirect_404() to run later than the default 
     688 * 
     689 * WordPress's maybe_redirect_404() allows admins on a multisite installation 
     690 * to define 'NOBLOGREDIRECT', a URL to which 404 requests will be redirected. 
     691 * maybe_redirect_404() is hooked to template_redirect at priority 10, which 
     692 * creates a race condition with bp_template_redirect(), our piggyback hook. 
     693 * Due to a legacy bug in BuddyPress, internal BP content (such as members and 
     694 * groups) is marked 404 in $wp_query until bp_core_load_template(), when BP 
     695 * manually overrides the automatic 404. However, the race condition with 
     696 * maybe_redirect_404() means that this manual un-404-ing doesn't happen in 
     697 * time, with the results that maybe_redirect_404() thinks that the page is 
     698 * a legitimate 404, and redirects incorrectly to NOBLOGREDIRECT. 
     699 * 
     700 * By switching maybe_redirect_404() to catch at a higher priority, we avoid 
     701 * the race condition. If bp_core_load_template() runs, it dies before reaching 
     702 * maybe_redirect_404(). If bp_core_load_template() does not run, it means that 
     703 * the 404 is legitimate, and maybe_redirect_404() can proceed as expected. 
     704 * 
     705 * This function will be removed in a later version of BuddyPress. Plugins 
     706 * (and plugin authors!) should ignore it. 
     707 * 
     708 * @since 1.6.1 
     709 * 
     710 * @link http://buddypress.trac.wordpress.org/ticket/4329 
     711 * @link http://buddypress.trac.wordpress.org/ticket/4415 
     712 */ 
     713function _bp_rehook_maybe_redirect_404() { 
     714    if ( defined( 'NOBLOGREDIRECT' ) ) { 
     715        remove_action( 'template_redirect', 'maybe_redirect_404' ); 
     716        add_action( 'template_redirect', 'maybe_redirect_404', 100 ); 
     717    } 
     718} 
     719add_action( 'template_redirect', '_bp_rehook_maybe_redirect_404', 1 ); 
     720 
     721/** 
    684722 * Remove WordPress's rel=canonical HTML tag if we are trying to load BuddyPress 
    685723 * specific content. 
  • tags/1.6.2/bp-core/bp-core-classes.php

    r6231 r6567  
    465465        $status_sql = bp_core_get_status_sql(); 
    466466 
    467         $total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT ID) FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) " ), $wpdb->escape( $user_ids ) ); 
    468         $paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', $wpdb->prepare( "SELECT DISTINCT ID as id, user_registered, user_nicename, user_login, user_email FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) {$pag_sql}" ), $wpdb->escape( $user_ids ) ); 
     467        $total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT COUNT(DISTINCT ID) FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) ", $wpdb->escape( $user_ids ) ); 
     468        $paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT DISTINCT ID as id, user_registered, user_nicename, user_login, user_email FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) {$pag_sql}", $wpdb->escape( $user_ids ) ); 
    469469 
    470470        $total_users = $wpdb->get_var( $total_users_sql ); 
  • tags/1.6.2/bp-core/bp-core-filters.php

    r6231 r6567  
    9696    $user_ids = implode( ',', $user_ids ); 
    9797 
    98     if ( !$userdata = $wpdb->get_results( $wpdb->prepare( "SELECT ID as user_id, user_login, user_nicename FROM {$wpdb->users} WHERE ID IN ({$user_ids})" ) ) ) 
     98    if ( !$userdata = $wpdb->get_results( "SELECT ID as user_id, user_login, user_nicename FROM {$wpdb->users} WHERE ID IN ({$user_ids})" ) ) 
    9999        return $comments; 
    100100 
  • tags/1.6.2/bp-core/bp-core-functions.php

    r6231 r6567  
    174174        $posts_table_name = bp_is_multiblog_mode() ? $wpdb->posts : $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'posts'; 
    175175        $page_ids_sql     = implode( ',', (array) $page_ids ); 
    176         $page_names       = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_status = 'publish' " ) ); 
     176        $page_names       = $wpdb->get_results( "SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_status = 'publish' " ); 
    177177 
    178178        foreach ( (array) $page_ids as $component_id => $page_id ) { 
  • tags/1.6.2/bp-core/bp-core-options.php

    r6231 r6567  
    291291    $blog_options_keys      = "'" . join( "', '", (array) $root_blog_option_keys ) . "'"; 
    292292    $blog_options_table     = bp_is_multiblog_mode() ? $wpdb->options : $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'options'; 
    293     $blog_options_query     = $wpdb->prepare( "SELECT option_name AS name, option_value AS value FROM {$blog_options_table} WHERE option_name IN ( {$blog_options_keys} )" ); 
     293    $blog_options_query     = "SELECT option_name AS name, option_value AS value FROM {$blog_options_table} WHERE option_name IN ( {$blog_options_keys} )"; 
    294294    $root_blog_options_meta = $wpdb->get_results( $blog_options_query ); 
    295295 
  • tags/1.6.2/bp-core/bp-core-template.php

    r6231 r6567  
    752752    } 
    753753 
     754/** 
     755 * Get the id of the currently displayed user 
     756 * 
     757 * @uses apply_filters() Filter 'bp_displayed_user_id' to change this value 
     758 * @return int 
     759 */ 
     760function bp_displayed_user_id() { 
     761 
     762    static $id = 0; 
     763 
     764    if ( empty( $id ) ) { 
     765        global $bp; 
     766        $id = !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0; 
     767    } 
     768 
     769    return apply_filters( 'bp_displayed_user_id', $id ); 
     770} 
     771 
     772/** 
     773 * Get the id of the currently logged-in user 
     774 * 
     775 * @uses apply_filters() Filter 'bp_loggedin_user_id' to change this value 
     776 * @return int 
     777 */ 
     778function bp_loggedin_user_id() { 
     779 
     780    static $id = 0; 
     781 
     782    if ( empty( $id ) ) { 
     783        global $bp; 
     784        $id = !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0; 
     785    } 
     786 
     787    return apply_filters( 'bp_loggedin_user_id', $id ); 
     788} 
     789 
    754790/** is_() functions to determine the current page *****************************/ 
    755791 
  • tags/1.6.2/bp-core/bp-core-widgets.php

    r6231 r6567  
    325325} 
    326326add_action( 'wp_ajax_widget_members', 'bp_core_ajax_widget_members' ); 
     327add_action( 'wp_ajax_nopriv_widget_members', 'bp_core_ajax_widget_members' ); 
    327328 
    328329?> 
  • tags/1.6.2/bp-core/deprecated/1.5.php

    r6231 r6567  
    419419    _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_friend_requests()' ); 
    420420    return bp_is_user_friend_requests(); 
     421} 
     422 
     423/** 
     424 * Checks to see if a component's URL should be in the root, not under a member page: 
     425 * eg: http://domain.com/groups/the-group NOT http://domain.com/members/andy/groups/the-group 
     426 * You should be using bp_is_root_component(). 
     427 * 
     428 * @deprecated 1.5 
     429 * @deprecated bp_is_root_component() 
     430 * @return true if root component, else false. 
     431 */ 
     432function bp_core_is_root_component( $component_name ) { 
     433    _deprecated_function( __FUNCTION__, '1.5', 'bp_is_root_component()' ); 
     434    return bp_is_root_component( $component_name ); 
    421435} 
    422436 
  • tags/1.6.2/bp-forums/bp-forums-filters.php

    r6231 r6567  
    158158    global $wpdb; 
    159159 
    160     $sql = $wpdb->prepare( "DISTINCT t.topic_id, " ); 
     160    $sql = "DISTINCT t.topic_id, "; 
    161161 
    162162    return $sql; 
     
    179179    global $bbdb, $wpdb; 
    180180 
    181     $sql .= $wpdb->prepare( " LEFT JOIN $bbdb->posts p ON p.topic_id = t.topic_id " ); 
     181    $sql .= " LEFT JOIN $bbdb->posts p ON p.topic_id = t.topic_id "; 
    182182 
    183183    return $sql; 
  • tags/1.6.2/bp-forums/bp-forums-functions.php

    r6231 r6567  
    471471 
    472472    // Fetch the topic's last poster details 
    473     $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} )" ) ); 
     473    $poster_details = $wpdb->get_results( "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} )" ); 
    474474    for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) { 
    475475        foreach ( (array) $poster_details as $poster ) { 
     
    485485    // Fetch fullname for the topic's last poster 
    486486    if ( bp_is_active( 'xprofile' ) ) { 
    487         $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} )" ) ); 
     487        $poster_names = $wpdb->get_results( "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} )" ); 
    488488        for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) { 
    489489            foreach ( (array) $poster_names as $name ) { 
     
    610610 
    611611    // Fetch the poster's user_email, user_nicename and user_login 
    612     $poster_details = $wpdb->get_results( $wpdb->prepare( "SELECT u.ID as user_id, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u WHERE u.ID IN ( {$user_ids} )" ) ); 
     612    $poster_details = $wpdb->get_results( "SELECT u.ID as user_id, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u WHERE u.ID IN ( {$user_ids} )" ); 
    613613 
    614614    for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) { 
     
    625625    // Fetch fullname for each poster. 
    626626    if ( bp_is_active( 'xprofile' ) ) { 
    627         $poster_names = $wpdb->get_results( $wpdb->prepare( "SELECT pd.user_id, pd.value FROM {$bp->profile->table_name_data} pd WHERE pd.user_id IN ( {$user_ids} )" ) ); 
     627        $poster_names = $wpdb->get_results( "SELECT pd.user_id, pd.value FROM {$bp->profile->table_name_data} pd WHERE pd.user_id IN ( {$user_ids} )" ); 
    628628        for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) { 
    629629            foreach ( (array) $poster_names as $name ) { 
  • tags/1.6.2/bp-friends/bp-friends-classes.php

    r6231 r6567  
    8585 
    8686        if ( !empty( $friend_requests_only ) ) { 
    87             $oc_sql = $wpdb->prepare( "AND is_confirmed = 0" ); 
     87            $oc_sql = "AND is_confirmed = 0"; 
    8888            $friend_sql = $wpdb->prepare ( " WHERE friend_user_id = %d", $user_id ); 
    8989        } else { 
    90             $oc_sql = $wpdb->prepare( "AND is_confirmed = 1" ); 
     90            $oc_sql = "AND is_confirmed = 1"; 
    9191            $friend_sql = $wpdb->prepare ( " WHERE (initiator_user_id = %d OR friend_user_id = %d)", $user_id, $user_id ); 
    9292        } 
    9393 
    94         $friends = $wpdb->get_results( $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} $friend_sql $oc_sql ORDER BY date_created DESC" ) ); 
     94        $friends = $wpdb->get_results( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} $friend_sql $oc_sql ORDER BY date_created DESC" ); 
    9595        $fids = array(); 
    9696 
     
    233233        // filter the user_ids based on the search criteria. 
    234234        if ( bp_is_active( 'xprofile' ) ) { 
    235             $sql = $wpdb->prepare( "SELECT DISTINCT d.user_id as id FROM {$bp->profile->table_name_data} d, $users_table u WHERE d.user_id = u.id AND d.value LIKE '$filter%%' ORDER BY d.value DESC $pag_sql" ); 
    236         } else { 
    237             $sql = $wpdb->prepare( "SELECT DISTINCT user_id as id FROM $usermeta_table WHERE meta_value LIKE '$filter%%' ORDER BY d.value DESC $pag_sql" ); 
     235            $sql = "SELECT DISTINCT d.user_id as id FROM {$bp->profile->table_name_data} d, $users_table u WHERE d.user_id = u.id AND d.value LIKE '$filter%%' ORDER BY d.value DESC $pag_sql"; 
     236        } else { 
     237            $sql = "SELECT DISTINCT user_id as id FROM $usermeta_table WHERE meta_value LIKE '$filter%%' ORDER BY d.value DESC $pag_sql"; 
    238238        } 
    239239 
     
    256256        // filter the user_ids based on the search criteria. 
    257257        if ( bp_is_active( 'xprofile' ) ) { 
    258             $sql = $wpdb->prepare( "SELECT COUNT(DISTINCT d.user_id) FROM {$bp->profile->table_name_data} d, $users_table u WHERE d.user_id = u.id AND d.value LIKE '$filter%%'" ); 
    259         } else { 
    260             $sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM $usermeta_table WHERE meta_value LIKE '$filter%%'" ); 
     258            $sql = "SELECT COUNT(DISTINCT d.user_id) FROM {$bp->profile->table_name_data} d, $users_table u WHERE d.user_id = u.id AND d.value LIKE '$filter%%'"; 
     259        } else { 
     260            $sql = "SELECT COUNT(DISTINCT user_id) FROM $usermeta_table WHERE meta_value LIKE '$filter%%'"; 
    261261        } 
    262262 
  • tags/1.6.2/bp-groups/bp-groups-classes.php

    r6231 r6567  
    177177 
    178178        // Modify group count usermeta for members 
    179         $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->usermeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_id_str} )" ) ); 
     179        $wpdb->query( "UPDATE {$wpdb->usermeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_id_str} )" ); 
    180180 
    181181        // Now delete all group member entries 
     
    235235        $gids = implode( ',', $gids['groups'] ); 
    236236 
    237         $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids}) {$pag_sql}" ) ); 
    238         $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids})" ) ); 
     237        $paged_groups = $wpdb->get_results( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids}) {$pag_sql}" ); 
     238        $total_groups = $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids})" ); 
    239239 
    240240        return array( 'groups' => $paged_groups, 'total' => $total_groups ); 
     
    533533 
    534534        if ( !bp_current_user_can( 'bp_moderate' ) ) 
    535             $hidden_sql = $wpdb->prepare( " AND status != 'hidden'"); 
     535            $hidden_sql = " AND status != 'hidden'"; 
    536536 
    537537        $letter = like_escape( $wpdb->escape( $letter ) ); 
     
    539539        if ( !empty( $limit ) && !empty( $page ) ) { 
    540540            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 
    541             $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' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql}" ) ); 
    542         } 
    543  
    544         $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} {$exclude_sql} ORDER BY g.name ASC {$pag_sql}"  ) ); 
     541            $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' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql}" ); 
     542        } 
     543 
     544        $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' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql} ORDER BY g.name ASC {$pag_sql}" ); 
    545545 
    546546        if ( !empty( $populate_extras ) ) { 
     
    637637            $hidden_sql = "WHERE status != 'hidden'"; 
    638638 
    639         return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} {$hidden_sql}" ) ); 
     639        return $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} {$hidden_sql}" ); 
    640640    } 
    641641 
     
    692692 
    693693            case 'hidden' : 
    694                 $status_sql = $wpdb->prepare( "AND g.status = 'hidden'" ); 
     694                $status_sql = "AND g.status = 'hidden'"; 
    695695                break; 
    696696 
    697697            case 'private' : 
    698                 $status_sql = $wpdb->prepare( "AND g.status = 'private'" ); 
     698                $status_sql = "AND g.status = 'private'"; 
    699699                break; 
    700700 
    701701            case 'public' : 
    702702            default : 
    703                 $status_sql = $wpdb->prepare( "AND g.status = 'public'" ); 
     703                $status_sql = "AND g.status = 'public'"; 
    704704                break; 
    705705        } 
     
    809809        } else { 
    810810            // Ensure that user is not already a member of the group before inserting 
    811             if ( $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d LIMIT 1", $this->user_id, $this->group_id ) ) ) { 
     811            if ( $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 LIMIT 1", $this->user_id, $this->group_id ) ) ) { 
    812812                return false; 
    813813            } 
     
    11741174        $exclude_admins_sql = ''; 
    11751175        if ( !empty( $exclude_admins_mods ) ) 
    1176             $exclude_admins_sql = $wpdb->prepare( "AND is_admin = 0 AND is_mod = 0" ); 
     1176            $exclude_admins_sql = "AND is_admin = 0 AND is_mod = 0"; 
    11771177 
    11781178        $banned_sql = ''; 
    11791179        if ( !empty( $exclude_banned ) ) 
    1180             $banned_sql = $wpdb->prepare( " AND is_banned = 0" ); 
     1180            $banned_sql = " AND is_banned = 0"; 
    11811181 
    11821182        $exclude_sql = ''; 
    11831183        if ( !empty( $exclude ) ) 
    1184             $exclude_sql = $wpdb->prepare( " AND m.user_id NOT IN ({$exclude})" ); 
     1184            $exclude_sql = " AND m.user_id NOT IN ({$exclude})"; 
    11851185 
    11861186        if ( bp_is_active( 'xprofile' ) ) 
  • tags/1.6.2/bp-groups/bp-groups-loader.php

    r6231 r6567  
    503503            $pending = __( 'No Pending Invites', 'buddypress' ); 
    504504 
    505             if ( !empty( $count->total ) ) { 
    506                 $title   = sprintf( __( 'Groups <span class="count">%s</span>',          'buddypress' ), $count->total ); 
    507                 $pending = sprintf( __( 'Pending Invites <span class="count">%s</span>', 'buddypress' ), $count->total ); 
     505            if ( !empty( $count['total'] ) ) { 
     506                $title   = sprintf( __( 'Groups <span class="count">%s</span>',          'buddypress' ), $count['total'] ); 
     507                $pending = sprintf( __( 'Pending Invites <span class="count">%s</span>', 'buddypress' ), $count['total'] ); 
    508508            } 
    509509 
  • tags/1.6.2/bp-groups/bp-groups-widgets.php

    r6231 r6567  
    206206} 
    207207add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' ); 
     208add_action( 'wp_ajax_nopriv_widget_groups_list', 'groups_ajax_widget_groups_list' ); 
    208209 
    209210?> 
  • tags/1.6.2/bp-languages/buddypress.pot

    r6231 r6567  
    55"Project-Id-Version: BuddyPress \n" 
    66"Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n" 
    7 "POT-Creation-Date: 2012-08-05 21:37:42+00:00\n" 
     7"POT-Creation-Date: 2012-12-04 13:36:44+00:00\n" 
    88"MIME-Version: 1.0\n" 
    99"Content-Type: text/plain; charset=UTF-8\n" 
     
    16321632 
    16331633#: bp-core/bp-core-admin.php:216 bp-core/bp-core-admin.php:217 
    1634 #: bp-core/bp-core-admin.php:237 bp-members/bp-members-functions.php:1260 
     1634#: bp-core/bp-core-admin.php:237 bp-members/bp-members-functions.php:1310 
    16351635msgid "BuddyPress" 
    16361636msgstr "" 
     
    17161716msgstr "" 
    17171717 
    1718 #: bp-core/bp-core-avatars.php:223 
     1718#: bp-core/bp-core-avatars.php:221 
    17191719msgid "Avatar Image" 
    17201720msgstr "" 
    17211721 
     1722#: bp-core/bp-core-avatars.php:481 
     1723msgid "There is no error, the file uploaded with success" 
     1724msgstr "" 
     1725 
     1726#: bp-core/bp-core-avatars.php:482 bp-core/bp-core-avatars.php:483 
     1727msgid "Your image was bigger than the maximum allowed file size of: " 
     1728msgstr "" 
     1729 
    17221730#: bp-core/bp-core-avatars.php:484 
    1723 msgid "There is no error, the file uploaded with success" 
    1724 msgstr "" 
    1725  
    1726 #: bp-core/bp-core-avatars.php:485 bp-core/bp-core-avatars.php:486 
    1727 msgid "Your image was bigger than the maximum allowed file size of: " 
    1728 msgstr "" 
    1729  
    1730 #: bp-core/bp-core-avatars.php:487 
    17311731msgid "The uploaded file was only partially uploaded" 
    17321732msgstr "" 
    17331733 
    1734 #: bp-core/bp-core-avatars.php:488 
     1734#: bp-core/bp-core-avatars.php:485 
    17351735msgid "No file was uploaded" 
    17361736msgstr "" 
    17371737 
    1738 #: bp-core/bp-core-avatars.php:489 
     1738#: bp-core/bp-core-avatars.php:486 
    17391739msgid "Missing a temporary folder" 
    17401740msgstr "" 
    17411741 
    1742 #: bp-core/bp-core-avatars.php:493 
     1742#: bp-core/bp-core-avatars.php:490 
    17431743msgid "Your upload failed, please try again. Error was: %s" 
    17441744msgstr "" 
    17451745 
    1746 #: bp-core/bp-core-avatars.php:498 
     1746#: bp-core/bp-core-avatars.php:495 
    17471747msgid "The file you uploaded is too big. Please upload a file under %s" 
    17481748msgstr "" 
    17491749 
    1750 #: bp-core/bp-core-avatars.php:503 
     1750#: bp-core/bp-core-avatars.php:500 
    17511751msgid "Please upload only JPG, GIF or PNG photos." 
    17521752msgstr "" 
    17531753 
    1754 #: bp-core/bp-core-avatars.php:514 bp-core/bp-core-avatars.php:527 
     1754#: bp-core/bp-core-avatars.php:511 bp-core/bp-core-avatars.php:546 
    17551755msgid "Upload Failed! Error was: %s" 
    17561756msgstr "" 
    17571757 
    1758 #: bp-core/bp-core-avatars.php:545 
     1758#: bp-core/bp-core-avatars.php:561 
    17591759msgid "Upload failed! Error was: %s" 
    17601760msgstr "" 
    17611761 
    1762 #: bp-core/bp-core-avatars.php:680 bp-core/bp-core-classes.php:174 
     1762#: bp-core/bp-core-avatars.php:696 bp-core/bp-core-classes.php:174 
    17631763#: bp-core/bp-core-classes.php:175 bp-core/bp-core-classes.php:176 
    17641764#: bp-core/bp-core-template.php:98 bp-core/bp-core-template.php:107 
     
    18341834msgstr "" 
    18351835 
    1836 #: bp-core/bp-core-filters.php:255 bp-members/bp-members-functions.php:1262 
     1836#: bp-core/bp-core-filters.php:255 bp-members/bp-members-functions.php:1312 
    18371837msgid "" 
    18381838"Thanks for registering! To complete the activation of your account please click the following link:\n" 
     
    18421842msgstr "" 
    18431843 
    1844 #: bp-core/bp-core-filters.php:256 bp-members/bp-members-functions.php:1263 
     1844#: bp-core/bp-core-filters.php:256 bp-members/bp-members-functions.php:1313 
    18451845msgid "Activate Your Account" 
    18461846msgstr "" 
     
    34223422 
    34233423#: bp-members/bp-members-adminbar.php:99 
    3424 #: bp-xprofile/bp-xprofile-template.php:894 
    3425 #: bp-xprofile/bp-xprofile-template.php:895 
     3424#: bp-xprofile/bp-xprofile-template.php:899 
     3425#: bp-xprofile/bp-xprofile-template.php:900 
    34263426msgid "Edit Profile" 
    34273427msgstr "" 
     
    34803480msgstr "" 
    34813481 
    3482 #: bp-members/bp-members-functions.php:988 
     3482#: bp-members/bp-members-functions.php:1038 
    34833483msgid "Please enter a username" 
    34843484msgstr "" 
    34853485 
    3486 #: bp-members/bp-members-functions.php:996 
     3486#: bp-members/bp-members-functions.php:1046 
    34873487msgid "Only lowercase letters and numbers allowed" 
    34883488msgstr "" 
    34893489 
    3490 #: bp-members/bp-members-functions.php:999 
     3490#: bp-members/bp-members-functions.php:1049 
    34913491msgid "Username must be at least 4 characters" 
    34923492msgstr "" 
    34933493 
    3494 #: bp-members/bp-members-functions.php:1002 
     3494#: bp-members/bp-members-functions.php:1052 
    34953495msgid "Sorry, usernames may not contain the character \"_\"!" 
    34963496msgstr "" 
    34973497 
    3498 #: bp-members/bp-members-functions.php:1009 
     3498#: bp-members/bp-members-functions.php:1059 
    34993499msgid "Sorry, usernames must have letters too!" 
    35003500msgstr "" 
    35013501 
    3502 #: bp-members/bp-members-functions.php:1012 
     3502#: bp-members/bp-members-functions.php:1062 
    35033503msgid "Please check your email address." 
    35043504msgstr "" 
    35053505 
    3506 #: bp-members/bp-members-functions.php:1015 
    3507 #: bp-members/bp-members-functions.php:1023 
     3506#: bp-members/bp-members-functions.php:1065 
     3507#: bp-members/bp-members-functions.php:1073 
    35083508msgid "Sorry, that email address is not allowed!" 
    35093509msgstr "" 
    35103510 
    3511 #: bp-members/bp-members-functions.php:1028 
     3511#: bp-members/bp-members-functions.php:1078 
    35123512msgid "Sorry, that username already exists!" 
    35133513msgstr "" 
    35143514 
    3515 #: bp-members/bp-members-functions.php:1032 
     3515#: bp-members/bp-members-functions.php:1082 
    35163516msgid "Sorry, that email address is already used!" 
    35173517msgstr "" 
    35183518 
    3519 #: bp-members/bp-members-functions.php:1071 
     3519#: bp-members/bp-members-functions.php:1121 
    35203520msgid "<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href=\"mailto:%s\">webmaster</a> !" 
    35213521msgstr "" 
    35223522 
    3523 #: bp-members/bp-members-functions.php:1169 
    3524 #: bp-members/bp-members-functions.php:1173 
     3523#: bp-members/bp-members-functions.php:1219 
     3524#: bp-members/bp-members-functions.php:1223 
    35253525msgid "Invalid activation key" 
    35263526msgstr "" 
    35273527 
    3528 #: bp-members/bp-members-functions.php:1210 
     3528#: bp-members/bp-members-functions.php:1260 
    35293529msgid "%s became a registered member" 
    35303530msgstr "" 
    35313531 
    3532 #: bp-members/bp-members-functions.php:1296 
     3532#: bp-members/bp-members-functions.php:1346 
    35333533msgid "<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link." 
    35343534msgstr "" 
     
    35423542msgstr "" 
    35433543 
    3544 #: bp-members/bp-members-screens.php:90 
     3544#: bp-members/bp-members-screens.php:94 
    35453545msgid "Please make sure you enter your password twice" 
    35463546msgstr "" 
    35473547 
    3548 #: bp-members/bp-members-screens.php:94 
     3548#: bp-members/bp-members-screens.php:98 
    35493549msgid "The passwords you entered do not match." 
    35503550msgstr "" 
    35513551 
    3552 #: bp-members/bp-members-screens.php:117 
     3552#: bp-members/bp-members-screens.php:121 
    35533553msgid "This is a required field" 
    35543554msgstr "" 
    35553555 
    3556 #: bp-members/bp-members-screens.php:247 
     3556#: bp-members/bp-members-screens.php:251 
    35573557msgid "Your account is now active!" 
    35583558msgstr "" 
     
    35973597msgstr "" 
    35983598 
    3599 #: bp-members/bp-members-template.php:1100 
     3599#: bp-members/bp-members-template.php:1076 
    36003600msgid "Your Avatar" 
    36013601msgstr "" 
    36023602 
    3603 #: bp-members/bp-members-template.php:1170 
     3603#: bp-members/bp-members-template.php:1146 
    36043604msgid "Activity RSS Feed" 
    36053605msgstr "" 
     
    38443844msgstr "" 
    38453845 
    3846 #: bp-settings/bp-settings-actions.php:161 
     3846#: bp-settings/bp-settings-actions.php:157 
    38473847msgid "That email address is invalid. Check the formatting and try again." 
    38483848msgstr "" 
    38493849 
    3850 #: bp-settings/bp-settings-actions.php:164 
     3850#: bp-settings/bp-settings-actions.php:160 
    38513851msgid "That email address is currently unavailable for use." 
    38523852msgstr "" 
    38533853 
    3854 #: bp-settings/bp-settings-actions.php:167 
     3854#: bp-settings/bp-settings-actions.php:163 
    38553855msgid "That email address is already taken." 
    38563856msgstr "" 
    38573857 
    3858 #: bp-settings/bp-settings-actions.php:170 
     3858#: bp-settings/bp-settings-actions.php:166 
    38593859msgid "Email address cannot be empty." 
    38603860msgstr "" 
    38613861 
    3862 #: bp-settings/bp-settings-actions.php:180 
     3862#: bp-settings/bp-settings-actions.php:176 
    38633863msgid "Your current password is invalid." 
    38643864msgstr "" 
    38653865 
    3866 #: bp-settings/bp-settings-actions.php:183 
     3866#: bp-settings/bp-settings-actions.php:179 
    38673867msgid "The new password fields did not match." 
    38683868msgstr "" 
    38693869 
    3870 #: bp-settings/bp-settings-actions.php:186 
     3870#: bp-settings/bp-settings-actions.php:182 
    38713871msgid "One of the password fields was empty." 
    38723872msgstr "" 
    38733873 
    3874 #: bp-settings/bp-settings-actions.php:195 
     3874#: bp-settings/bp-settings-actions.php:191 
    38753875msgid "Your settings have been saved." 
    38763876msgstr "" 
    38773877 
    3878 #: bp-settings/bp-settings-actions.php:201 
     3878#: bp-settings/bp-settings-actions.php:197 
    38793879msgid "No changes were made to your account." 
    38803880msgstr "" 
    38813881 
    3882 #: bp-settings/bp-settings-actions.php:203 
     3882#: bp-settings/bp-settings-actions.php:199 
    38833883msgid "No changes were made to this account." 
    38843884msgstr "" 
    38853885 
    3886 #: bp-settings/bp-settings-actions.php:253 
     3886#: bp-settings/bp-settings-actions.php:247 
    38873887msgid "Your notification settings have been saved." 
    38883888msgstr "" 
    38893889 
    3890 #: bp-settings/bp-settings-actions.php:255 
     3890#: bp-settings/bp-settings-actions.php:249 
    38913891msgid "This user's notification settings have been saved." 
    38923892msgstr "" 
    38933893 
    3894 #: bp-settings/bp-settings-actions.php:346 
     3894#: bp-settings/bp-settings-actions.php:340 
    38953895msgid "%s was successfully deleted." 
    38963896msgstr "" 
     
    43944394 
    43954395#: bp-themes/bp-default/forums/index.php:116 
    4396 #: bp-xprofile/bp-xprofile-template.php:458 
     4396#: bp-xprofile/bp-xprofile-template.php:463 
    43974397msgid "----" 
    43984398msgstr "" 
     
    55245524msgstr "" 
    55255525 
    5526 #: bp-xprofile/bp-xprofile-template.php:663 
     5526#: bp-xprofile/bp-xprofile-template.php:668 
    55275527msgid "January" 
    55285528msgstr "" 
    55295529 
    5530 #: bp-xprofile/bp-xprofile-template.php:664 
     5530#: bp-xprofile/bp-xprofile-template.php:669 
    55315531msgid "February" 
    55325532msgstr "" 
    55335533 
    5534 #: bp-xprofile/bp-xprofile-template.php:665 
     5534#: bp-xprofile/bp-xprofile-template.php:670 
    55355535msgid "March" 
    55365536msgstr "" 
    55375537 
    5538 #: bp-xprofile/bp-xprofile-template.php:666 
     5538#: bp-xprofile/bp-xprofile-template.php:671 
    55395539msgid "April" 
    55405540msgstr "" 
    55415541 
    5542 #: bp-xprofile/bp-xprofile-template.php:667 
     5542#: bp-xprofile/bp-xprofile-template.php:672 
    55435543msgid "May" 
    55445544msgstr "" 
    55455545 
    5546 #: bp-xprofile/bp-xprofile-template.php:668 
     5546#: bp-xprofile/bp-xprofile-template.php:673 
    55475547msgid "June" 
    55485548msgstr "" 
    55495549 
    5550 #: bp-xprofile/bp-xprofile-template.php:669 
     5550#: bp-xprofile/bp-xprofile-template.php:674 
    55515551msgid "July" 
    55525552msgstr "" 
    55535553 
    5554 #: bp-xprofile/bp-xprofile-template.php:670 
     5554#: bp-xprofile/bp-xprofile-template.php:675 
    55555555msgid "August" 
    55565556msgstr "" 
    55575557 
    5558 #: bp-xprofile/bp-xprofile-template.php:671 
     5558#: bp-xprofile/bp-xprofile-template.php:676 
    55595559msgid "September" 
    55605560msgstr "" 
    55615561 
    5562 #: bp-xprofile/bp-xprofile-template.php:672 
     5562#: bp-xprofile/bp-xprofile-template.php:677 
    55635563msgid "October" 
    55645564msgstr "" 
    55655565 
    5566 #: bp-xprofile/bp-xprofile-template.php:673 
     5566#: bp-xprofile/bp-xprofile-template.php:678 
    55675567msgid "November" 
    55685568msgstr "" 
    55695569 
    5570 #: bp-xprofile/bp-xprofile-template.php:674 
     5570#: bp-xprofile/bp-xprofile-template.php:679 
    55715571msgid "December" 
    55725572msgstr "" 
    55735573 
    5574 #: bp-xprofile/bp-xprofile-template.php:842 
     5574#: bp-xprofile/bp-xprofile-template.php:847 
    55755575msgid "Avatar uploads are currently disabled. Why not use a <a href=\"http://gravatar.com\" target=\"_blank\">gravatar</a> instead?" 
    55765576msgstr "" 
    55775577 
    5578 #: bp-xprofile/bp-xprofile-template.php:850 
     5578#: bp-xprofile/bp-xprofile-template.php:855 
    55795579msgid "Profile not recently updated" 
    55805580msgstr "" 
    55815581 
    5582 #: bp-xprofile/bp-xprofile-template.php:860 
     5582#: bp-xprofile/bp-xprofile-template.php:865 
    55835583msgid "Profile updated %s" 
    55845584msgstr "" 
  • tags/1.6.2/bp-loader.php

    r6231 r6567  
    1515 * Author:      The BuddyPress Community 
    1616 * Author URI:  http://buddypress.org/community/members/ 
    17  * Version:     1.6 
     17 * Version:     1.6.2 
    1818 * Text Domain: buddypress 
    1919 * Domain Path: /bp-languages/ 
     
    5353     * @var string BuddyPress version 
    5454     */ 
    55     public $version = '1.6'; 
     55    public $version = '1.6.2'; 
    5656 
    5757    /** 
     
    486486 
    487487endif; 
    488  
    489 ?> 
  • tags/1.6.2/bp-members/bp-members-functions.php

    r6231 r6567  
    479479    if ( !$count = wp_cache_get( 'bp_total_member_count', 'bp' ) ) { 
    480480        $status_sql = bp_core_get_status_sql(); 
    481         $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->users WHERE {$status_sql}" ) ); 
     481        $count = $wpdb->get_var( "SELECT COUNT(ID) FROM $wpdb->users WHERE {$status_sql}" ); 
    482482        wp_cache_set( 'bp_total_member_count', $count, 'bp' ); 
    483483    } 
     
    497497        // Avoid a costly join by splitting the lookup 
    498498        if ( is_multisite() ) { 
    499             $sql = $wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE (user_status != 0 OR deleted != 0 OR user_status != 0)" ); 
     499            $sql = "SELECT ID FROM $wpdb->users WHERE (user_status != 0 OR deleted != 0 OR user_status != 0)"; 
    500500        } else { 
    501             $sql = $wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE user_status != 0" ); 
     501            $sql = "SELECT ID FROM $wpdb->users WHERE user_status != 0"; 
    502502        } 
    503503 
    504504        $exclude_users = $wpdb->get_col( $sql ); 
    505         $exclude_users_sql = !empty( $exclude_users ) ? $wpdb->prepare( "AND user_id NOT IN (" . implode( ',', wp_parse_id_list( $exclude_users ) ) . ")" ) : ''; 
     505        $exclude_users_sql = !empty( $exclude_users ) ? "AND user_id NOT IN (" . implode( ',', wp_parse_id_list( $exclude_users ) ) . ")" : ''; 
    506506 
    507507        $count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(user_id) FROM $wpdb->usermeta WHERE meta_key = %s {$exclude_users_sql}", bp_get_user_meta_key( 'last_activity' ) ) ); 
     
    971971 
    972972/** 
     973 * Check that an email address is valid for use 
     974 * 
     975 * Performs the following checks: 
     976 *   - Is the email address well-formed? 
     977 *   - Is the email address already used? 
     978 *   - If there's an email domain blacklist, is the current domain on it? 
     979 *   - If there's an email domain whitelest, is the current domain on it? 
     980 * 
     981 * @since 1.6.2 
     982 * 
     983 * @param string $user_email The email being checked 
     984 * @return bool|array True if the address passes all checks; otherwise an array 
     985 *   of error codes 
     986 */ 
     987function bp_core_validate_email_address( $user_email ) { 
     988    $errors = array(); 
     989 
     990    $user_email = sanitize_email( $user_email ); 
     991 
     992    // Is the email well-formed? 
     993    if ( ! is_email( $user_email ) ) 
     994        $errors['invalid'] = 1; 
     995 
     996    // Is the email on the Banned Email Domains list? 
     997    // Note: This check only works on Multisite 
     998    if ( function_exists( 'is_email_address_unsafe' ) && is_email_address_unsafe( $user_email ) ) 
     999        $errors['domain_banned'] = 1; 
     1000 
     1001    // Is the email on the Limited Email Domains list? 
     1002    // Note: This check only works on Multisite 
     1003    $limited_email_domains = get_site_option( 'limited_email_domains' ); 
     1004    if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) { 
     1005        $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) ); 
     1006        if ( ! in_array( $emaildomain, $limited_email_domains ) ) { 
     1007            $errors['domain_not_allowed'] = 1; 
     1008        } 
     1009    } 
     1010 
     1011    // Is the email alreday in use? 
     1012    if ( email_exists( $user_email ) ) 
     1013        $errors['in_use'] = 1; 
     1014 
     1015    $retval = ! empty( $errors ) ? $errors : true; 
     1016 
     1017    return apply_filters( 'bp_core_validate_email_address', $retval, $user_email ); 
     1018} 
     1019 
     1020/** 
    9731021 * Validate a user name and email address when creating a new user. 
     1022 * 
     1023 * @todo Refactor to use bp_core_validate_email_address() 
    9741024 * 
    9751025 * @param string $user_name Username to validate 
  • tags/1.6.2/bp-members/bp-members-screens.php

    r6231 r6567  
    6868    } 
    6969 
     70    if ( !isset( $bp->signup ) ) { 
     71        $bp->signup = new stdClass; 
     72    } 
     73 
    7074    $bp->signup->step = 'request-details'; 
    7175 
  • tags/1.6.2/bp-members/bp-members-template.php

    r6231 r6567  
    863863    } 
    864864    function bp_user_link() { bp_displayed_user_domain(); } // Deprecated. 
    865  
    866 function bp_displayed_user_id() { 
    867  
    868     static $id = 0; 
    869  
    870     if ( empty( $id ) ) { 
    871         global $bp; 
    872         $id = !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0; 
    873     } 
    874  
    875     return apply_filters( 'bp_displayed_user_id', $id ); 
    876 } 
    877  
    878 function bp_loggedin_user_id() { 
    879  
    880     static $id = 0; 
    881  
    882     if ( empty( $id ) ) { 
    883         global $bp; 
    884         $id = !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0; 
    885     } 
    886  
    887     return apply_filters( 'bp_loggedin_user_id', $id ); 
    888 } 
    889865 
    890866function bp_current_user_id() { return bp_displayed_user_id(); } 
  • tags/1.6.2/bp-messages/bp-messages-classes.php

    r6231 r6567  
    145145 
    146146        if ( $type == 'unread' ) 
    147             $type_sql = $wpdb->prepare( " AND r.unread_count != 0 " ); 
     147            $type_sql = " AND r.unread_count != 0 "; 
    148148        elseif ( $type == 'read' ) 
    149             $type_sql = $wpdb->prepare( " AND r.unread_count = 0 " ); 
     149            $type_sql = " AND r.unread_count = 0 "; 
    150150 
    151151        if ( !empty( $search_terms ) ) { 
     
    200200 
    201201        if ( $type == 'unread' ) 
    202             $type_sql = $wpdb->prepare( " AND unread_count != 0 " ); 
     202            $type_sql = " AND unread_count != 0 "; 
    203203        else if ( $type == 'read' ) 
    204             $type_sql = $wpdb->prepare( " AND unread_count = 0 " ); 
     204            $type_sql = " AND unread_count = 0 "; 
    205205 
    206206        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 ) ); 
     
    283283        $bp_prefix = bp_core_get_table_prefix(); 
    284284        $errors    = false; 
    285         $threads   = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp_prefix}bp_messages_threads" ) ); 
     285        $threads   = $wpdb->get_results( "SELECT * FROM {$bp_prefix}bp_messages_threads" ); 
    286286 
    287287        // Nothing to update, just return true to remove the table 
     
    358358        // If we have no thread_id then this is the first message of a new thread. 
    359359        if ( empty( $this->thread_id ) ) { 
    360             $this->thread_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" ) ) + 1; 
     360            $this->thread_id = (int) $wpdb->get_var( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" ) + 1; 
    361361            $new_thread = true; 
    362362        } 
     
    539539        } 
    540540 
    541         $notices = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC {$limit_sql}" ) ); 
     541        $notices = $wpdb->get_results( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC {$limit_sql}" ); 
    542542 
    543543        return $notices; 
     
    547547        global $wpdb, $bp; 
    548548 
    549         $notice_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices ) ); 
     549        $notice_count = $wpdb->get_var( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices ); 
    550550 
    551551        return $notice_count; 
     
    555555        global $wpdb, $bp; 
    556556 
    557         $notice_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" ) ); 
     557        $notice_id = $wpdb->get_var( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" ); 
    558558        return new BP_Messages_Notice( $notice_id ); 
    559559    } 
  • tags/1.6.2/bp-settings/bp-settings-actions.php

    r6231 r6567  
    7272                if ( $bp->displayed_user->userdata->user_email != $user_email ) { 
    7373 
    74                     // Is email valid 
    75                     if ( !is_email( $user_email ) ) 
    76                         $email_error = 'invalid'; 
    77  
    78                     // Get blocked email domains 
    79                     $limited_email_domains = get_site_option( 'limited_email_domains', 'buddypress' ); 
    80  
    81                     // If blocked email domains exist, see if this is one of them 
    82                     if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) { 
    83                         $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) ); 
    84  
    85                         if ( in_array( $emaildomain, (array) $limited_email_domains ) == false ) { 
     74                    // Run some tests on the email address 
     75                    $email_checks = bp_core_validate_email_address( $user_email ); 
     76 
     77                    if ( true !== $email_checks ) { 
     78                        if ( isset( $email_checks['invalid'] ) ) { 
     79                            $email_error = 'invalid'; 
     80                        } 
     81 
     82                        if ( isset( $email_checks['domain_banned'] ) || isset( $email_checks['domain_not_allowed'] ) ) { 
    8683                            $email_error = 'blocked'; 
    8784                        } 
    88                     } 
    89  
    90                     // No errors, and email address doesn't match 
    91                     if ( ( false === $email_error ) && email_exists( $user_email ) ) { 
    92                         $email_error = 'taken'; 
     85 
     86                        if ( isset( $email_checks['in_use'] ) ) { 
     87                            $email_error = 'taken'; 
     88                        } 
    9389                    } 
    9490 
     
    243239        if ( isset( $_POST['notifications'] ) ) { 
    244240            foreach ( (array) $_POST['notifications'] as $key => $value ) { 
    245                 if ( $meta_key = bp_get_user_meta_key( $key ) ) { 
    246                     bp_update_user_meta( (int) bp_displayed_user_id(), $meta_key, $value ); 
    247                 } 
     241                bp_update_user_meta( (int) bp_displayed_user_id(), $key, $value ); 
    248242            } 
    249243        } 
  • tags/1.6.2/bp-themes/bp-default/blogs/create.php

    r6231 r6567  
    4646<?php get_sidebar( 'buddypress' ); ?> 
    4747<?php get_footer( 'buddypress' ); ?> 
    48  
  • tags/1.6.2/bp-themes/bp-default/groups/index.php

    r6231 r6567  
    9090<?php get_sidebar( 'buddypress' ); ?> 
    9191<?php get_footer( 'buddypress' ); ?> 
    92  
  • tags/1.6.2/bp-themes/bp-default/groups/single/forum.php

    r6231 r6567  
    9595 
    9696<?php endif; ?> 
    97  
  • tags/1.6.2/bp-themes/bp-default/rtl.css

    r6231 r6567  
    33 * Theme URI: http://buddypress.org/extend/themes/ 
    44 * Description: Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor. 
    5  * Version: 1.6 
     5 * Version: 1.6.2 
    66 * Author: the BuddyPress team 
    77 * Author URI: http://buddypress.org 
  • tags/1.6.2/bp-themes/bp-default/style.css

    r6231 r6567  
    33 * Theme URI: http://buddypress.org/extend/themes/ 
    44 * Description: Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor. 
    5  * Version: 1.6 
     5 * Version: 1.6.2 
    66 * Author: the BuddyPress team 
    77 * Author URI: http://buddypress.org 
  • tags/1.6.2/bp-xprofile/bp-xprofile-classes.php

    r6231 r6567  
    134134            $where_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id ); 
    135135        elseif ( $exclude_groups ) 
    136             $where_sql = $wpdb->prepare( "WHERE g.id NOT IN ({$exclude_groups})"); 
     136            $where_sql = "WHERE g.id NOT IN ({$exclude_groups})"; 
    137137 
    138138        if ( !empty( $hide_empty_groups ) ) 
    139             $groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g INNER JOIN {$bp->profile->table_name_fields} f ON g.id = f.group_id {$where_sql} ORDER BY g.group_order ASC" ) ); 
     139            $groups = $wpdb->get_results( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g INNER JOIN {$bp->profile->table_name_fields} f ON g.id = f.group_id {$where_sql} ORDER BY g.group_order ASC" ); 
    140140        else 
    141             $groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g {$where_sql} ORDER BY g.group_order ASC" ) ); 
     141            $groups = $wpdb->get_results( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g {$where_sql} ORDER BY g.group_order ASC" ); 
    142142 
    143143        if ( empty( $fetch_fields ) ) 
     
    165165 
    166166        if ( !empty( $exclude_fields_cs ) ) { 
    167             $exclude_fields_sql = $wpdb->prepare( "AND id NOT IN ({$exclude_fields_cs})" ); 
     167            $exclude_fields_sql = "AND id NOT IN ({$exclude_fields_cs})"; 
    168168        } else { 
    169169            $exclude_fields_sql = ''; 
     
    171171 
    172172        // Fetch the fields 
    173         $fields = $wpdb->get_results( $wpdb->prepare( "SELECT id, name, description, type, group_id, is_required FROM {$bp->profile->table_name_fields} WHERE group_id IN ( {$group_ids} ) AND parent_id = 0 {$exclude_fields_sql} ORDER BY field_order" ) ); 
     173        $fields = $wpdb->get_results( "SELECT id, name, description, type, group_id, is_required FROM {$bp->profile->table_name_fields} WHERE group_id IN ( {$group_ids} ) AND parent_id = 0 {$exclude_fields_sql} ORDER BY field_order" ); 
    174174 
    175175        if ( empty( $fields ) ) 
     
    332332        global $wpdb, $bp; 
    333333 
    334         $levels = $wpdb->get_results( $wpdb->prepare( "SELECT object_id, meta_key, meta_value FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND ( meta_key = 'default_visibility' OR meta_key = 'allow_custom_visibility' )" ) ); 
     334        $levels = $wpdb->get_results( "SELECT object_id, meta_key, meta_value FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND ( meta_key = 'default_visibility' OR meta_key = 'allow_custom_visibility' )" ); 
    335335 
    336336        // Arrange so that the field id is the key and the visibility level the value 
     
    11981198 
    11991199        if ( !empty( $exclude_fullname ) ) 
    1200             $exclude_sql = $wpdb->prepare( " AND pf.id != 1" ); 
     1200            $exclude_sql = " AND pf.id != 1"; 
    12011201 
    12021202        return $wpdb->get_results( $wpdb->prepare( "SELECT pf.type, pf.name, pd.value FROM {$bp->profile->table_name_data} pd INNER JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id AND pd.user_id = %d {$exclude_sql} ORDER BY RAND() LIMIT 1", $user_id ) ); 
  • tags/1.6.2/bp-xprofile/bp-xprofile-template.php

    r6231 r6567  
    341341         * value as long as it's not empty and a required field. 
    342342         */ 
    343         if ( !isset( $field->data->value ) ) 
     343        if ( !isset( $field->data ) ) { 
     344            $field->data = new stdClass; 
     345        } 
     346 
     347        if ( !isset( $field->data->value ) ) { 
    344348            $field->data->value = ''; 
     349        } 
    345350 
    346351        if ( isset( $_POST['field_' . $field->id] ) && $field->data->value != $_POST['field_' . $field->id] ) { 
  • tags/1.6.2/readme.txt

    r6231 r6567  
    44Requires at least: 3.4 
    55Tested up to: 3.4.1 
    6 Stable tag: 1.6 
     6Stable tag: 1.6.2 
    77License: GPLv2 or later 
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    8787== Upgrade Notice == 
    8888 
     89= 1.6.2 = 
     90Compatibility with WordPress 3.5 
     91 
     92= 1.6.1 = 
     93Fixes 4 bugs 
     94 
    8995= 1.6 = 
    9096See: http://codex.buddypress.org/releases/version-1-6/ 
Note: See TracChangeset for help on using the changeset viewer.