Changeset 2114
- Timestamp:
- 11/24/2009 10:05:01 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r2088 r2114 83 83 bp_core_add_root_component( BP_ACTIVITY_SLUG ); 84 84 } 85 add_action( 'plugins_loaded', 'bp_activity_setup_root_component' , 2);85 add_action( 'plugins_loaded', 'bp_activity_setup_root_component' ); 86 86 87 87 function bp_activity_setup_nav() { … … 126 126 127 127 function 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 128 134 do_action( 'bp_activity_screen_friends_activity' ); 129 135 bp_core_load_template( apply_filters( 'bp_activity_template_friends_activity', 'activity/my-friends' ) ); -
trunk/bp-activity/bp-activity-classes.php
r2094 r2114 242 242 $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" ) ); 243 243 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" ) ); 245 245 246 246 return array( 'activities' => $activities, 'total' => (int)$total_activities ); -
trunk/bp-activity/bp-activity-templatetags.php
r2092 r2114 314 314 $content = bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded, $activities_template->full_name, true, false, false ); 315 315 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 319 316 return apply_filters( 'bp_get_activity_content', $content, $activities_template->activity->component_name, $activities_template->activity->component_action ); 320 317 } … … 488 485 else 489 486 unset($selected); 490 491 $component_name = attribute_escape( $component_name );492 487 493 488 $component_name = attribute_escape( $component_name ); … … 559 554 global $activities_template; 560 555 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 ) ); 562 557 } 563 558 -
trunk/bp-blogs.php
r2077 r2114 127 127 128 128 function bp_blogs_setup_root_component() { 129 /* Register ' groups' as a root component */129 /* Register 'blogs' as a root component */ 130 130 bp_core_add_root_component( BP_BLOGS_SLUG ); 131 131 } … … 352 352 if ( !$user_id ) 353 353 $user_id = (int)$post->post_author; 354 354 355 /* This is to stop infinate loops with Donncha's sitewide tags plugin */ 355 356 if ( (int)get_site_option( 'tags_blog_id' ) == (int)$blog_id ) -
trunk/bp-blogs/bp-blogs-classes.php
r2083 r2114 65 65 global $bp, $wpdb; 66 66 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 ) ); 68 68 } 69 69 … … 153 153 // If the user is logged in return the blog count including their hidden blogs. 154 154 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) ); 156 156 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) ); 158 158 } 159 159 … … 166 166 if ( $limit && $page ) { 167 167 $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" ) ); 169 169 } 170 170 … … 184 184 if ( $limit && $page ) { 185 185 $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" ) ); 187 187 } 188 188 … … 202 202 if ( $limit && $page ) { 203 203 $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" ) ); 205 205 } 206 206 … … 218 218 if ( $limit && $page ) { 219 219 $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()" ) ); 221 221 } 222 222 … … 234 234 if ( $limit && $page ) { 235 235 $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" ) ); 237 237 } 238 238 … … 250 250 if ( $limit && $page ) { 251 251 $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" ) ); 253 253 } 254 254 … … 407 407 if ( !bp_is_home() ) { 408 408 $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) ); 410 410 } else { 411 411 $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) ); 413 414 } 414 415 … … 439 440 $user_id = $current_user->ID; 440 441 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 ) ); 442 443 } 443 444 … … 463 464 return false; 464 465 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 ) ); 466 467 } 467 468 … … 600 601 if ( !bp_is_home() ) { 601 602 $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) ); 603 604 } else { 604 605 $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++ ) 609 611 $comments[$i] = BP_Blogs_Comment::fetch_comment_content($comment_ids[$i]); 610 }611 612 612 613 return array( 'comments' => $comments, 'count' => $total_comment_count ); … … 632 633 $user_id = $current_user->ID; 633 634 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 ) ); 635 636 } 636 637 … … 644 645 $post_sql = $wpdb->prepare( " AND comment_post_id = %d", $post_id ); 645 646 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 ) ); 647 648 } 648 649 -
trunk/bp-core.php
r2088 r2114 1582 1582 1583 1583 /* 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' ) ) 1585 1585 return false; 1586 1586 … … 1806 1806 load_textdomain( 'buddypress', $mofile ); 1807 1807 } 1808 add_action ( 'plugins_loaded', 'bp_core_load_buddypress_textdomain', 9);1808 add_action ( 'plugins_loaded', 'bp_core_load_buddypress_textdomain', 5 ); 1809 1809 1810 1810 function bp_core_add_ajax_hook() { -
trunk/bp-core/bp-core-adminbar.php
r2083 r2114 141 141 142 142 echo '</a>'; 143 144 143 echo '<ul>'; 145 144 146 145 if ( is_array( $blogs['blogs'] ) && (int)$blogs['count'] ) { 147 148 146 $counter = 0; 149 147 foreach ( $blogs['blogs'] as $blog ) { -
trunk/bp-core/bp-core-avatars.php
r2088 r2114 117 117 118 118 /* If no avatars have been uploaded for this item, display a gravatar */ 119 if ( ! file_exists( $avatar_url ) && !$no_grav ) {119 if ( !$no_grav ) { 120 120 if ( empty( $bp->grav_default->{$object} ) ) 121 121 $default_grav = 'wavatar'; … … 140 140 return apply_filters( 'bp_core_fetch_avatar', "<img src='{$gravatar}' alt='{$alt}' id='{$css_id}' class='{$class}'{$html_width}{$html_height} />", $params ); 141 141 142 } else if ( !file_exists( $avatar_url ) && $no_grav ) 143 return false; 142 } else { 143 return false; 144 } 144 145 } 145 146 -
trunk/bp-core/bp-core-classes.php
r2088 r2114 88 88 $this->total_friends = BP_Friends_Friendship::total_friend_count( $this->id ); 89 89 90 if ( function_exists('groups_install') ) 90 if ( function_exists('groups_install') ) { 91 91 $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 } 92 100 } 93 101 … … 104 112 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 105 113 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" ); 107 115 $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 ); 108 116 … … 119 127 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 120 128 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" ); 122 130 $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 ); 123 131 … … 137 145 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 138 146 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" ); 140 148 $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 ); 141 149 … … 152 160 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 153 161 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 ) ); 155 163 $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 ); 156 164 … … 167 175 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 168 176 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" ); 170 178 $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 ); 171 179 … … 185 193 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 186 194 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 ); 189 197 190 198 $total_users = $wpdb->get_var( $total_users_sql ); … … 208 216 $letter = like_escape( $wpdb->escape( $letter ) ); 209 217 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 ); 211 219 $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 ); 212 220 … … 228 236 $search_terms = like_escape( $wpdb->escape( $search_terms ) ); 229 237 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 ); 231 239 $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 ); 232 240 … … 300 308 global $wpdb, $bp; 301 309 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 ) ); 303 311 } 304 312 -
trunk/bp-core/bp-core-settings.php
r2077 r2114 162 162 bp_core_redirect( site_url() ); 163 163 } 164 164 165 add_action( 'bp_template_title', 'bp_core_screen_delete_account_title' ); 165 166 add_action( 'bp_template_content', 'bp_core_screen_delete_account_content' ); -
trunk/bp-core/bp-core-templatetags.php
r2088 r2114 1057 1057 echo apply_filters( 'bp_the_site_member_avatar', bp_get_the_site_member_avatar( $args ) ); 1058 1058 } 1059 1059 1060 function bp_get_the_site_member_avatar( $args = '' ) { 1060 1061 global $bp, $site_members_template; … … 1632 1633 echo bp_get_the_body_class(); 1633 1634 } 1634 function bp_get_the_body_class( $wp_classes, $custom_classes ) {1635 function bp_get_the_body_class( $wp_classes, $custom_classes = false ) { 1635 1636 global $bp; 1636 1637 -
trunk/bp-core/deprecated/bp-core-deprecated.php
r2088 r2114 332 332 $blog_title = $filtered_results['blog_title']; 333 333 $errors = $filtered_results['errors']; 334 334 335 335 if ( empty($blogname) ) 336 336 $blogname = $user_name; … … 567 567 return false; 568 568 } 569 add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 );570 569 571 570 function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) { 572 571 global $current_site; 573 572 573 if( !apply_filters('wpmu_signup_user_notification', $user, $user_email, $key, $meta) ) 574 return false; 575 574 576 // Send email with activation link. 575 577 $admin_email = get_site_option( "admin_email" ); 576 578 577 if ( empty( $admin_email ))579 if ( $admin_email == '' ) 578 580 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; 579 581 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" ) ); 581 583 $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); 586 589 587 590 // Return false to stop the original WPMU function from continuing 588 591 return false; 589 592 } 590 add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 ); 593 594 function 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 } 602 add_action( 'plugins_loaded', 'bp_core_load_deprecated_signup_email_functions' ); 591 603 592 604 /*** END DEPRECATED SIGNUP FUNCTIONS **********/ -
trunk/bp-forums/bp-forums-admin.php
r2077 r2114 63 63 switch ( $result ) { 64 64 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' ); 66 66 break; 67 67 default: -
trunk/bp-friends/bp-friends-classes.php
r2077 r2114 133 133 This function will recalculate, update and return. */ 134 134 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 ) ); 136 136 137 137 if ( !$count ) … … 167 167 if ( function_exists('xprofile_install') ) { 168 168 $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%%'" ); 170 170 } else { 171 171 $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%%'" ); 173 173 } 174 174 … … 255 255 // filter the user_ids based on the search criteria. 256 256 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%%'" ); 260 260 } 261 261 -
trunk/bp-groups.php
r2088 r2114 821 821 822 822 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 ) ) ) { 824 824 /* Check the nonce first. */ 825 825 if ( !check_admin_referer( 'bp_wire_post' ) ) … … 836 836 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/' . $bp->wire->slug ); 837 837 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 ) ) ) { 839 839 $wire_message_id = $bp->action_variables[1]; 840 840 … … 912 912 if ( $bp->is_single_item ) { 913 913 if ( isset($bp->action_variables) && 'yes' == $bp->action_variables[0] ) { 914 915 914 // 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 } 919 920 } 920 921 … … 1810 1811 $user_id = $bp->loggedin_user->id; 1811 1812 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 1816 1813 // This is exactly the same as deleting and invite, just is_confirmed = 1 NOT 0. 1817 1814 if ( !groups_uninvite_user( $user_id, $group_id, true ) ) … … 1834 1831 if ( groups_check_user_has_invite( $user_id, $group_id ) ) 1835 1832 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 ); 1836 1836 1837 1837 $new_member = new BP_Groups_Member; … … 1852 1852 'primary_link' => apply_filters( 'groups_activity_joined_group_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ), 1853 1853 'component_action' => 'joined_group', 1854 'item_id' => $ bp->groups->current_group->id1854 'item_id' => $group_id 1855 1855 ) ); 1856 1856 -
trunk/bp-groups/bp-groups-classes.php
r2088 r2114 261 261 262 262 $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})" ) ); 264 264 265 265 return array( 'groups' => $paged_groups, 'total' => $total_groups ); … … 284 284 285 285 $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}" ) ); 287 287 288 288 return array( 'groups' => $paged_groups, 'total' => $total_groups ); … … 304 304 global $wpdb, $bp; 305 305 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 ) ); 307 307 308 308 if ( !$members ) … … 315 315 global $wpdb, $bp; 316 316 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 ) ); 318 318 } 319 319 … … 400 400 401 401 $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" ) ); 403 403 404 404 return array( 'groups' => $paged_groups, 'total' => $total_groups ); … … 413 413 414 414 $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" ) ); 416 416 417 417 return array( 'groups' => $paged_groups, 'total' => $total_groups ); … … 423 423 424 424 if ( $only_public ) 425 $public_sql = $wpdb->prepare( " WHEREg.status = 'public'" );425 $public_sql = $wpdb->prepare( " AND g.status = 'public'" ); 426 426 427 427 if ( !is_site_admin() ) … … 438 438 switch ( $sort_by ) { 439 439 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}" ); 441 441 break; 442 442 case 'members': … … 467 467 if ( $limit && $page ) { 468 468 $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" ) ); 470 470 } 471 471 … … 505 505 $extra_sql = apply_filters( 'groups_total_public_forum_topic_count', $bp->groups->filter_sql, $type ); 506 506 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} " ); 508 508 } 509 509 } … … 681 681 if ( bp_is_home() ) { 682 682 $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 ) ); 684 684 } else { 685 685 $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 ) ); 687 687 } 688 688 … … 707 707 708 708 $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 ) ); 710 710 711 711 return array( 'groups' => $paged_groups, 'total' => $total_groups ); … … 727 727 728 728 $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 ) ); 730 730 731 731 return array( 'groups' => $paged_groups, 'total' => $total_groups ); … … 747 747 748 748 $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 ) ); 750 750 751 751 return array( 'groups' => $paged_groups, 'total' => $total_groups ); … … 767 767 768 768 $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 ) ); 770 770 771 771 return array( 'groups' => $paged_groups, 'total' => $total_groups ); … … 787 787 788 788 $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 ) ); 790 790 791 791 return array( 'groups' => $paged_groups, 'total' => $total_groups ); … … 807 807 808 808 $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 ) ); 810 810 811 811 return array( 'groups' => $paged_groups, 'total' => $total_groups ); … … 819 819 820 820 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 ) ); 822 822 } 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 ) ); 824 824 } 825 825 } … … 945 945 $total_member_count = count($members); 946 946 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 ) ); 948 948 949 949 return array( 'members' => $members, 'count' => $total_member_count ); -
trunk/bp-messages.php
r2077 r2114 104 104 messages_install(); 105 105 } 106 add_action( 'admin_menu', 'messages_check_installed' , 2);106 add_action( 'admin_menu', 'messages_check_installed' ); 107 107 108 108 function messages_setup_nav() { -
trunk/bp-messages/bp-messages-classes.php
r2077 r2114 235 235 $type_sql = $wpdb->prepare( " AND unread_count = 0 " ); 236 236 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 ) ); 238 238 } 239 239 … … 557 557 global $wpdb, $bp; 558 558 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 560 561 return $notice_count; 561 562 } -
trunk/bp-themes/bp-default/_inc/css/screen.css
r2069 r2114 1324 1324 -webkit-border-radius: 5px; 1325 1325 } 1326 .activity-list li blockquote p { margin: 0; } 1326 .activity-list li blockquote p { 1327 margin: 0; 1328 overflow: hidden; 1329 } 1327 1330 1328 1331 .activity-list li span.time-since { … … 1405 1408 .widget_bp_core_recently_active_widget div.item-avatar { 1406 1409 display: inline; 1407 margin: 0 5px 5 x 0;1410 margin: 0 5px 5px 0; 1408 1411 } 1409 1412 … … 2144 2147 2145 2148 div#user-status { 2146 margin: 0 0 20px 0; 2149 margin: 0; 2150 padding-bottom: 20px; 2147 2151 font: normal 1.3em Georgia, times, serif; 2148 2152 } -
trunk/bp-themes/bp-sn-parent/_inc/css/fonts/12px.css
r1655 r2114 54 54 font-style: normal; 55 55 font-weight: normal; 56 margin: 0 0 18px 0; 56 margin: 0; 57 padding-bottom: 10px; 57 58 } 58 59 h1 { -
trunk/bp-themes/bp-sn-parent/_inc/js/ajax.js
r2055 r2114 5 5 6 6 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"); 12 12 13 13 j(this).addClass('selected'); 14 14 j("input#members_search").val(''); 15 15 16 16 var letter = j(this).attr('id') 17 17 letter = letter.split('-'); 18 18 19 19 var page = ( j('input#members-page-num').val() ) ? j('input#members-page-num').val() : 1; 20 20 … … 29 29 { 30 30 response = response.substr(0, response.length-1); 31 32 j("#member-dir-list").fadeOut(200, 31 32 j("#member-dir-list").fadeOut(200, 33 33 function() { 34 34 j('.ajax-loader').toggle(); … … 38 38 ); 39 39 }); 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"); 47 50 48 51 var page = ( j('input#members-page-num').val() ) ? j('input#members-page-num').val() : 1; … … 56 59 }, 57 60 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, 62 65 function() { 63 66 j('.ajax-loader').toggle(); … … 67 70 ); 68 71 }); 69 70 return false; 71 } 72 ); 73 72 73 return false; 74 } 75 ); 76 74 77 j("div#member-dir-pag a").livequery('click', 75 function() { 78 function() { 76 79 j('.ajax-loader').toggle(); 77 80 78 81 var page = j(this).attr('href'); 79 82 page = page.split('upage='); 80 83 81 84 if ( undefined === j("input#selected_letter").val() ) 82 85 var letter = ''; 83 86 else 84 87 var letter = j("input#selected_letter").val(); 85 88 86 89 if ( undefined === j("input#search_terms").val() ) 87 90 var search_terms = ''; 88 91 else 89 92 var search_terms = j("input#search_terms").val(); 90 93 91 94 j.post( ajaxurl, { 92 95 action: 'directory_members', … … 95 98 'upage': page[1], 96 99 '_wpnonce': j("input#_wpnonce-member-filter").val(), 97 100 98 101 'letter': letter, 99 102 's': search_terms 100 103 }, 101 104 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, 106 109 function() { 107 110 j('.ajax-loader').toggle(); … … 111 114 ); 112 115 }); 113 114 return false; 115 } 116 ); 117 116 117 return false; 118 } 119 ); 120 118 121 j("div.friendship-button a").livequery('click', 119 122 function() { … … 122 125 fid = fid.split('-'); 123 126 fid = fid[1]; 124 127 125 128 var nonce = j(this).attr('href'); 126 129 nonce = nonce.split('?_wpnonce='); … … 142 145 var action = thelink.attr('rel'); 143 146 var parentdiv = thelink.parent(); 144 147 145 148 if ( action == 'add' ) { 146 j(parentdiv).fadeOut(200, 149 j(parentdiv).fadeOut(200, 147 150 function() { 148 151 parentdiv.removeClass('add_friend'); … … 154 157 155 158 } else if ( action == 'remove' ) { 156 j(parentdiv).fadeOut(200, 159 j(parentdiv).fadeOut(200, 157 160 function() { 158 161 parentdiv.removeClass('remove_friend'); … … 161 164 parentdiv.fadeIn(200).html(response); 162 165 } 163 ); 166 ); 164 167 } 165 168 }); … … 169 172 170 173 j("div#wire-pagination a").livequery('click', 171 function() { 174 function() { 172 175 j('.ajax-loader').toggle(); 173 176 … … 183 186 }, 184 187 function(response) 185 { 188 { 186 189 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, 191 194 function() { 192 195 j("#wire-post-list-content").html(response); … … 197 200 return false; 198 201 }); 199 202 200 203 return false; 201 204 } … … 203 206 204 207 j(".friends div#pag a").livequery('click', 205 function() { 208 function() { 206 209 j('.ajax-loader').toggle(); 207 210 208 211 var frpage = j(this).attr('href'); 209 212 frpage = frpage.split('='); 210 213 211 214 j.post( ajaxurl, { 212 215 action: 'my_friends_search', … … 218 221 }, 219 222 function(response) 220 { 223 { 221 224 response = response.substr( 0, response.length - 1 ); 222 225 223 j("div#friends-loop").fadeOut(200, 226 j("div#friends-loop").fadeOut(200, 224 227 function() { 225 228 j('.ajax-loader').toggle(); … … 229 232 ); 230 233 }); 231 232 return false; 233 } 234 ); 235 234 235 return false; 236 } 237 ); 238 236 239 j("input#friend-search-box").keyup( 237 240 function(e) { 238 241 if ( e.which == 13 ) { 239 242 j('.ajax-loader').toggle(); 240 243 241 244 j.post( ajaxurl, { 242 245 action: 'my_friends_search', 243 246 'cookie': encodeURIComponent(document.cookie), 244 247 '_wpnonce': j("input#_wpnonce_friend_search").val(), 245 248 246 249 'friend-search-box': j("#friend-search-box").val() 247 250 }, 248 251 function(response) 249 { 252 { 250 253 response = response.substr( 0, response.length - 1 ); 251 252 j("div#friends-loop").fadeOut(200, 254 255 j("div#friends-loop").fadeOut(200, 253 256 function() { 254 257 j('.ajax-loader').toggle(); … … 258 261 ); 259 262 }); 260 263 261 264 return false; 262 265 } … … 265 268 266 269 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"); 272 275 273 276 j(this).addClass('selected'); … … 285 288 }, 286 289 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, 290 293 function() { 291 294 j('.ajax-loader').toggle(); … … 295 298 ); 296 299 }); 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"); 304 310 305 311 j.post( ajaxurl, { … … 311 317 }, 312 318 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, 316 322 function() { 317 323 j('.ajax-loader').toggle(); … … 321 327 ); 322 328 }); 323 324 return false; 325 } 326 ); 327 329 330 return false; 331 } 332 ); 333 328 334 j("div#group-dir-pag a").livequery('click', 329 function() { 335 function() { 330 336 j('.ajax-loader').toggle(); 331 337 332 338 var page = j(this).attr('href'); 333 339 page = page.split('gpage='); 334 340 335 341 if ( undefined === j("input#selected_letter").val() ) 336 342 var letter = ''; 337 343 else 338 344 var letter = j("input#selected_letter").val(); 339 345 340 346 if ( undefined === j("input#search_terms").val() ) 341 347 var search_terms = ''; 342 348 else 343 349 var search_terms = j("input#search_terms").val(); 344 350 345 351 j.post( ajaxurl, { 346 352 action: 'directory_groups', … … 349 355 'gpage': page[1], 350 356 '_wpnonce': j("input#_wpnonce-group-filter").val(), 351 357 352 358 'letter': letter, 353 359 's': search_terms 354 360 }, 355 361 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, 359 365 function() { 360 366 j('.ajax-loader').toggle(); … … 362 368 j("#group-dir-list").fadeIn(200); 363 369 } 364 ); 365 }); 366 367 return false; 368 } 369 ); 370 370 ); 371 }); 372 373 return false; 374 } 375 ); 376 371 377 j(".directory-listing div.group-button a").livequery('click', 372 378 function() { … … 374 380 gid = gid.split('-'); 375 381 gid = gid[1]; 376 382 377 383 var nonce = j(this).attr('href'); 378 384 nonce = nonce.split('?_wpnonce='); 379 385 nonce = nonce[1].split('&'); 380 386 nonce = nonce[0]; 381 387 382 388 var thelink = j(this); 383 389 … … 393 399 var parentdiv = thelink.parent(); 394 400 395 j(parentdiv).fadeOut(200, 401 j(parentdiv).fadeOut(200, 396 402 function() { 397 403 parentdiv.fadeIn(200).html(response); … … 408 414 } 409 415 ); 410 416 411 417 j("div#invite-list input").click( 412 418 function() { … … 420 426 var friend_action = 'uninvite'; 421 427 } 422 428 423 429 j.post( ajaxurl, { 424 430 action: 'groups_invite_user', … … 430 436 }, 431 437 function(response) 432 { 438 { 433 439 if ( j("#message") ) 434 440 j("#message").hide(); 435 441 436 442 j('.ajax-loader').toggle(); 437 443 438 444 if ( friend_action == 'invite' ) { 439 j('#friend-list').append(response); 445 j('#friend-list').append(response); 440 446 } else if ( friend_action == 'uninvite' ) { 441 447 j('#friend-list li#uid-' + friend_id).remove(); … … 444 450 } 445 451 ); 446 452 447 453 j("#friend-list li a.remove").livequery('click', 448 454 function() { 449 455 j('.ajax-loader').toggle(); 450 456 451 457 var friend_id = j(this).attr('id'); 452 458 friend_id = friend_id.split('-'); 453 459 friend_id = friend_id[1]; 454 460 455 461 j.post( ajaxurl, { 456 462 action: 'groups_invite_user', … … 462 468 }, 463 469 function(response) 464 { 470 { 465 471 j('.ajax-loader').toggle(); 466 472 j('#friend-list li#uid-' + friend_id).remove(); 467 473 j('#invite-list input#f-' + friend_id).attr('checked', false); 468 474 }); 469 470 return false; 471 } 472 ); 473 475 476 return false; 477 } 478 ); 479 474 480 j(".groups div#pag a").livequery('click', 475 function() { 481 function() { 476 482 j('.ajax-loader').toggle(); 477 483 … … 488 494 }, 489 495 function(response) 490 { 496 { 491 497 response = response.substr( 0, response.length - 1 ); 492 493 j("div#group-loop").fadeOut(200, 498 499 j("div#group-loop").fadeOut(200, 494 500 function() { 495 501 j('.ajax-loader').toggle(); … … 499 505 ); 500 506 }); 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( 507 513 function(e) { 508 514 if ( e.which == 13 ) { 509 515 j('.ajax-loader').toggle(); 510 516 511 517 j.post( ajaxurl, { 512 518 action: 'group_filter', … … 520 526 response = response.substr( 0, response.length - 1 ); 521 527 522 j("div#group-loop").fadeOut(200, 528 j("div#group-loop").fadeOut(200, 523 529 function() { 524 530 j('.ajax-loader').toggle(); … … 533 539 } 534 540 ); 535 541 536 542 j("div#member-pagination a").livequery('click', 537 function() { 543 function() { 538 544 j('.ajax-loader').toggle(); 539 545 … … 549 555 }, 550 556 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, 555 561 function() { 556 562 j("form#group-members-form").html(response); … … 565 571 } 566 572 ); 567 573 568 574 j("div#member-admin-pagination a").livequery('click', 569 function() { 575 function() { 570 576 j('.ajax-loader').toggle(); 571 577 … … 581 587 }, 582 588 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, 587 593 function() { 588 594 j("form#group-members-form").html(response); … … 598 604 ); 599 605 600 j("input#send-notice").click( 606 j("input#send-notice").click( 601 607 function() { 602 608 if ( j("#send_to") ) { … … 606 612 ); 607 613 608 j("input#send_reply_button").click( 614 j("input#send_reply_button").click( 609 615 function() { 610 616 //tinyMCE.triggerSave(true, true); 611 617 612 618 var rand = Math.floor(Math.random()*100001); 613 619 j("form#send-reply").before('<div style="display:none;" class="ajax_reply" id="' + rand + '">Sending Message...</div>'); 614 620 j("div#" + rand).fadeIn(); 615 621 616 622 j.post( ajaxurl, { 617 623 action: 'messages_send_reply', 618 624 'cookie': encodeURIComponent(document.cookie), 619 625 '_wpnonce': j("input#send_message_nonce").val(), 620 626 621 627 'content': j("#message_content").val(), 622 628 'send_to': j("input#send_to").val(), … … 628 634 response = response.substr(0, response.length-1); 629 635 var css_class = 'message-box'; 630 636 631 637 setTimeout( function() { 632 638 j("div#" + rand).slideUp(); 633 639 }, 500); 634 640 635 641 setTimeout( function() { 636 642 var err_num = response.split('[[split]]'); … … 639 645 css_class = 'error-box'; 640 646 } 641 647 642 648 //tinyMCE.activeEditor.setContent('') 643 649 j("#message_content").val(''); 644 650 645 651 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 653 659 j("a#mark_as_read").click( 654 660 function() { … … 667 673 j('.inbox-count').html('0'); 668 674 } else { 669 j('.inbox-count').html(parseInt(inboxcount) - 1); 675 j('.inbox-count').html(parseInt(inboxcount) - 1); 670 676 } 671 677 672 678 if ( i != checkboxes.length - 1 ) { 673 679 checkboxes_tosend += ',' … … 676 682 } 677 683 } 678 684 679 685 j.post( ajaxurl, { 680 686 action: 'messages_markread', … … 689 695 } 690 696 }); 691 return false; 692 } 693 ); 694 697 return false; 698 } 699 ); 700 695 701 j("a#mark_as_unread").click( 696 702 function() { … … 705 711 j('tr#m-' + checkboxes[i].value + ' td span.unread-count').html('1'); 706 712 var inboxcount = j('.inbox-count').html(); 707 713 708 714 if ( parseInt(inboxcount) == 0 ) { 709 715 j('.inbox-count').css('display', 'inline'); … … 719 725 } 720 726 } 721 727 722 728 j.post( ajaxurl, { 723 729 action: 'messages_markunread', … … 732 738 } 733 739 }); 734 return false; 735 } 736 ); 737 740 return false; 741 } 742 ); 743 738 744 j("a#delete_inbox_messages").click( 739 745 function() { … … 744 750 if(checkboxes[i].checked) { 745 751 checkboxes_tosend += checkboxes[i].value; 746 752 747 753 if ( j('tr#m-' + checkboxes[i].value).hasClass('unread') ) { 748 754 var inboxcount = j('.inbox-count').html(); 749 755 750 756 if ( parseInt(inboxcount) == 1 ) { 751 757 j('.inbox-count').css('display', 'none'); … … 755 761 } 756 762 } 757 763 758 764 if ( i != checkboxes.length - 1 ) { 759 765 checkboxes_tosend += ',' 760 766 } 761 762 j('tr#m-' + checkboxes[i].value).remove(); 767 768 j('tr#m-' + checkboxes[i].value).remove(); 763 769 } 764 770 } … … 773 779 response = response.substr(0, response.length-1); 774 780 var err_num = response.split('[[split]]'); 775 781 776 782 j('#message').remove(); 777 783 778 784 if ( err_num[0] == "-1" ) { 779 785 // error … … 783 789 } 784 790 }); 785 return false; 786 } 787 ); 788 791 return false; 792 } 793 ); 794 789 795 j("a#delete_sentbox_messages").click( 790 796 function() { 791 797 checkboxes_tosend = ''; 792 798 checkboxes = j("#message-threads tr td input[type='checkbox']"); 793 799 794 800 if ( !checkboxes.length ) return false; 795 801 796 802 for(var i=0; i<checkboxes.length; i++) { 797 803 if(checkboxes[i].checked) { … … 801 807 checkboxes_tosend += ',' 802 808 } 803 j('tr#m-' + checkboxes[i].value).remove(); 809 j('tr#m-' + checkboxes[i].value).remove(); 804 810 } 805 811 } … … 814 820 response = response.substr(0, response.length-1); 815 821 var err_num = response.split('[[split]]'); 816 822 817 823 j('#message').remove(); 818 824 819 825 if ( err_num[0] == "-1" ) { 820 826 // error … … 824 830 } 825 831 }); 826 return false; 827 } 828 ); 829 830 832 return false; 833 } 834 ); 835 836 831 837 j("a#close-notice").click( 832 838 function() { … … 846 852 } 847 853 }); 848 return false; 849 } 850 ); 851 854 return false; 855 } 856 ); 857 852 858 j("select#message-type-select").change( 853 859 function() { … … 880 886 ); 881 887 882 j("form#status-update-form").livequery('submit', 888 j("form#status-update-form").livequery('submit', 883 889 function() { 884 890 j('input#status-update-post').attr( 'disabled', 'disabled' ); 885 891 886 892 j.post( ajaxurl, { 887 893 action: 'status_new_status', … … 891 897 }, 892 898 function(response) { 893 if ( response == "1" ) { 899 if ( response == "1" ) { 894 900 j("div#user-status").slideUp(400, 895 901 function() { … … 898 904 'cookie': encodeURIComponent(document.cookie) 899 905 }, 900 function(response) { 906 function(response) { 901 907 j("div#user-status").html(response); 902 908 j("div#user-status").slideDown(400); 903 909 j(window).unbind('click'); 904 910 }); 905 } 911 } 906 912 ); 907 913 } … … 912 918 ); 913 919 914 j("a#status-clear-status").livequery('click', 920 j("a#status-clear-status").livequery('click', 915 921 function() { 916 922 j.post( ajaxurl, { … … 918 924 'cookie': encodeURIComponent(document.cookie) 919 925 }, 920 function(response) { 921 j("div#user-status").fadeOut(300, 926 function(response) { 927 j("div#user-status").fadeOut(300, 922 928 function() { 923 929 j("div#user-status").html(response); … … 931 937 ); 932 938 933 j("div.status-editable p, a#status-new-status").livequery('click', 939 j("div.status-editable p, a#status-new-status").livequery('click', 934 940 function() { 935 941 j('div.generic-button a#status-new-status').parent().addClass('loading'); 936 942 937 943 j.post( ajaxurl, { 938 944 action: 'status_show_form', 939 945 'cookie': encodeURIComponent(document.cookie) 940 946 }, 941 function(response) { 942 j("div#user-status").slideUp(400, 947 function(response) { 948 j("div#user-status").slideUp(400, 943 949 function() { 944 950 j("div#user-status").html(response); … … 948 954 } 949 955 ); 950 956 951 957 j(window).bind('click', function(ev) { 952 958 if ( !j(ev.target).is('div#user-status') && !j(ev.target).parents('div#user-status').length ) { … … 955 961 'cookie': encodeURIComponent(document.cookie) 956 962 }, 957 function(response) { 958 j("div#user-status").slideUp(400, 963 function(response) { 964 j("div#user-status").slideUp(400, 959 965 function() { 960 966 j("div#user-status").html(response); … … 962 968 } 963 969 ); 964 970 965 971 j(window).unbind('click'); 966 972 }); … … 973 979 ); 974 980 975 j("a#status-clear-status").livequery('click', 981 j("a#status-clear-status").livequery('click', 976 982 function() { 977 983 j(this).addClass('ajax-loader'); 978 984 j(this).attr('style', 'vertical-align: middle; display: inline-block; overflow: hidden; width: 10px; text-indent: -999em' ); 979 985 980 986 j.post( ajaxurl, { 981 987 action: 'status_clear_status', 982 988 'cookie': encodeURIComponent(document.cookie) 983 989 }, 984 function(response) { 985 j("div#user-status").fadeOut(300, 990 function(response) { 991 j("div#user-status").fadeOut(300, 986 992 function() { 987 993 j("div#user-status").html(response); … … 994 1000 } 995 1001 ); 996 997 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 1004 1010 j(this).addClass('selected'); 1005 1011 j("input#blogs_search").val(''); … … 1016 1022 }, 1017 1023 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, 1021 1027 function() { 1022 1028 j('.ajax-loader').toggle(); … … 1026 1032 ); 1027 1033 }); 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"); 1035 1044 1036 1045 j.post( ajaxurl, { … … 1042 1051 }, 1043 1052 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, 1047 1056 function() { 1048 1057 j('.ajax-loader').toggle(); … … 1052 1061 ); 1053 1062 }); 1054 1055 return false; 1056 } 1057 ); 1058 1063 1064 return false; 1065 } 1066 ); 1067 1059 1068 j("div#blog-dir-pag a").livequery('click', 1060 function() { 1069 function() { 1061 1070 j('.ajax-loader').toggle(); 1062 1071 1063 1072 var page = j(this).attr('href'); 1064 1073 page = page.split('bpage='); 1065 1074 1066 1075 if ( undefined === j("input#selected_letter").val() ) 1067 1076 var letter = ''; 1068 1077 else 1069 1078 var letter = j("input#selected_letter").val(); 1070 1079 1071 1080 if ( undefined === j("input#search_terms").val() ) 1072 1081 var search_terms = ''; 1073 1082 else 1074 1083 var search_terms = j("input#search_terms").val(); 1075 1084 1076 1085 j.post( ajaxurl, { 1077 1086 action: 'directory_blogs', … … 1080 1089 'bpage': page[1], 1081 1090 '_wpnonce': j("input#_wpnonce-blog-filter").val(), 1082 1091 1083 1092 'letter': letter, 1084 1093 's': search_terms 1085 1094 }, 1086 1095 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, 1090 1099 function() { 1091 1100 j('.ajax-loader').toggle(); … … 1095 1104 ); 1096 1105 }); 1097 1106 1098 1107 return false; 1099 1108 } … … 1128 1137 radioButtons[i].checked = ''; 1129 1138 } 1130 1139 1131 1140 return; 1132 1141 } -
trunk/bp-themes/bp-sn-parent/directories/blogs/blogs-loop.php
r2077 r2114 50 50 <?php do_action( 'bp_after_directory_blogs_list' ) ?> 51 51 52 <?php bp_the_site_blog_hidden_fields() ?> 53 52 54 <?php else: ?> 53 55 … … 57 59 58 60 <?php endif; ?> 59 60 <?php bp_the_site_blog_hidden_fields() ?> -
trunk/bp-themes/bp-sn-parent/directories/groups/groups-loop.php
r2077 r2114 50 50 <?php do_action( 'bp_after_directory_groups_list' ) ?> 51 51 52 <?php bp_the_site_group_hidden_fields() ?> 53 52 54 <?php else: ?> 53 55 … … 57 59 58 60 <?php endif; ?> 59 60 <?php bp_the_site_group_hidden_fields() ?> -
trunk/bp-themes/bp-sn-parent/directories/members/members-loop.php
r2077 r2114 44 44 <?php do_action( 'bp_after_directory_members_list' ) ?> 45 45 46 <?php bp_the_site_member_hidden_fields() ?> 47 46 48 <?php else: ?> 47 49 … … 51 53 52 54 <?php endif; ?> 53 54 <?php bp_the_site_member_hidden_fields() ?> -
trunk/bp-themes/bp-sn-parent/groups/single/home.php
r2077 r2114 117 117 <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> 118 118 <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() ?> → <?php bp_the_topic_time_since_last_post() ?> ago)</span>119 <span class="small topic-meta">(<?php bp_the_topic_total_post_count() ?> → <?php bp_the_topic_time_since_last_post() ?> <?php _e( 'ago', 'buddypress' ) ?>)</span> 120 120 <span class="small latest topic-excerpt"><?php bp_the_topic_latest_post_excerpt() ?></span> 121 121 -
trunk/bp-themes/bp-sn-parent/messages/compose.php
r2077 r2114 14 14 <?php do_action( 'bp_before_messages_compose_content' ) ?> 15 15 16 <label for="send-to-input"><?php _e("Send To ", 'buddypress') ?> <span class="ajax-loader"></span></label>16 <label for="send-to-input"><?php _e("Send To (Username or Friend's Name)", 'buddypress') ?> <span class="ajax-loader"></span></label> 17 17 <ul class="first acfb-holder"> 18 18 <li> -
trunk/bp-wire/bp-wire-classes.php
r2077 r2114 105 105 106 106 $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 ) ); 108 108 109 109 return array( 'wire_posts' => $wire_posts, 'count' => $count );
Note: See TracChangeset
for help on using the changeset viewer.