Skip to:
Content

BuddyPress.org

Changeset 2114


Ignore:
Timestamp:
11/24/2009 10:05:01 PM (15 years ago)
Author:
apeatling
Message:

Merging 1.1 branch fixes into trunk.

Location:
trunk
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r2088 r2114  
    8383    bp_core_add_root_component( BP_ACTIVITY_SLUG );
    8484}
    85 add_action( 'plugins_loaded', 'bp_activity_setup_root_component', 2 );
     85add_action( 'plugins_loaded', 'bp_activity_setup_root_component' );
    8686
    8787function bp_activity_setup_nav() {
     
    126126
    127127function bp_activity_screen_friends_activity() {
     128    global $bp;
     129
     130    /* Make sure delete links do not show for friends activity items */
     131    if ( !is_site_admin() )
     132        $bp->is_item_admin = false;
     133
    128134    do_action( 'bp_activity_screen_friends_activity' );
    129135    bp_core_load_template( apply_filters( 'bp_activity_template_friends_activity', 'activity/my-friends' ) );
  • trunk/bp-activity/bp-activity-classes.php

    r2094 r2114  
    242242            $activities = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT id, user_id, content, primary_link, date_recorded, component_name, component_action FROM {$bp->activity->table_name} WHERE user_id IN ({$friend_ids}) $filter_sql ORDER BY date_recorded DESC $pag_sql $max_sql" ) );
    243243
    244         $total_activities = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(user_id) FROM {$bp->activity->table_name} WHERE user_id IN ({$friend_ids}) $filter_sql ORDER BY date_recorded DESC $max_sql" ) );
     244        $total_activities = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$bp->activity->table_name} WHERE user_id IN ({$friend_ids}) $filter_sql ORDER BY date_recorded DESC $max_sql" ) );
    245245
    246246        return array( 'activities' => $activities, 'total' => (int)$total_activities );
  • trunk/bp-activity/bp-activity-templatetags.php

    r2092 r2114  
    314314            $content = bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded, $activities_template->full_name, true, false, false );
    315315
    316         /* Add 'the_content' filter to activity to allow existing plugins to replace text as they would on post text. (extra smilies etc) */
    317         $content = apply_filters( 'the_content', $content );
    318 
    319316        return apply_filters( 'bp_get_activity_content', $content, $activities_template->activity->component_name, $activities_template->activity->component_action );
    320317    }
     
    488485            else
    489486                unset($selected);
    490 
    491             $component_name = attribute_escape( $component_name );
    492487
    493488            $component_name = attribute_escape( $component_name );
     
    559554        global $activities_template;
    560555
    561         return apply_filters( 'bp_get_activity_feed_item_title', md5( $activities_template->activity->date_recorded . '-' . $activities_template->activity->content ) );
     556        return apply_filters( 'bp_get_activity_feed_item_guid', md5( $activities_template->activity->date_recorded . '-' . $activities_template->activity->content ) );
    562557    }
    563558
  • trunk/bp-blogs.php

    r2077 r2114  
    127127
    128128function bp_blogs_setup_root_component() {
    129     /* Register 'groups' as a root component */
     129    /* Register 'blogs' as a root component */
    130130    bp_core_add_root_component( BP_BLOGS_SLUG );
    131131}
     
    352352    if ( !$user_id )
    353353        $user_id = (int)$post->post_author;
     354
    354355    /* This is to stop infinate loops with Donncha's sitewide tags plugin */
    355356    if ( (int)get_site_option( 'tags_blog_id' ) == (int)$blog_id )
  • trunk/bp-blogs/bp-blogs-classes.php

    r2083 r2114  
    6565        global $bp, $wpdb;
    6666
    67         return $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->blogs->table_name} WHERE user_id = %d AND blog_id = %d", $this->user_id, $this->blog_id ) );
     67        return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->blogs->table_name} WHERE user_id = %d AND blog_id = %d", $this->user_id, $this->blog_id ) );
    6868    }
    6969
     
    153153        // If the user is logged in return the blog count including their hidden blogs.
    154154        if ( !bp_is_home() )
    155             return $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(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.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id) );
     155            return $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.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id) );
    156156        else
    157             return $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(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.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id) );
     157            return $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.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id) );
    158158    }
    159159
     
    166166        if ( $limit && $page ) {
    167167            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    168             $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(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 wb.public = 1 AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 AND bm.meta_key = 'last_activity' ORDER BY CONVERT(bm.meta_value, SIGNED) DESC" ) );
     168            $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 wb.public = 1 AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 AND bm.meta_key = 'last_activity' ORDER BY CONVERT(bm.meta_value, SIGNED) DESC" ) );
    169169        }
    170170
     
    184184        if ( $limit && $page ) {
    185185            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    186             $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(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%%' AND wb.public = 1 AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC" ) );
     186            $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%%' AND wb.public = 1 AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC" ) );
    187187        }
    188188
     
    202202        if ( $limit && $page ) {
    203203            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    204             $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(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' OR bm.meta_key = 'description' ) AND bm.meta_value LIKE '%%$filter%%' ) AND wb.public = 1 AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC" ) );
     204            $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' OR bm.meta_key = 'description' ) AND bm.meta_value LIKE '%%$filter%%' ) AND wb.public = 1 AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC" ) );
    205205        }
    206206
     
    218218        if ( $limit && $page ) {
    219219            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    220             $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(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.public = 1 AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY rand()" ) );
     220            $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.public = 1 AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY rand()" ) );
    221221        }
    222222
     
    234234        if ( $limit && $page ) {
    235235            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    236             $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(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 wb.public = 1 AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 AND bm.meta_key = 'last_activity' ORDER BY CONVERT(bm.meta_value, SIGNED) DESC" ) );
     236            $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 wb.public = 1 AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 AND bm.meta_key = 'last_activity' ORDER BY CONVERT(bm.meta_value, SIGNED) DESC" ) );
    237237        }
    238238
     
    250250        if ( $limit && $page ) {
    251251            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    252             $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(wb.blog_id) FROM {$wpdb->base_prefix}blogs wb WHERE wb.public = 1 AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 ORDER BY wb.registered DESC" ) );
     252            $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT wb.blog_id) FROM {$wpdb->base_prefix}blogs wb WHERE wb.public = 1 AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 ORDER BY wb.registered DESC" ) );
    253253        }
    254254
     
    407407        if ( !bp_is_home() ) {
    408408            $post_ids = $wpdb->get_results( $wpdb->prepare( "SELECT p.post_id, p.blog_id FROM {$bp->blogs->table_name_blog_posts} p LEFT JOIN {$wpdb->base_prefix}blogs b ON p.blog_id = b.blog_id WHERE b.public = 1 AND b.deleted = 0 AND b.archived = '0' AND b.spam = 0 AND b.mature = 0 AND p.user_id = %d ORDER BY p.date_created DESC", $user_id) );
    409             $total_post_count = $wpdb->get_var( $wpdb->prepare( "SELECT count(p.post_id) FROM {$bp->blogs->table_name_blog_posts} p LEFT JOIN {$wpdb->base_prefix}blogs b ON p.blog_id = b.blog_id WHERE b.public = 1 AND b.deleted = 0 AND b.archived = '0' AND b.spam = 0 AND b.mature = 0 AND p.user_id = %d", $user_id) );
     409            $total_post_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(p.post_id) FROM {$bp->blogs->table_name_blog_posts} p LEFT JOIN {$wpdb->base_prefix}blogs b ON p.blog_id = b.blog_id WHERE b.public = 1 AND b.deleted = 0 AND b.archived = '0' AND b.spam = 0 AND b.mature = 0 AND p.user_id = %d", $user_id) );
    410410        } else {
    411411            $post_ids = $wpdb->get_results( $wpdb->prepare( "SELECT p.post_id, p.blog_id FROM {$bp->blogs->table_name_blog_posts} p LEFT JOIN {$wpdb->base_prefix}blogs b ON p.blog_id = b.blog_id WHERE b.deleted = 0 AND b.archived = '0' AND b.spam = 0 AND b.mature = 0 AND p.user_id = %d ORDER BY p.date_created DESC", $user_id) );
    412             $total_post_count = $wpdb->get_var( $wpdb->prepare( "SELECT count(p.post_id) FROM {$bp->blogs->table_name_blog_posts} p LEFT JOIN {$wpdb->base_prefix}blogs b ON p.blog_id = b.blog_id WHERE b.deleted = 0 AND b.archived = '0' AND b.spam = 0 AND b.mature = 0 AND p.user_id = %d", $user_id) );
     412
     413            $total_post_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(p.post_id) FROM {$bp->blogs->table_name_blog_posts} p LEFT JOIN {$wpdb->base_prefix}blogs b ON p.blog_id = b.blog_id WHERE b.deleted = 0 AND b.archived = '0' AND b.spam = 0 AND b.mature = 0 AND p.user_id = %d", $user_id) );
    413414        }
    414415
     
    439440            $user_id = $current_user->ID;
    440441
    441         return $wpdb->get_var( $wpdb->prepare( "SELECT count(post_id) FROM {$bp->blogs->table_name_blog_posts} WHERE user_id = %d", $user_id ) );
     442        return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(post_id) FROM {$bp->blogs->table_name_blog_posts} WHERE user_id = %d", $user_id ) );
    442443    }
    443444
     
    463464            return false;
    464465
    465         return $wpdb->get_var( $wpdb->prepare( "SELECT count(post_id) FROM {$bp->blogs->table_name_blog_posts} WHERE blog_id = %d", $blog_id ) );
     466        return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(post_id) FROM {$bp->blogs->table_name_blog_posts} WHERE blog_id = %d", $blog_id ) );
    466467    }
    467468
     
    600601        if ( !bp_is_home() ) {
    601602            $comment_ids = $wpdb->get_results( $wpdb->prepare( "SELECT c.comment_id, c.blog_id FROM {$bp->blogs->table_name_blog_comments} c LEFT JOIN {$wpdb->base_prefix}blogs b ON c.blog_id = b.blog_id WHERE b.public = 1 AND b.deleted = 0 AND b.archived = '0' AND b.spam = 0 AND b.mature = 0 AND c.user_id = %d ORDER BY c.date_created ASC", $user_id) );
    602             $total_comment_count = $wpdb->get_var( $wpdb->prepare( "SELECT count(c.comment_id) FROM {$bp->blogs->table_name_blog_comments} c LEFT JOIN {$wpdb->base_prefix}blogs b ON c.blog_id = b.blog_id WHERE b.public = 1 AND b.deleted = 0 AND b.archived = '0' AND b.spam = 0 AND b.mature = 0 AND c.user_id = %d", $user_id) );
     603            $total_comment_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(c.comment_id) FROM {$bp->blogs->table_name_blog_comments} c LEFT JOIN {$wpdb->base_prefix}blogs b ON c.blog_id = b.blog_id WHERE b.public = 1 AND b.deleted = 0 AND b.archived = '0' AND b.spam = 0 AND b.mature = 0 AND c.user_id = %d", $user_id) );
    603604        } else {
    604605            $comment_ids = $wpdb->get_results( $wpdb->prepare( "SELECT c.comment_id, c.blog_id FROM {$bp->blogs->table_name_blog_comments} c LEFT JOIN {$wpdb->base_prefix}blogs b ON c.blog_id = b.blog_id WHERE b.deleted = 0 AND b.archived = '0' AND b.spam = 0 AND b.mature = 0 AND c.user_id = %d ORDER BY c.date_created ASC", $user_id) );
    605             $total_comment_count = $wpdb->get_var( $wpdb->prepare( "SELECT count(c.comment_id) FROM {$bp->blogs->table_name_blog_comments} c LEFT JOIN {$wpdb->base_prefix}blogs b ON c.blog_id = b.blog_id WHERE b.deleted = 0 AND b.archived = '0' AND b.spam = 0 AND b.mature = 0 AND c.user_id = %d", $user_id) );
    606         }
    607 
    608         for ( $i = 0; $i < count($comment_ids); $i++ ) {
     606
     607            $total_comment_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(c.comment_id) FROM {$bp->blogs->table_name_blog_comments} c LEFT JOIN {$wpdb->base_prefix}blogs b ON c.blog_id = b.blog_id WHERE b.deleted = 0 AND b.archived = '0' AND b.spam = 0 AND b.mature = 0 AND c.user_id = %d", $user_id) );
     608        }
     609
     610        for ( $i = 0; $i < count($comment_ids); $i++ )
    609611            $comments[$i] = BP_Blogs_Comment::fetch_comment_content($comment_ids[$i]);
    610         }
    611612
    612613        return array( 'comments' => $comments, 'count' => $total_comment_count );
     
    632633            $user_id = $current_user->ID;
    633634
    634         return $wpdb->get_var( $wpdb->prepare( "SELECT count(comment_id) FROM {$bp->blogs->table_name_blog_comments} WHERE user_id = %d", $user_id ) );
     635        return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_id) FROM {$bp->blogs->table_name_blog_comments} WHERE user_id = %d", $user_id ) );
    635636    }
    636637
     
    644645            $post_sql = $wpdb->prepare( " AND comment_post_id = %d", $post_id );
    645646
    646         return $wpdb->get_var( $wpdb->prepare( "SELECT count(comment_id) WHERE blog_id = %d{$post_sql}", $blog_id ) );
     647        return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_id) WHERE blog_id = %d{$post_sql}", $blog_id ) );
    647648    }
    648649
  • trunk/bp-core.php

    r2088 r2114  
    15821582
    15831583    /* Make sure account deletion is not disabled */
    1584     if ( ( '' != get_site_option( 'bp-disable-account-deletion' ) || (int) get_site_option( 'bp-disable-account-deletion' ) ) && !is_site_admin() )
     1584    if ( (int)get_site_option( 'bp-disable-account-deletion' ) )
    15851585        return false;
    15861586
     
    18061806        load_textdomain( 'buddypress', $mofile );
    18071807}
    1808 add_action ( 'plugins_loaded', 'bp_core_load_buddypress_textdomain', 9 );
     1808add_action ( 'plugins_loaded', 'bp_core_load_buddypress_textdomain', 5 );
    18091809
    18101810function bp_core_add_ajax_hook() {
  • trunk/bp-core/bp-core-adminbar.php

    r2083 r2114  
    141141
    142142            echo '</a>';
    143 
    144143            echo '<ul>';
    145144
    146145            if ( is_array( $blogs['blogs'] ) && (int)$blogs['count'] ) {
    147 
    148146                $counter = 0;
    149147                foreach ( $blogs['blogs'] as $blog ) {
  • trunk/bp-core/bp-core-avatars.php

    r2088 r2114  
    117117
    118118    /* If no avatars have been uploaded for this item, display a gravatar */
    119     if ( !file_exists( $avatar_url ) && !$no_grav ) {
     119    if ( !$no_grav ) {
    120120        if ( empty( $bp->grav_default->{$object} ) )
    121121            $default_grav = 'wavatar';
     
    140140        return apply_filters( 'bp_core_fetch_avatar', "<img src='{$gravatar}' alt='{$alt}' id='{$css_id}' class='{$class}'{$html_width}{$html_height} />", $params );
    141141
    142     } else if ( !file_exists( $avatar_url ) && $no_grav )
    143         return false;
     142    } else {
     143        return false;
     144    }
    144145}
    145146
  • trunk/bp-core/bp-core-classes.php

    r2088 r2114  
    8888            $this->total_friends = BP_Friends_Friendship::total_friend_count( $this->id );
    8989
    90         if ( function_exists('groups_install') )
     90        if ( function_exists('groups_install') ) {
    9191            $this->total_groups = BP_Groups_Member::total_group_count( $this->id );
     92
     93            if ( $this->total_groups ) {
     94                if ( 1 == $this->total_groups )
     95                    $this->total_groups .= ' ' . __( 'group', 'buddypress' );
     96                else
     97                    $this->total_groups .= ' ' . __( 'groups', 'buddypress' );
     98            }
     99        }
    92100    }
    93101
     
    104112            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    105113
    106         $total_users_sql = apply_filters( 'bp_core_newest_users_count_sql', "SELECT DISTINCT count(ID) FROM " . CUSTOM_USER_TABLE . " WHERE spam = 0 AND deleted = 0 AND user_status = 0 ORDER BY user_registered DESC" );
     114        $total_users_sql = apply_filters( 'bp_core_newest_users_count_sql', "SELECT COUNT(DISTINCT ID) FROM " . CUSTOM_USER_TABLE . " WHERE spam = 0 AND deleted = 0 AND user_status = 0 ORDER BY user_registered DESC" );
    107115        $paged_users_sql = apply_filters( 'bp_core_newest_users_sql', "SELECT DISTINCT ID as user_id, DATE_ADD( user_registered, INTERVAL " . get_option('gmt_offset') . " HOUR ) as user_registered FROM " . CUSTOM_USER_TABLE . " WHERE spam = 0 AND deleted = 0 AND user_status = 0 ORDER BY user_registered DESC{$pag_sql}", $pag_sql );
    108116
     
    119127            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    120128
    121         $total_users_sql = apply_filters( 'bp_core_active_users_count_sql', "SELECT DISTINCT count(um.user_id) FROM " . CUSTOM_USER_META_TABLE . " um LEFT JOIN " . CUSTOM_USER_TABLE . " u ON u.ID = um.user_id WHERE um.meta_key = 'last_activity' AND u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 ORDER BY FROM_UNIXTIME(um.meta_value) DESC" );
     129        $total_users_sql = apply_filters( 'bp_core_active_users_count_sql', "SELECT COUNT(DISTINCT um.user_id) FROM " . CUSTOM_USER_META_TABLE . " um LEFT JOIN " . CUSTOM_USER_TABLE . " u ON u.ID = um.user_id WHERE um.meta_key = 'last_activity' AND u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 ORDER BY FROM_UNIXTIME(um.meta_value) DESC" );
    122130        $paged_users_sql = apply_filters( 'bp_core_active_users_sql', "SELECT DISTINCT user_id FROM " . CUSTOM_USER_META_TABLE . " um LEFT JOIN " . CUSTOM_USER_TABLE . " u ON u.ID = um.user_id WHERE um.meta_key = 'last_activity' AND u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 ORDER BY FROM_UNIXTIME(um.meta_value) DESC{$pag_sql}", $pag_sql );
    123131
     
    137145            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    138146
    139         $total_users_sql = apply_filters( 'bp_core_popular_users_count_sql', "SELECT DISTINCT count(um.user_id) FROM " . CUSTOM_USER_META_TABLE . " um LEFT JOIN " . CUSTOM_USER_TABLE . " u ON u.ID = um.user_id WHERE um.meta_key = 'total_friend_count' AND u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 ORDER BY CONVERT(um.meta_value, SIGNED) DESC" );
     147        $total_users_sql = apply_filters( 'bp_core_popular_users_count_sql', "SELECT COUNT(DISTINCT um.user_id) FROM " . CUSTOM_USER_META_TABLE . " um LEFT JOIN " . CUSTOM_USER_TABLE . " u ON u.ID = um.user_id WHERE um.meta_key = 'total_friend_count' AND u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 ORDER BY CONVERT(um.meta_value, SIGNED) DESC" );
    140148        $paged_users_sql = apply_filters( 'bp_core_popular_users_sql', "SELECT DISTINCT um.user_id FROM " . CUSTOM_USER_META_TABLE . " um LEFT JOIN " . CUSTOM_USER_TABLE . " u ON u.ID = um.user_id WHERE um.meta_key = 'total_friend_count' AND u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 ORDER BY CONVERT(um.meta_value, SIGNED) DESC{$pag_sql}", $pag_sql );
    141149
     
    152160            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    153161
    154         $total_users_sql = apply_filters( 'bp_core_random_users_count_sql', $wpdb->prepare( "SELECT DISTINCT count(um.user_id) FROM " . CUSTOM_USER_META_TABLE . " um LEFT JOIN " . CUSTOM_USER_TABLE . " u ON u.ID = um.user_id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND u.ID != %d ORDER BY RAND() DESC", $bp->loggedin_user->id ) );
     162        $total_users_sql = apply_filters( 'bp_core_random_users_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT um.user_id) FROM " . CUSTOM_USER_META_TABLE . " um LEFT JOIN " . CUSTOM_USER_TABLE . " u ON u.ID = um.user_id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND u.ID != %d ORDER BY RAND() DESC", $bp->loggedin_user->id ) );
    155163        $paged_users_sql = apply_filters( 'bp_core_random_users_sql', $wpdb->prepare( "SELECT DISTINCT um.user_id FROM " . CUSTOM_USER_META_TABLE . " um LEFT JOIN " . CUSTOM_USER_TABLE . " u ON u.ID = um.user_id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND u.ID != %d ORDER BY RAND(){$pag_sql}", $bp->loggedin_user->id ), $pag_sql );
    156164
     
    167175            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    168176
    169         $total_users_sql = apply_filters( 'bp_core_online_users_count_sql', "SELECT DISTINCT count(um.user_id) FROM " . CUSTOM_USER_META_TABLE . " um LEFT JOIN " . CUSTOM_USER_TABLE . " u ON u.ID = um.user_id WHERE um.meta_key = 'last_activity' AND u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND DATE_ADD( FROM_UNIXTIME(um.meta_value), INTERVAL 5 MINUTE ) >= NOW() ORDER BY FROM_UNIXTIME(um.meta_value) DESC" );
     177        $total_users_sql = apply_filters( 'bp_core_online_users_count_sql', "SELECT COUNT(DISTINCT um.user_id) FROM " . CUSTOM_USER_META_TABLE . " um LEFT JOIN " . CUSTOM_USER_TABLE . " u ON u.ID = um.user_id WHERE um.meta_key = 'last_activity' AND u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND DATE_ADD( FROM_UNIXTIME(um.meta_value), INTERVAL 5 MINUTE ) >= NOW() ORDER BY FROM_UNIXTIME(um.meta_value) DESC" );
    170178        $paged_users_sql = apply_filters( 'bp_core_online_users_sql', "SELECT DISTINCT um.user_id FROM " . CUSTOM_USER_META_TABLE . " um LEFT JOIN " . CUSTOM_USER_TABLE . " u ON u.ID = um.user_id WHERE um.meta_key = 'last_activity' AND u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND DATE_ADD( FROM_UNIXTIME(um.meta_value), INTERVAL 5 MINUTE ) >= NOW() ORDER BY FROM_UNIXTIME(um.meta_value) DESC{$pag_sql}", $pag_sql );
    171179
     
    185193            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    186194
    187         $total_users_sql = apply_filters( 'bp_core_alphabetical_users_count_sql', $wpdb->prepare( "SELECT DISTINCT count(u.ID) FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pf.name = %s ORDER BY pd.value ASC", BP_XPROFILE_FULLNAME_FIELD_NAME ) );
    188         $paged_users_sql = apply_filters( 'bp_core_alphabetical_users_sql', $wpdb->prepare( "SELECT DISTINCT u.ID as user_id FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pf.name = %s ORDER BY pd.value ASC{$pag_sql}", BP_XPROFILE_FULLNAME_FIELD_NAME ), $pag_sql );
     195        $total_users_sql = apply_filters( 'bp_core_search_users_count_sql', "SELECT DISTINCT u.ID as user_id FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC", $search_terms );
     196        $paged_users_sql = apply_filters( 'bp_core_search_users_sql', "SELECT DISTINCT u.ID as user_id FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC{$pag_sql}", $search_terms, $pag_sql );
    189197
    190198        $total_users = $wpdb->get_var( $total_users_sql );
     
    208216        $letter = like_escape( $wpdb->escape( $letter ) );
    209217
    210         $total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT DISTINCT count(u.ID) FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pf.name = %s AND pd.value LIKE '$letter%%' ORDER BY pd.value ASC", BP_XPROFILE_FULLNAME_FIELD_NAME ), $letter );
     218        $total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pf.name = %s AND pd.value LIKE '$letter%%' ORDER BY pd.value ASC", BP_XPROFILE_FULLNAME_FIELD_NAME ), $letter );
    211219        $paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql', $wpdb->prepare( "SELECT DISTINCT u.ID as user_id FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pf.name = %s AND pd.value LIKE '$letter%%' ORDER BY pd.value ASC{$pag_sql}", BP_XPROFILE_FULLNAME_FIELD_NAME ), $letter, $pag_sql );
    212220
     
    228236        $search_terms = like_escape( $wpdb->escape( $search_terms ) );
    229237
    230         $total_users_sql = apply_filters( 'bp_core_search_users_count_sql', "SELECT DISTINCT count(u.ID) as user_id FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC", $search_terms );
     238        $total_users_sql = apply_filters( 'bp_core_search_users_count_sql', "SELECT COUNT(DISTINCT u.ID) as user_id FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC", $search_terms );
    231239        $paged_users_sql = apply_filters( 'bp_core_search_users_sql', "SELECT DISTINCT u.ID as user_id FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC{$pag_sql}", $search_terms, $pag_sql );
    232240
     
    300308        global $wpdb, $bp;
    301309
    302         return $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) );
     310        return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) );
    303311    }
    304312
  • trunk/bp-core/bp-core-settings.php

    r2077 r2114  
    162162            bp_core_redirect( site_url() );
    163163    }
     164
    164165    add_action( 'bp_template_title', 'bp_core_screen_delete_account_title' );
    165166    add_action( 'bp_template_content', 'bp_core_screen_delete_account_content' );
  • trunk/bp-core/bp-core-templatetags.php

    r2088 r2114  
    10571057    echo apply_filters( 'bp_the_site_member_avatar', bp_get_the_site_member_avatar( $args ) );
    10581058}
     1059
    10591060    function bp_get_the_site_member_avatar( $args = '' ) {
    10601061        global $bp, $site_members_template;
     
    16321633    echo bp_get_the_body_class();
    16331634}
    1634     function bp_get_the_body_class( $wp_classes, $custom_classes ) {
     1635    function bp_get_the_body_class( $wp_classes, $custom_classes = false ) {
    16351636        global $bp;
    16361637
  • trunk/bp-core/deprecated/bp-core-deprecated.php

    r2088 r2114  
    332332    $blog_title = $filtered_results['blog_title'];
    333333    $errors = $filtered_results['errors'];
    334    
     334
    335335    if ( empty($blogname) )
    336336        $blogname = $user_name;
     
    567567    return false;
    568568}
    569 add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 );
    570569
    571570function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) {
    572571    global $current_site;
    573572
     573    if( !apply_filters('wpmu_signup_user_notification', $user, $user_email, $key, $meta) )
     574        return false;
     575
    574576    // Send email with activation link.
    575577    $admin_email = get_site_option( "admin_email" );
    576578
    577     if ( empty( $admin_email ) )
     579    if ( $admin_email == '' )
    578580        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    579581
    580     $from_name = ( '' == get_site_option( "site_name" ) ) ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) );
     582    $from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) );
    581583    $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    582     $message = apply_filters( 'wpmu_signup_user_notification_email', sprintf( __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n", 'buddypress' ), clean_url( bp_activation_page( false ) . "?key=$key" ) ) );
    583     $subject = apply_filters( 'wpmu_signup_user_notification_subject', sprintf( __(  'Activate %s', 'buddypress' ), $user ) );
    584 
    585     wp_mail( $user_email, $subject, $message, $message_headers );
     584    $message = sprintf( apply_filters( 'wpmu_signup_user_notification_email', __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n" ) ), site_url( "wp-activate.php?key=$key" ), $key );
     585
     586    // TODO: Don't hard code activation link.
     587    $subject = sprintf(__( apply_filters( 'wpmu_signup_user_notification_subject', 'Activate %s' )), $user);
     588    wp_mail($user_email, $subject, $message, $message_headers);
    586589
    587590    // Return false to stop the original WPMU function from continuing
    588591    return false;
    589592}
    590 add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );
     593
     594function bp_core_load_deprecated_signup_email_functions() {
     595    /* If we are using a BuddyPress 1.1+ theme ignore this. */
     596    if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) )
     597        return false;
     598
     599    add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );
     600    add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 );
     601}
     602add_action( 'plugins_loaded', 'bp_core_load_deprecated_signup_email_functions' );
    591603
    592604/*** END DEPRECATED SIGNUP FUNCTIONS **********/
  • trunk/bp-forums/bp-forums-admin.php

    r2077 r2114  
    6363                switch ( $result ) {
    6464                    case 1:
    65                         _e( 'All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.' );
     65                        _e( 'All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.', 'buddypress' );
    6666                        break;
    6767                    default:
  • trunk/bp-friends/bp-friends-classes.php

    r2077 r2114  
    133133           This function will recalculate, update and return. */
    134134
    135         $count = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d OR friend_user_id = %d) AND is_confirmed = 1", $user_id, $user_id ) );
     135        $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d OR friend_user_id = %d) AND is_confirmed = 1", $user_id, $user_id ) );
    136136
    137137        if ( !$count )
     
    167167        if ( function_exists('xprofile_install') ) {
    168168            $sql = $wpdb->prepare( "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ($fids) AND value LIKE '$filter%%' {$pag_sql}" );
    169             $total_sql = $wpdb->prepare( "SELECT DISTINCT count(user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ($fids) AND value LIKE '$filter%%'" );
     169            $total_sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ($fids) AND value LIKE '$filter%%'" );
    170170        } else {
    171171            $sql = $wpdb->prepare( "SELECT DISTINCT user_id FROM " . CUSTOM_USER_META_TABLE . " WHERE user_id IN ($fids) AND meta_key = 'nickname' AND meta_value LIKE '$filter%%' {$pag_sql}" );
    172             $total_sql = $wpdb->prepare( "SELECT DISTINCT count(user_id) FROM " . CUSTOM_USER_META_TABLE . " WHERE user_id IN ($fids) AND meta_key = 'nickname' AND meta_value LIKE '$filter%%'" );
     172            $total_sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM " . CUSTOM_USER_META_TABLE . " WHERE user_id IN ($fids) AND meta_key = 'nickname' AND meta_value LIKE '$filter%%'" );
    173173        }
    174174
     
    255255        // filter the user_ids based on the search criteria.
    256256        if ( function_exists('xprofile_install') ) {
    257             $sql = $wpdb->prepare( "SELECT DISTINCT count(d.user_id) FROM {$bp->profile->table_name_data} d, $users_table u WHERE d.user_id = u.id AND d.value LIKE '$filter%%'" );
    258         } else {
    259             $sql = $wpdb->prepare( "SELECT DISTINCT count(user_id) FROM $usermeta_table WHERE meta_value LIKE '$filter%%'" );
     257            $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%%'" );
     258        } else {
     259            $sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM $usermeta_table WHERE meta_value LIKE '$filter%%'" );
    260260        }
    261261
  • trunk/bp-groups.php

    r2088 r2114  
    821821
    822822    if ( $bp->is_single_item ) {
    823         if ( 'post' == $wire_action && groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
     823        if ( 'post' == $wire_action && ( is_site_admin() || groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) ) {
    824824            /* Check the nonce first. */
    825825            if ( !check_admin_referer( 'bp_wire_post' ) )
     
    836836                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/' . $bp->wire->slug );
    837837
    838         } else if ( 'delete' == $wire_action && groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
     838        } else if ( 'delete' == $wire_action && ( is_site_admin() || groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) ) {
    839839            $wire_message_id = $bp->action_variables[1];
    840840
     
    912912    if ( $bp->is_single_item ) {
    913913        if ( isset($bp->action_variables) && 'yes' == $bp->action_variables[0] ) {
    914 
    915914            // Check if the user is the group admin first.
    916             if ( groups_is_user_admin( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
    917                 bp_core_add_message(  __('As the only group administrator, you cannot leave this group.', 'buddypress'), 'error' );
    918                 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
     915            if ( count( groups_get_group_admins( $bp->groups->current_group->id ) ) < 2 ) {
     916                if ( groups_is_user_admin( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
     917                    bp_core_add_message(  __('As the only group administrator, you cannot leave this group.', 'buddypress'), 'error' );
     918                    bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
     919                }
    919920            }
    920921
     
    18101811        $user_id = $bp->loggedin_user->id;
    18111812
    1812     // Admins cannot leave a group, that is until promotion to admin support is implemented.
    1813     if ( groups_is_user_admin( $user_id, $group_id ) )
    1814         return false;
    1815 
    18161813    // This is exactly the same as deleting and invite, just is_confirmed = 1 NOT 0.
    18171814    if ( !groups_uninvite_user( $user_id, $group_id, true ) )
     
    18341831    if ( groups_check_user_has_invite( $user_id, $group_id ) )
    18351832        groups_delete_invite( $user_id, $group_id );
     1833
     1834    if ( !$bp->groups->current_group )
     1835        $bp->groups->current_group = new BP_Groups_Group( $group_id, false, false );
    18361836
    18371837    $new_member = new BP_Groups_Member;
     
    18521852        'primary_link' => apply_filters( 'groups_activity_joined_group_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ),
    18531853        'component_action' => 'joined_group',
    1854         'item_id' => $bp->groups->current_group->id
     1854        'item_id' => $group_id
    18551855    ) );
    18561856
  • trunk/bp-groups/bp-groups-classes.php

    r2088 r2114  
    261261
    262262        $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}" ) );
    263         $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})" ) );
     263        $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})" ) );
    264264
    265265        return array( 'groups' => $paged_groups, 'total' => $total_groups );
     
    284284
    285285        $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%%' ) {$hidden_sql} {$order_sql} {$pag_sql}" ) );
    286         $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '%%$filter%%' OR description LIKE '%%$filter%%' ) {$hidden_sq}" ) );
     286        $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '%%$filter%%' OR description LIKE '%%$filter%%' ) {$hidden_sq}" ) );
    287287
    288288        return array( 'groups' => $paged_groups, 'total' => $total_groups );
     
    304304        global $wpdb, $bp;
    305305
    306         $members = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d", $group_id ) );
     306        $members = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d", $group_id ) );
    307307
    308308        if ( !$members )
     
    315315        global $wpdb, $bp;
    316316
    317         return $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0", $group_id ) );
     317        return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0", $group_id ) );
    318318    }
    319319
     
    400400
    401401        $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT gm.group_id FROM {$bbdb->forums} AS f, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = f.forum_id) AND g.status = 'public' ORDER BY f.topics DESC {$pag_sql}" ) );
    402         $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT COUNT(gm.group_id) FROM {$bbdb->forums} AS f, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = f.forum_id) AND g.status = 'public' ORDER BY f.topics DESC" ) );
     402        $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT gm.group_id) FROM {$bbdb->forums} AS f, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = f.forum_id) AND g.status = 'public' ORDER BY f.topics DESC" ) );
    403403
    404404        return array( 'groups' => $paged_groups, 'total' => $total_groups );
     
    413413
    414414        $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT gm.group_id FROM {$bbdb->forums} AS f, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = f.forum_id) AND g.status = 'public' ORDER BY f.posts DESC {$pag_sql}" ) );
    415         $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT COUNT(gm.group_id) FROM {$bbdb->forums} AS f, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = f.forum_id) AND g.status = 'public' ORDER BY f.posts DESC" ) );
     415        $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT gm.group_id) FROM {$bbdb->forums} AS f, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = f.forum_id) AND g.status = 'public' ORDER BY f.posts DESC" ) );
    416416
    417417        return array( 'groups' => $paged_groups, 'total' => $total_groups );
     
    423423
    424424        if ( $only_public )
    425             $public_sql = $wpdb->prepare( " WHERE g.status = 'public'" );
     425            $public_sql = $wpdb->prepare( " AND g.status = 'public'" );
    426426
    427427        if ( !is_site_admin() )
     
    438438            switch ( $sort_by ) {
    439439                default:
    440                     $sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} g {$public_sql} {$hidden_sql} {$order_sql} {$pag_sql}" );
     440                    $sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} g WHERE 1=1 {$public_sql} {$hidden_sql} {$order_sql} {$pag_sql}" );
    441441                    break;
    442442                case 'members':
     
    467467        if ( $limit && $page ) {
    468468            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    469             $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->groups->table_name} WHERE name LIKE '$letter%%' {$hidden_sql} ORDER BY name ASC" ) );
     469            $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE name LIKE '$letter%%' {$hidden_sql} ORDER BY name ASC" ) );
    470470        }
    471471
     
    505505        $extra_sql = apply_filters( 'groups_total_public_forum_topic_count', $bp->groups->filter_sql, $type );
    506506
    507         return $wpdb->get_var( "SELECT count(t.topic_id) FROM {$bbdb->topics} AS t, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id) AND g.status = 'public' AND t.topic_status = '0' AND t.topic_sticky != '2' {$extra_sql} " );
     507        return $wpdb->get_var( "SELECT COUNT(t.topic_id) FROM {$bbdb->topics} AS t, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id) AND g.status = 'public' AND t.topic_status = '0' AND t.topic_sticky != '2' {$extra_sql} " );
    508508    }
    509509}
     
    681681        if ( bp_is_home() ) {
    682682            $group_sql = $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND inviter_id = 0 AND is_banned = 0{$pag_sql}", $user_id );
    683             $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(group_id) FROM {$bp->groups->table_name_members} WHERE user_id = %d AND inviter_id = 0 AND is_banned = 0", $user_id ) );
     683            $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT group_id) FROM {$bp->groups->table_name_members} WHERE user_id = %d AND inviter_id = 0 AND is_banned = 0", $user_id ) );
    684684        } else {
    685685            $group_sql = $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0{$pag_sql}", $user_id );
    686             $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0", $user_id ) );
     686            $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0", $user_id ) );
    687687        }
    688688
     
    707707
    708708        $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}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY m.date_modified DESC {$pag_sql}", $user_id ) );
    709         $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_confirmed = 1 ORDER BY m.date_modified DESC", $user_id ) );
     709        $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_confirmed = 1 ORDER BY m.date_modified DESC", $user_id ) );
    710710
    711711        return array( 'groups' => $paged_groups, 'total' => $total_groups );
     
    727727
    728728        $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}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY CONVERT( total_member_count, SIGNED ) DESC {$pag_sql}", $user_id ) );
    729         $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM {$bp->groups->table_name_members} m INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_confirmed = 1 LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id AND gm.meta_key = 'total_member_count' ORDER BY CONVERT( gm.meta_value, SIGNED ) DESC", $user_id ) );
     729        $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m INNER JOIN {$bp->groups->table_name} g ON m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_confirmed = 1 LEFT JOIN {$bp->groups->table_name_groupmeta} gm ON m.group_id = gm.group_id AND gm.meta_key = 'total_member_count' ORDER BY CONVERT( gm.meta_value, SIGNED ) DESC", $user_id ) );
    730730
    731731        return array( 'groups' => $paged_groups, 'total' => $total_groups );
     
    747747
    748748        $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}{$filter_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 ) );
    749         $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(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}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY gm.meta_value DESC", $user_id ) );
     749        $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}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY gm.meta_value DESC", $user_id ) );
    750750
    751751        return array( 'groups' => $paged_groups, 'total' => $total_groups );
     
    767767
    768768        $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}{$filter_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 ) );
    769         $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY g.name ASC", $user_id ) );
     769        $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY g.name ASC", $user_id ) );
    770770
    771771        return array( 'groups' => $paged_groups, 'total' => $total_groups );
     
    787787
    788788        $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}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_admin = 1 ORDER BY m.date_modified ASC {$pag_sql}", $user_id ) );
    789         $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_admin = 1 ORDER BY date_modified ASC", $user_id ) );
     789        $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_admin = 1 ORDER BY date_modified ASC", $user_id ) );
    790790
    791791        return array( 'groups' => $paged_groups, 'total' => $total_groups );
     
    807807
    808808        $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}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_mod = 1 ORDER BY m.date_modified ASC {$pag_sql}", $user_id ) );
    809         $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_mod = 1 ORDER BY date_modified ASC", $user_id ) );
     809        $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id{$hidden_sql}{$filter_sql} AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_mod = 1 ORDER BY date_modified ASC", $user_id ) );
    810810
    811811        return array( 'groups' => $paged_groups, 'total' => $total_groups );
     
    819819
    820820        if ( bp_is_home() ) {
    821             return $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(group_id) FROM {$bp->groups->table_name_members} WHERE user_id = %d AND inviter_id = 0 AND is_banned = 0", $user_id ) );
     821            return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT group_id) FROM {$bp->groups->table_name_members} WHERE user_id = %d AND inviter_id = 0 AND is_banned = 0", $user_id ) );
    822822        } else {
    823             return $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0", $user_id ) );
     823            return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0", $user_id ) );
    824824        }
    825825    }
     
    945945            $total_member_count = count($members);
    946946        else
    947             $total_member_count = $wpdb->get_var( $wpdb->prepare( "SELECT count(user_id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_sql}", $group_id ) );
     947            $total_member_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(user_id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_sql}", $group_id ) );
    948948
    949949        return array( 'members' => $members, 'count' => $total_member_count );
  • trunk/bp-messages.php

    r2077 r2114  
    104104        messages_install();
    105105}
    106 add_action( 'admin_menu', 'messages_check_installed', 2 );
     106add_action( 'admin_menu', 'messages_check_installed' );
    107107
    108108function messages_setup_nav() {
  • trunk/bp-messages/bp-messages-classes.php

    r2077 r2114  
    235235            $type_sql = $wpdb->prepare( " AND unread_count = 0 " );
    236236
    237         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 ) );
     237        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 ) );
    238238    }
    239239
     
    557557        global $wpdb, $bp;
    558558
    559         $notice_count = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM " . $bp->messages->table_name_notices ) );
     559        $notice_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices ) );
     560
    560561        return $notice_count;
    561562    }
  • trunk/bp-themes/bp-default/_inc/css/screen.css

    r2069 r2114  
    13241324    -webkit-border-radius: 5px;
    13251325}
    1326     .activity-list li blockquote p { margin: 0; }
     1326    .activity-list li blockquote p {
     1327        margin: 0;
     1328        overflow: hidden;
     1329    }
    13271330
    13281331.activity-list li span.time-since {
     
    14051408.widget_bp_core_recently_active_widget div.item-avatar {
    14061409    display: inline;
    1407     margin: 0 5px 5x 0;
     1410    margin: 0 5px 5px 0;
    14081411}
    14091412
     
    21442147
    21452148div#user-status {
    2146     margin: 0 0 20px 0;
     2149    margin: 0;
     2150    padding-bottom: 20px;
    21472151    font: normal 1.3em Georgia, times, serif;
    21482152}
  • trunk/bp-themes/bp-sn-parent/_inc/css/fonts/12px.css

    r1655 r2114  
    5454    font-style: normal;
    5555    font-weight: normal;
    56     margin: 0 0 18px 0;
     56    margin: 0;
     57    padding-bottom: 10px;
    5758}
    5859h1 {
  • trunk/bp-themes/bp-sn-parent/_inc/js/ajax.js

    r2055 r2114  
    55
    66    j("div#members-directory-page ul#letter-list li a").livequery('click',
    7         function() { 
    8             j('.ajax-loader').toggle();
    9 
    10             j("div#members-list-options a.selected").removeClass("selected"); 
    11             j("#letter-list li a.selected").removeClass("selected"); 
     7        function() {
     8            j('.ajax-loader').toggle();
     9
     10            j("div#members-list-options a.selected").removeClass("selected");
     11            j("#letter-list li a.selected").removeClass("selected");
    1212
    1313            j(this).addClass('selected');
    1414            j("input#members_search").val('');
    15            
     15
    1616            var letter = j(this).attr('id')
    1717            letter = letter.split('-');
    18            
     18
    1919            var page = ( j('input#members-page-num').val() ) ? j('input#members-page-num').val() : 1;
    2020
     
    2929            {
    3030                response = response.substr(0, response.length-1);
    31                
    32                 j("#member-dir-list").fadeOut(200, 
     31
     32                j("#member-dir-list").fadeOut(200,
    3333                    function() {
    3434                        j('.ajax-loader').toggle();
     
    3838                );
    3939            });
    40        
    41             return false;
    42         }
    43     );
    44    
    45     j("form#search-members-form").submit( function() {
    46             j('.ajax-loader').toggle();
     40
     41            return false;
     42        }
     43    );
     44
     45    j("form#search-members-form").submit( function() {
     46            j('.ajax-loader').toggle();
     47
     48            j("div#members-list-options a.selected").removeClass("selected");
     49            j("#letter-list li a.selected").removeClass("selected");
    4750
    4851            var page = ( j('input#members-page-num').val() ) ? j('input#members-page-num').val() : 1;
     
    5659            },
    5760            function(response)
    58             {   
    59                 response = response.substr(0, response.length-1);
    60                
    61                 j("#member-dir-list").fadeOut(200, 
     61            {
     62                response = response.substr(0, response.length-1);
     63
     64                j("#member-dir-list").fadeOut(200,
    6265                    function() {
    6366                        j('.ajax-loader').toggle();
     
    6770                );
    6871            });
    69        
    70             return false;
    71         }
    72     );
    73    
     72
     73            return false;
     74        }
     75    );
     76
    7477    j("div#member-dir-pag a").livequery('click',
    75         function() { 
     78        function() {
    7679            j('.ajax-loader').toggle();
    7780
    7881            var page = j(this).attr('href');
    7982            page = page.split('upage=');
    80            
     83
    8184            if ( undefined === j("input#selected_letter").val() )
    8285                var letter = '';
    8386            else
    8487                var letter = j("input#selected_letter").val();
    85                        
     88
    8689            if ( undefined === j("input#search_terms").val() )
    8790                var search_terms = '';
    8891            else
    8992                var search_terms = j("input#search_terms").val();
    90            
     93
    9194            j.post( ajaxurl, {
    9295                action: 'directory_members',
     
    9598                'upage': page[1],
    9699                '_wpnonce': j("input#_wpnonce-member-filter").val(),
    97                
     100
    98101                'letter': letter,
    99102                's': search_terms
    100103            },
    101104            function(response)
    102             {   
    103                 response = response.substr(0, response.length-1);
    104                
    105                 j("#member-dir-list").fadeOut(200, 
     105            {
     106                response = response.substr(0, response.length-1);
     107
     108                j("#member-dir-list").fadeOut(200,
    106109                    function() {
    107110                        j('.ajax-loader').toggle();
     
    111114                );
    112115            });
    113            
    114             return false;
    115         }
    116     );
    117    
     116
     117            return false;
     118        }
     119    );
     120
    118121    j("div.friendship-button a").livequery('click',
    119122        function() {
     
    122125            fid = fid.split('-');
    123126            fid = fid[1];
    124        
     127
    125128            var nonce = j(this).attr('href');
    126129            nonce = nonce.split('?_wpnonce=');
     
    142145                var action = thelink.attr('rel');
    143146                var parentdiv = thelink.parent();
    144            
     147
    145148                if ( action == 'add' ) {
    146                     j(parentdiv).fadeOut(200, 
     149                    j(parentdiv).fadeOut(200,
    147150                        function() {
    148151                            parentdiv.removeClass('add_friend');
     
    154157
    155158                } else if ( action == 'remove' ) {
    156                     j(parentdiv).fadeOut(200, 
     159                    j(parentdiv).fadeOut(200,
    157160                        function() {
    158161                            parentdiv.removeClass('remove_friend');
     
    161164                            parentdiv.fadeIn(200).html(response);
    162165                        }
    163                     );             
     166                    );
    164167                }
    165168            });
     
    169172
    170173    j("div#wire-pagination a").livequery('click',
    171         function() { 
     174        function() {
    172175            j('.ajax-loader').toggle();
    173176
     
    183186            },
    184187            function(response)
    185             {   
     188            {
    186189                j('.ajax-loader').toggle();
    187            
    188                 response = response.substr(0, response.length-1);
    189 
    190                 j("#wire-post-list-content").fadeOut(200, 
     190
     191                response = response.substr(0, response.length-1);
     192
     193                j("#wire-post-list-content").fadeOut(200,
    191194                    function() {
    192195                        j("#wire-post-list-content").html(response);
     
    197200                return false;
    198201            });
    199        
     202
    200203            return false;
    201204        }
     
    203206
    204207    j(".friends div#pag a").livequery('click',
    205         function() { 
     208        function() {
    206209            j('.ajax-loader').toggle();
    207210
    208211            var frpage = j(this).attr('href');
    209212            frpage = frpage.split('=');
    210            
     213
    211214            j.post( ajaxurl, {
    212215                action: 'my_friends_search',
     
    218221            },
    219222            function(response)
    220             {   
     223            {
    221224                response = response.substr( 0, response.length - 1 );
    222225
    223                 j("div#friends-loop").fadeOut(200, 
     226                j("div#friends-loop").fadeOut(200,
    224227                    function() {
    225228                        j('.ajax-loader').toggle();
     
    229232                );
    230233            });
    231            
    232             return false;
    233         }
    234     );
    235    
     234
     235            return false;
     236        }
     237    );
     238
    236239    j("input#friend-search-box").keyup(
    237240        function(e) {
    238241            if ( e.which == 13 ) {
    239242                j('.ajax-loader').toggle();
    240                
     243
    241244                j.post( ajaxurl, {
    242245                    action: 'my_friends_search',
    243246                    'cookie': encodeURIComponent(document.cookie),
    244247                    '_wpnonce': j("input#_wpnonce_friend_search").val(),
    245    
     248
    246249                    'friend-search-box': j("#friend-search-box").val()
    247250                },
    248251                function(response)
    249                 {   
     252                {
    250253                    response = response.substr( 0, response.length - 1 );
    251    
    252                     j("div#friends-loop").fadeOut(200, 
     254
     255                    j("div#friends-loop").fadeOut(200,
    253256                        function() {
    254257                            j('.ajax-loader').toggle();
     
    258261                    );
    259262                });
    260                
     263
    261264                return false;
    262265            }
     
    265268
    266269    j("div#groups-directory-page ul#letter-list li a").livequery('click',
    267         function() { 
    268             j('.ajax-loader').toggle();
    269 
    270             j("div#groups-list-options a.selected").removeClass("selected"); 
    271             j("#letter-list li a.selected").removeClass("selected"); 
     270        function() {
     271            j('.ajax-loader').toggle();
     272
     273            j("div#groups-list-options a.selected").removeClass("selected");
     274            j("#letter-list li a.selected").removeClass("selected");
    272275
    273276            j(this).addClass('selected');
     
    285288            },
    286289            function(response)
    287             {   
    288                 response = response.substr(0, response.length-1);
    289                 j("#group-dir-list").fadeOut(200, 
     290            {
     291                response = response.substr(0, response.length-1);
     292                j("#group-dir-list").fadeOut(200,
    290293                    function() {
    291294                        j('.ajax-loader').toggle();
     
    295298                );
    296299            });
    297        
    298             return false;
    299         }
    300     );
    301    
    302     j("form#search-groups-form").submit( function() {
    303             j('.ajax-loader').toggle();
     300
     301            return false;
     302        }
     303    );
     304
     305    j("form#search-groups-form").submit( function() {
     306            j('.ajax-loader').toggle();
     307
     308            j("div#groups-list-options a.selected").removeClass("selected");
     309            j("#letter-list li a.selected").removeClass("selected");
    304310
    305311            j.post( ajaxurl, {
     
    311317            },
    312318            function(response)
    313             {   
    314                 response = response.substr(0, response.length-1);
    315                 j("#group-dir-list").fadeOut(200, 
     319            {
     320                response = response.substr(0, response.length-1);
     321                j("#group-dir-list").fadeOut(200,
    316322                    function() {
    317323                        j('.ajax-loader').toggle();
     
    321327                );
    322328            });
    323        
    324             return false;
    325         }
    326     );
    327    
     329
     330            return false;
     331        }
     332    );
     333
    328334    j("div#group-dir-pag a").livequery('click',
    329         function() { 
     335        function() {
    330336            j('.ajax-loader').toggle();
    331337
    332338            var page = j(this).attr('href');
    333339            page = page.split('gpage=');
    334            
     340
    335341            if ( undefined === j("input#selected_letter").val() )
    336342                var letter = '';
    337343            else
    338344                var letter = j("input#selected_letter").val();
    339                        
     345
    340346            if ( undefined === j("input#search_terms").val() )
    341347                var search_terms = '';
    342348            else
    343349                var search_terms = j("input#search_terms").val();
    344                
     350
    345351            j.post( ajaxurl, {
    346352                action: 'directory_groups',
     
    349355                'gpage': page[1],
    350356                '_wpnonce': j("input#_wpnonce-group-filter").val(),
    351                
     357
    352358                'letter': letter,
    353359                's': search_terms
    354360            },
    355361            function(response)
    356             {   
    357                 response = response.substr(0, response.length-1);
    358                 j("#group-dir-list").fadeOut(200, 
     362            {
     363                response = response.substr(0, response.length-1);
     364                j("#group-dir-list").fadeOut(200,
    359365                    function() {
    360366                        j('.ajax-loader').toggle();
     
    362368                        j("#group-dir-list").fadeIn(200);
    363369                    }
    364                 );     
    365             });
    366            
    367             return false;
    368         }
    369     );
    370    
     370                );
     371            });
     372
     373            return false;
     374        }
     375    );
     376
    371377    j(".directory-listing div.group-button a").livequery('click',
    372378        function() {
     
    374380            gid = gid.split('-');
    375381            gid = gid[1];
    376            
     382
    377383            var nonce = j(this).attr('href');
    378384            nonce = nonce.split('?_wpnonce=');
    379385            nonce = nonce[1].split('&');
    380386            nonce = nonce[0];
    381            
     387
    382388            var thelink = j(this);
    383389
     
    393399                var parentdiv = thelink.parent();
    394400
    395                 j(parentdiv).fadeOut(200, 
     401                j(parentdiv).fadeOut(200,
    396402                    function() {
    397403                        parentdiv.fadeIn(200).html(response);
     
    408414        }
    409415    );
    410    
     416
    411417    j("div#invite-list input").click(
    412418        function() {
     
    420426                var friend_action = 'uninvite';
    421427            }
    422                        
     428
    423429            j.post( ajaxurl, {
    424430                action: 'groups_invite_user',
     
    430436            },
    431437            function(response)
    432             {   
     438            {
    433439                if ( j("#message") )
    434440                    j("#message").hide();
    435                
     441
    436442                j('.ajax-loader').toggle();
    437443
    438444                if ( friend_action == 'invite' ) {
    439                     j('#friend-list').append(response); 
     445                    j('#friend-list').append(response);
    440446                } else if ( friend_action == 'uninvite' ) {
    441447                    j('#friend-list li#uid-' + friend_id).remove();
     
    444450        }
    445451    );
    446    
     452
    447453    j("#friend-list li a.remove").livequery('click',
    448454        function() {
    449455            j('.ajax-loader').toggle();
    450            
     456
    451457            var friend_id = j(this).attr('id');
    452458            friend_id = friend_id.split('-');
    453459            friend_id = friend_id[1];
    454            
     460
    455461            j.post( ajaxurl, {
    456462                action: 'groups_invite_user',
     
    462468            },
    463469            function(response)
    464             {   
     470            {
    465471                j('.ajax-loader').toggle();
    466472                j('#friend-list li#uid-' + friend_id).remove();
    467473                j('#invite-list input#f-' + friend_id).attr('checked', false);
    468474            });
    469            
    470             return false;
    471         }
    472     );
    473    
     475
     476            return false;
     477        }
     478    );
     479
    474480    j(".groups div#pag a").livequery('click',
    475         function() { 
     481        function() {
    476482            j('.ajax-loader').toggle();
    477483
     
    488494            },
    489495            function(response)
    490             {   
     496            {
    491497                response = response.substr( 0, response.length - 1 );
    492                
    493                 j("div#group-loop").fadeOut(200, 
     498
     499                j("div#group-loop").fadeOut(200,
    494500                    function() {
    495501                        j('.ajax-loader').toggle();
     
    499505                );
    500506            });
    501            
    502             return false;
    503         }
    504     );
    505    
    506     j("input#group-filter-box").keyup( 
     507
     508            return false;
     509        }
     510    );
     511
     512    j("input#group-filter-box").keyup(
    507513        function(e) {
    508514            if ( e.which == 13 ) {
    509515                j('.ajax-loader').toggle();
    510                
     516
    511517                j.post( ajaxurl, {
    512518                    action: 'group_filter',
     
    520526                    response = response.substr( 0, response.length - 1 );
    521527
    522                     j("div#group-loop").fadeOut(200, 
     528                    j("div#group-loop").fadeOut(200,
    523529                        function() {
    524530                            j('.ajax-loader').toggle();
     
    533539        }
    534540    );
    535        
     541
    536542    j("div#member-pagination a").livequery('click',
    537         function() { 
     543        function() {
    538544            j('.ajax-loader').toggle();
    539545
     
    549555            },
    550556            function(response)
    551             {   
    552                 response = response.substr(0, response.length-1);
    553 
    554                 j("form#group-members-form").fadeOut(200, 
     557            {
     558                response = response.substr(0, response.length-1);
     559
     560                j("form#group-members-form").fadeOut(200,
    555561                    function() {
    556562                        j("form#group-members-form").html(response);
     
    565571        }
    566572    );
    567    
     573
    568574    j("div#member-admin-pagination a").livequery('click',
    569         function() { 
     575        function() {
    570576            j('.ajax-loader').toggle();
    571577
     
    581587            },
    582588            function(response)
    583             {   
    584                 response = response.substr(0, response.length-1);
    585 
    586                 j("form#group-members-form").fadeOut(200, 
     589            {
     590                response = response.substr(0, response.length-1);
     591
     592                j("form#group-members-form").fadeOut(200,
    587593                    function() {
    588594                        j("form#group-members-form").html(response);
     
    598604    );
    599605
    600     j("input#send-notice").click(   
     606    j("input#send-notice").click(
    601607        function() {
    602608            if ( j("#send_to") ) {
     
    606612    );
    607613
    608     j("input#send_reply_button").click( 
     614    j("input#send_reply_button").click(
    609615        function() {
    610616            //tinyMCE.triggerSave(true, true);
    611            
     617
    612618            var rand = Math.floor(Math.random()*100001);
    613619            j("form#send-reply").before('<div style="display:none;" class="ajax_reply" id="' + rand + '">Sending Message...</div>');
    614620            j("div#" + rand).fadeIn();
    615        
     621
    616622            j.post( ajaxurl, {
    617623                action: 'messages_send_reply',
    618624                'cookie': encodeURIComponent(document.cookie),
    619625                '_wpnonce': j("input#send_message_nonce").val(),
    620                
     626
    621627                'content': j("#message_content").val(),
    622628                'send_to': j("input#send_to").val(),
     
    628634                response = response.substr(0, response.length-1);
    629635                var css_class = 'message-box';
    630                
     636
    631637                setTimeout( function() {
    632638                    j("div#" + rand).slideUp();
    633639                }, 500);
    634                
     640
    635641                setTimeout( function() {
    636642                    var err_num = response.split('[[split]]');
     
    639645                        css_class = 'error-box';
    640646                    }
    641                    
     647
    642648                    //tinyMCE.activeEditor.setContent('')
    643649                    j("#message_content").val('');
    644                    
     650
    645651                    j("div#" + rand).html(response).attr('class', css_class).slideDown();
    646                 }, 1250);   
    647             });
    648        
    649             return false;
    650         }
    651     );
    652    
     652                }, 1250);
     653            });
     654
     655            return false;
     656        }
     657    );
     658
    653659    j("a#mark_as_read").click(
    654660        function() {
     
    667673                            j('.inbox-count').html('0');
    668674                        } else {
    669                             j('.inbox-count').html(parseInt(inboxcount) - 1);   
     675                            j('.inbox-count').html(parseInt(inboxcount) - 1);
    670676                        }
    671                        
     677
    672678                        if ( i != checkboxes.length - 1 ) {
    673679                            checkboxes_tosend += ','
     
    676682                }
    677683            }
    678            
     684
    679685            j.post( ajaxurl, {
    680686                action: 'messages_markread',
     
    689695                }
    690696            });
    691             return false;           
    692         }
    693     );
    694    
     697            return false;
     698        }
     699    );
     700
    695701    j("a#mark_as_unread").click(
    696702        function() {
     
    705711                        j('tr#m-' + checkboxes[i].value + ' td span.unread-count').html('1');
    706712                        var inboxcount = j('.inbox-count').html();
    707                        
     713
    708714                        if ( parseInt(inboxcount) == 0 ) {
    709715                            j('.inbox-count').css('display', 'inline');
     
    719725                }
    720726            }
    721            
     727
    722728            j.post( ajaxurl, {
    723729                action: 'messages_markunread',
     
    732738                }
    733739            });
    734             return false;           
    735         }
    736     );
    737    
     740            return false;
     741        }
     742    );
     743
    738744    j("a#delete_inbox_messages").click(
    739745        function() {
     
    744750                if(checkboxes[i].checked) {
    745751                    checkboxes_tosend += checkboxes[i].value;
    746                    
     752
    747753                    if ( j('tr#m-' + checkboxes[i].value).hasClass('unread') ) {
    748754                        var inboxcount = j('.inbox-count').html();
    749                    
     755
    750756                        if ( parseInt(inboxcount) == 1 ) {
    751757                            j('.inbox-count').css('display', 'none');
     
    755761                        }
    756762                    }
    757                    
     763
    758764                    if ( i != checkboxes.length - 1 ) {
    759765                        checkboxes_tosend += ','
    760766                    }
    761                    
    762                     j('tr#m-' + checkboxes[i].value).remove();                 
     767
     768                    j('tr#m-' + checkboxes[i].value).remove();
    763769                }
    764770            }
     
    773779                response = response.substr(0, response.length-1);
    774780                var err_num = response.split('[[split]]');
    775                
     781
    776782                j('#message').remove();
    777                
     783
    778784                if ( err_num[0] == "-1" ) {
    779785                    // error
     
    783789                }
    784790            });
    785             return false;           
    786         }
    787     );
    788    
     791            return false;
     792        }
     793    );
     794
    789795    j("a#delete_sentbox_messages").click(
    790796        function() {
    791797            checkboxes_tosend = '';
    792798            checkboxes = j("#message-threads tr td input[type='checkbox']");
    793            
     799
    794800            if ( !checkboxes.length ) return false;
    795            
     801
    796802            for(var i=0; i<checkboxes.length; i++) {
    797803                if(checkboxes[i].checked) {
     
    801807                        checkboxes_tosend += ','
    802808                    }
    803                     j('tr#m-' + checkboxes[i].value).remove();                 
     809                    j('tr#m-' + checkboxes[i].value).remove();
    804810                }
    805811            }
     
    814820                response = response.substr(0, response.length-1);
    815821                var err_num = response.split('[[split]]');
    816                
     822
    817823                j('#message').remove();
    818                
     824
    819825                if ( err_num[0] == "-1" ) {
    820826                    // error
     
    824830                }
    825831            });
    826             return false;           
    827         }
    828     );
    829    
    830    
     832            return false;
     833        }
     834    );
     835
     836
    831837    j("a#close-notice").click(
    832838        function() {
     
    846852                }
    847853            });
    848             return false;           
    849         }
    850     );
    851    
     854            return false;
     855        }
     856    );
     857
    852858    j("select#message-type-select").change(
    853859        function() {
     
    880886    );
    881887
    882     j("form#status-update-form").livequery('submit', 
     888    j("form#status-update-form").livequery('submit',
    883889        function() {
    884890            j('input#status-update-post').attr( 'disabled', 'disabled' );
    885        
     891
    886892            j.post( ajaxurl, {
    887893                action: 'status_new_status',
     
    891897            },
    892898            function(response) {
    893                 if ( response == "1" ) {           
     899                if ( response == "1" ) {
    894900                    j("div#user-status").slideUp(400,
    895901                        function() {
     
    898904                                'cookie': encodeURIComponent(document.cookie)
    899905                            },
    900                             function(response) {               
     906                            function(response) {
    901907                                j("div#user-status").html(response);
    902908                                j("div#user-status").slideDown(400);
    903909                                j(window).unbind('click');
    904910                            });
    905                         } 
     911                        }
    906912                    );
    907913                }
     
    912918    );
    913919
    914     j("a#status-clear-status").livequery('click', 
     920    j("a#status-clear-status").livequery('click',
    915921        function() {
    916922            j.post( ajaxurl, {
     
    918924                'cookie': encodeURIComponent(document.cookie)
    919925            },
    920             function(response) {               
    921                 j("div#user-status").fadeOut(300, 
     926            function(response) {
     927                j("div#user-status").fadeOut(300,
    922928                    function() {
    923929                        j("div#user-status").html(response);
     
    931937    );
    932938
    933     j("div.status-editable p, a#status-new-status").livequery('click', 
     939    j("div.status-editable p, a#status-new-status").livequery('click',
    934940        function() {
    935941            j('div.generic-button a#status-new-status').parent().addClass('loading');
    936            
     942
    937943            j.post( ajaxurl, {
    938944                action: 'status_show_form',
    939945                'cookie': encodeURIComponent(document.cookie)
    940946            },
    941             function(response) {               
    942                 j("div#user-status").slideUp(400, 
     947            function(response) {
     948                j("div#user-status").slideUp(400,
    943949                    function() {
    944950                        j("div#user-status").html(response);
     
    948954                    }
    949955                );
    950                
     956
    951957                j(window).bind('click', function(ev) {
    952958                    if ( !j(ev.target).is('div#user-status') && !j(ev.target).parents('div#user-status').length ) {
     
    955961                            'cookie': encodeURIComponent(document.cookie)
    956962                        },
    957                         function(response) {               
    958                             j("div#user-status").slideUp(400, 
     963                        function(response) {
     964                            j("div#user-status").slideUp(400,
    959965                                function() {
    960966                                    j("div#user-status").html(response);
     
    962968                                }
    963969                            );
    964                            
     970
    965971                            j(window).unbind('click');
    966972                        });
     
    973979    );
    974980
    975     j("a#status-clear-status").livequery('click', 
     981    j("a#status-clear-status").livequery('click',
    976982        function() {
    977983            j(this).addClass('ajax-loader');
    978984            j(this).attr('style', 'vertical-align: middle; display: inline-block; overflow: hidden; width: 10px; text-indent: -999em' );
    979            
     985
    980986            j.post( ajaxurl, {
    981987                action: 'status_clear_status',
    982988                'cookie': encodeURIComponent(document.cookie)
    983989            },
    984             function(response) {               
    985                 j("div#user-status").fadeOut(300, 
     990            function(response) {
     991                j("div#user-status").fadeOut(300,
    986992                    function() {
    987993                        j("div#user-status").html(response);
     
    9941000        }
    9951001    );
    996    
    997         j("div#blogs-directory-page ul#letter-list li a").livequery('click',
    998         function() { 
    999             j('.ajax-loader').toggle();
    1000 
    1001             j("div#blogs-list-options a.selected").removeClass("selected"); 
    1002             j("#letter-list li a.selected").removeClass("selected"); 
    1003            
     1002
     1003    j("div#blogs-directory-page ul#letter-list li a").livequery('click',
     1004        function() {
     1005            j('.ajax-loader').toggle();
     1006
     1007            j("div#blogs-list-options a.selected").removeClass("selected");
     1008            j("#letter-list li a.selected").removeClass("selected");
     1009
    10041010            j(this).addClass('selected');
    10051011            j("input#blogs_search").val('');
     
    10161022            },
    10171023            function(response)
    1018             {   
    1019                 response = response.substr(0, response.length-1);
    1020                 j("#blog-dir-list").fadeOut(200, 
     1024            {
     1025                response = response.substr(0, response.length-1);
     1026                j("#blog-dir-list").fadeOut(200,
    10211027                    function() {
    10221028                        j('.ajax-loader').toggle();
     
    10261032                );
    10271033            });
    1028        
    1029             return false;
    1030         }
    1031     );
    1032    
    1033     j("form#search-blogs-form").submit( function() {
    1034             j('.ajax-loader').toggle();
     1034
     1035            return false;
     1036        }
     1037    );
     1038
     1039    j("form#search-blogs-form").submit( function() {
     1040            j('.ajax-loader').toggle();
     1041
     1042            j("div#blogs-list-options a.selected").removeClass("selected");
     1043            j("#letter-list li a.selected").removeClass("selected");
    10351044
    10361045            j.post( ajaxurl, {
     
    10421051            },
    10431052            function(response)
    1044             {   
    1045                 response = response.substr(0, response.length-1);
    1046                 j("#blog-dir-list").fadeOut(200, 
     1053            {
     1054                response = response.substr(0, response.length-1);
     1055                j("#blog-dir-list").fadeOut(200,
    10471056                    function() {
    10481057                        j('.ajax-loader').toggle();
     
    10521061                );
    10531062            });
    1054        
    1055             return false;
    1056         }
    1057     );
    1058    
     1063
     1064            return false;
     1065        }
     1066    );
     1067
    10591068    j("div#blog-dir-pag a").livequery('click',
    1060         function() { 
     1069        function() {
    10611070            j('.ajax-loader').toggle();
    10621071
    10631072            var page = j(this).attr('href');
    10641073            page = page.split('bpage=');
    1065            
     1074
    10661075            if ( undefined === j("input#selected_letter").val() )
    10671076                var letter = '';
    10681077            else
    10691078                var letter = j("input#selected_letter").val();
    1070                        
     1079
    10711080            if ( undefined === j("input#search_terms").val() )
    10721081                var search_terms = '';
    10731082            else
    10741083                var search_terms = j("input#search_terms").val();
    1075                        
     1084
    10761085            j.post( ajaxurl, {
    10771086                action: 'directory_blogs',
     
    10801089                'bpage': page[1],
    10811090                '_wpnonce': j("input#_wpnonce-blog-filter").val(),
    1082                
     1091
    10831092                'letter': letter,
    10841093                's': search_terms
    10851094            },
    10861095            function(response)
    1087             {   
    1088                 response = response.substr(0, response.length-1);
    1089                 j("#blog-dir-list").fadeOut(200, 
     1096            {
     1097                response = response.substr(0, response.length-1);
     1098                j("#blog-dir-list").fadeOut(200,
    10901099                    function() {
    10911100                        j('.ajax-loader').toggle();
     
    10951104                );
    10961105            });
    1097            
     1106
    10981107            return false;
    10991108        }
     
    11281137        radioButtons[i].checked = '';
    11291138    }
    1130    
     1139
    11311140    return;
    11321141}
  • trunk/bp-themes/bp-sn-parent/directories/blogs/blogs-loop.php

    r2077 r2114  
    5050    <?php do_action( 'bp_after_directory_blogs_list' ) ?>
    5151
     52    <?php bp_the_site_blog_hidden_fields() ?>
     53
    5254<?php else: ?>
    5355
     
    5759
    5860<?php endif; ?>
    59 
    60 <?php bp_the_site_blog_hidden_fields() ?>
  • trunk/bp-themes/bp-sn-parent/directories/groups/groups-loop.php

    r2077 r2114  
    5050    <?php do_action( 'bp_after_directory_groups_list' ) ?>
    5151
     52    <?php bp_the_site_group_hidden_fields() ?>
     53
    5254<?php else: ?>
    5355
     
    5759
    5860<?php endif; ?>
    59 
    60 <?php bp_the_site_group_hidden_fields() ?>
  • trunk/bp-themes/bp-sn-parent/directories/members/members-loop.php

    r2077 r2114  
    4444    <?php do_action( 'bp_after_directory_members_list' ) ?>
    4545
     46    <?php bp_the_site_member_hidden_fields() ?>
     47
    4648<?php else: ?>
    4749
     
    5153
    5254<?php endif; ?>
    53 
    54 <?php bp_the_site_member_hidden_fields() ?>
  • trunk/bp-themes/bp-sn-parent/groups/single/home.php

    r2077 r2114  
    117117                                            <a class="topic-avatar" href="<?php bp_the_topic_permalink() ?>" title="<?php bp_the_topic_title() ?> - <?php _e( 'Permalink', 'buddypress' ) ?>"><?php bp_the_topic_last_poster_avatar( 'width=30&height=30') ?></a>
    118118                                            <a class="topic-title" href="<?php bp_the_topic_permalink() ?>" title="<?php bp_the_topic_title() ?> - <?php _e( 'Permalink', 'buddypress' ) ?>"><?php bp_the_topic_title() ?></a>
    119                                             <span class="small topic-meta">(<?php bp_the_topic_total_post_count() ?> &rarr; <?php bp_the_topic_time_since_last_post() ?> ago)</span>
     119                                            <span class="small topic-meta">(<?php bp_the_topic_total_post_count() ?> &rarr; <?php bp_the_topic_time_since_last_post() ?> <?php _e( 'ago', 'buddypress' ) ?>)</span>
    120120                                            <span class="small latest topic-excerpt"><?php bp_the_topic_latest_post_excerpt() ?></span>
    121121
  • trunk/bp-themes/bp-sn-parent/messages/compose.php

    r2077 r2114  
    1414            <?php do_action( 'bp_before_messages_compose_content' ) ?>
    1515
    16             <label for="send-to-input"><?php _e("Send To", 'buddypress') ?> &nbsp; <span class="ajax-loader"></span></label>
     16            <label for="send-to-input"><?php _e("Send To (Username or Friend's Name)", 'buddypress') ?> &nbsp; <span class="ajax-loader"></span></label>
    1717            <ul class="first acfb-holder">
    1818                <li>
  • trunk/bp-wire/bp-wire-classes.php

    r2077 r2114  
    105105
    106106        $wire_posts = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$table_name} WHERE item_id = %d ORDER BY date_posted DESC $pag_sql", $item_id ) );
    107         $count = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$table_name} WHERE item_id = %d", $item_id ) );
     107        $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$table_name} WHERE item_id = %d", $item_id ) );
    108108
    109109        return array( 'wire_posts' => $wire_posts, 'count' => $count );
Note: See TracChangeset for help on using the changeset viewer.