BuddyPress - Version 1.2.1

Version Description

Download this release

Release Info

Developer apeatling
Plugin Icon 128x128 BuddyPress
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2 to 1.2.1

bp-activity.php CHANGED
@@ -93,7 +93,7 @@ add_action( 'bp_setup_globals', 'bp_activity_setup_globals' );
93
  function bp_activity_check_installed() {
94
  global $wpdb, $bp;
95
 
96
- if ( $bp->site_options['bp-activity-db-version'] < BP_ACTIVITY_DB_VERSION )
97
  bp_activity_install();
98
  }
99
  add_action( 'admin_menu', 'bp_activity_check_installed' );
@@ -138,7 +138,6 @@ function bp_activity_setup_nav() {
138
  do_action( 'bp_activity_setup_nav' );
139
  }
140
  add_action( 'bp_setup_nav', 'bp_activity_setup_nav' );
141
- add_action( 'admin_menu', 'bp_activity_setup_nav' );
142
 
143
  function bp_activity_directory_activity_setup() {
144
  global $bp;
@@ -589,7 +588,7 @@ function bp_activity_get( $args = '' ) {
589
  if ( 1 == (int)$page && empty( $max ) && empty( $search_terms ) && empty( $filter ) && 'DESC' == $sort ) {
590
  if ( !$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' ) ) {
591
  $activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden );
592
- wp_cache_set( 'bp_activity_sitewide_front', BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden ), 'bp' );
593
  }
594
  } else
595
  $activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden );
@@ -1012,6 +1011,8 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = false ) {
1012
  update_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities', $my_favs );
1013
  bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count );
1014
 
 
 
1015
  return true;
1016
  }
1017
 
@@ -1037,6 +1038,8 @@ function bp_activity_remove_user_favorite( $activity_id, $user_id = false ) {
1037
 
1038
  update_usermeta( $user_id, 'bp_favorite_activities', $my_favs );
1039
 
 
 
1040
  return true;
1041
  }
1042
 
@@ -1110,7 +1113,7 @@ function bp_activity_get_meta( $activity_id, $meta_key = '' ) {
1110
  if ( empty($metas) )
1111
  return false;
1112
 
1113
- $metas = array_map( 'maybe_unserialize', $metas );
1114
 
1115
  if ( 1 == count($metas) )
1116
  return $metas[0];
93
  function bp_activity_check_installed() {
94
  global $wpdb, $bp;
95
 
96
+ if ( get_site_option( 'bp-activity-db-version' ) < BP_ACTIVITY_DB_VERSION )
97
  bp_activity_install();
98
  }
99
  add_action( 'admin_menu', 'bp_activity_check_installed' );
138
  do_action( 'bp_activity_setup_nav' );
139
  }
140
  add_action( 'bp_setup_nav', 'bp_activity_setup_nav' );
 
141
 
142
  function bp_activity_directory_activity_setup() {
143
  global $bp;
588
  if ( 1 == (int)$page && empty( $max ) && empty( $search_terms ) && empty( $filter ) && 'DESC' == $sort ) {
589
  if ( !$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' ) ) {
590
  $activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden );
591
+ wp_cache_set( 'bp_activity_sitewide_front', $activity, 'bp' );
592
  }
593
  } else
594
  $activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden );
1011
  update_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities', $my_favs );
1012
  bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count );
1013
 
1014
+ do_action( 'bp_activity_add_user_favorite', $activity_id, $user_id );
1015
+
1016
  return true;
1017
  }
1018
 
1038
 
1039
  update_usermeta( $user_id, 'bp_favorite_activities', $my_favs );
1040
 
1041
+ do_action( 'bp_activity_remove_user_favorite', $activity_id, $user_id );
1042
+
1043
  return true;
1044
  }
1045
 
1113
  if ( empty($metas) )
1114
  return false;
1115
 
1116
+ $metas = array_map( 'maybe_unserialize', (array)$metas );
1117
 
1118
  if ( 1 == count($metas) )
1119
  return $metas[0];
bp-activity/bp-activity-templatetags.php CHANGED
@@ -190,9 +190,9 @@ function bp_has_activities( $args = '' ) {
190
  if ( 'just-me' == $scope )
191
  $display_comments = 'stream';
192
 
193
- $show_hidden = ( $user_id == $bp->loggedin_user->id ) ? 1 : 0;
194
-
195
  if ( $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id ) {
 
 
196
  switch ( $scope ) {
197
  case 'friends':
198
  if ( function_exists( 'friends_get_friend_user_ids' ) )
@@ -224,7 +224,7 @@ function bp_has_activities( $args = '' ) {
224
  case 'mentions':
225
  $user_nicename = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_nicename : $bp->loggedin_user->userdata->user_nicename;
226
  $user_login = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;
227
- $search_terms = '@' . bp_core_get_username( $user_id, $user_nicename, $user_login );
228
  $display_comments = 'stream';
229
  $user_id = false;
230
  break;
@@ -459,6 +459,15 @@ function bp_activity_content_body() {
459
  return apply_filters( 'bp_get_activity_content_body', $activities_template->activity->content, &$activities_template->activity );
460
  }
461
 
 
 
 
 
 
 
 
 
 
462
  function bp_activity_content() {
463
  echo bp_get_activity_content();
464
  }
@@ -472,7 +481,7 @@ function bp_activity_content() {
472
  * This function is mainly for backwards comptibility.
473
  */
474
 
475
- $content = bp_get_activity_action() . bp_get_activity_content_body();
476
  return apply_filters( 'bp_get_activity_content', $content );
477
  }
478
 
@@ -489,7 +498,7 @@ function bp_activity_content() {
489
  $content .= apply_filters( 'bp_activity_permalink', ' &middot; <a href="' . bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . '" class="view" title="' . __( 'View Thread / Permalink', 'buddypress' ) . '">' . __( 'View', 'buddypress' ) . '</a>', &$activities_template->activity );
490
 
491
  /* Add the delete link if the user has permission on this item */
492
- if ( ( is_user_logged_in() && $activities_template->activity->user_id == $bp->loggedin_user->id ) || $bp->is_item_admin || is_site_admin() )
493
  $content .= apply_filters( 'bp_activity_delete_link', ' &middot; ' . bp_get_activity_delete_link(), &$activities_template->activity );
494
 
495
  return apply_filters( 'bp_insert_activity_meta', $content );
@@ -519,7 +528,7 @@ function bp_activity_parent_content( $args = '' ) {
519
  if ( empty( $activities_template->activity_parents[$parent_id]->content ) )
520
  $content = $activities_template->activity_parents[$parent_id]->action;
521
  else
522
- $content = $activities_template->activity_parents[$parent_id]->action . $activities_template->activity_parents[$parent_id]->content;
523
 
524
  /* Remove the time since content for backwards compatibility */
525
  $content = str_replace( '<span class="time-since">%s</span>', '', $content );
@@ -573,7 +582,7 @@ function bp_activity_comments( $args = '' ) {
573
  $content .= '<span class="acomment-replylink"> &middot; <a href="#acomment-' . $comment->id . '" class="acomment-reply" id="acomment-reply-' . $activities_template->activity->id . '">' . __( 'Reply', 'buddypress' ) . '</a></span>';
574
 
575
  /* Delete link */
576
- if ( is_site_admin() || $bp->loggedin_user->id == $comment->user_id )
577
  $content .= ' &middot; <a href="' . wp_nonce_url( $bp->root_domain . '/' . $bp->activity->slug . '/delete/?cid=' . $comment->id, 'bp_activity_delete_link' ) . '" class="delete acomment-delete">' . __( 'Delete', 'buddypress' ) . '</a>';
578
 
579
  $content .= '</div>';
@@ -936,7 +945,7 @@ function bp_activity_feed_item_description() {
936
  if ( empty( $activities_template->activity->action ) )
937
  $content = $activities_template->activity->content;
938
  else
939
- $content = $activities_template->activity->action . $activities_template->activity->content;
940
 
941
  return apply_filters( 'bp_get_activity_feed_item_description', html_entity_decode( str_replace( '%s', '', $content ) ) );
942
  }
190
  if ( 'just-me' == $scope )
191
  $display_comments = 'stream';
192
 
 
 
193
  if ( $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id ) {
194
+ $show_hidden = ( $user_id == $bp->loggedin_user->id ) ? 1 : 0;
195
+
196
  switch ( $scope ) {
197
  case 'friends':
198
  if ( function_exists( 'friends_get_friend_user_ids' ) )
224
  case 'mentions':
225
  $user_nicename = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_nicename : $bp->loggedin_user->userdata->user_nicename;
226
  $user_login = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;
227
+ $search_terms = '@' . bp_core_get_username( $user_id, $user_nicename, $user_login ) . '<'; // Start search at @ symbol and stop search at closing tag delimiter.
228
  $display_comments = 'stream';
229
  $user_id = false;
230
  break;
459
  return apply_filters( 'bp_get_activity_content_body', $activities_template->activity->content, &$activities_template->activity );
460
  }
461
 
462
+ function bp_activity_has_content() {
463
+ global $activities_template;
464
+
465
+ if ( !empty( $activities_template->activity->content ) )
466
+ return true;
467
+
468
+ return false;
469
+ }
470
+
471
  function bp_activity_content() {
472
  echo bp_get_activity_content();
473
  }
481
  * This function is mainly for backwards comptibility.
482
  */
483
 
484
+ $content = bp_get_activity_action() . ' ' . bp_get_activity_content_body();
485
  return apply_filters( 'bp_get_activity_content', $content );
486
  }
487
 
498
  $content .= apply_filters( 'bp_activity_permalink', ' &middot; <a href="' . bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . '" class="view" title="' . __( 'View Thread / Permalink', 'buddypress' ) . '">' . __( 'View', 'buddypress' ) . '</a>', &$activities_template->activity );
499
 
500
  /* Add the delete link if the user has permission on this item */
501
+ if ( ( is_user_logged_in() && $activities_template->activity->user_id == $bp->loggedin_user->id ) || $bp->is_item_admin || $bp->loggedin_user->is_site_admin )
502
  $content .= apply_filters( 'bp_activity_delete_link', ' &middot; ' . bp_get_activity_delete_link(), &$activities_template->activity );
503
 
504
  return apply_filters( 'bp_insert_activity_meta', $content );
528
  if ( empty( $activities_template->activity_parents[$parent_id]->content ) )
529
  $content = $activities_template->activity_parents[$parent_id]->action;
530
  else
531
+ $content = $activities_template->activity_parents[$parent_id]->action . ' ' . $activities_template->activity_parents[$parent_id]->content;
532
 
533
  /* Remove the time since content for backwards compatibility */
534
  $content = str_replace( '<span class="time-since">%s</span>', '', $content );
582
  $content .= '<span class="acomment-replylink"> &middot; <a href="#acomment-' . $comment->id . '" class="acomment-reply" id="acomment-reply-' . $activities_template->activity->id . '">' . __( 'Reply', 'buddypress' ) . '</a></span>';
583
 
584
  /* Delete link */
585
+ if ( $bp->loggedin_user->is_site_admin || $bp->loggedin_user->id == $comment->user_id )
586
  $content .= ' &middot; <a href="' . wp_nonce_url( $bp->root_domain . '/' . $bp->activity->slug . '/delete/?cid=' . $comment->id, 'bp_activity_delete_link' ) . '" class="delete acomment-delete">' . __( 'Delete', 'buddypress' ) . '</a>';
587
 
588
  $content .= '</div>';
945
  if ( empty( $activities_template->activity->action ) )
946
  $content = $activities_template->activity->content;
947
  else
948
+ $content = $activities_template->activity->action . ' ' . $activities_template->activity->content;
949
 
950
  return apply_filters( 'bp_get_activity_feed_item_description', html_entity_decode( str_replace( '%s', '', $content ) ) );
951
  }
bp-blogs.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- define ( 'BP_BLOGS_DB_VERSION', '2000' );
4
 
5
  /* Define the slug for the component */
6
  if ( !defined( 'BP_BLOGS_SLUG' ) )
@@ -52,13 +52,13 @@ function bp_blogs_install() {
52
  ) {$charset_collate};";
53
 
54
  $sql[] = "CREATE TABLE {$bp->blogs->table_name_blogmeta} (
55
- id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
56
- blog_id bigint(20) NOT NULL,
57
- meta_key varchar(255) DEFAULT NULL,
58
- meta_value longtext DEFAULT NULL,
59
- KEY blog_id (blog_id),
60
- KEY meta_key (meta_key)
61
- ) {$charset_collate};";
62
 
63
 
64
  require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
@@ -80,7 +80,7 @@ function bp_blogs_check_installed() {
80
  /* Only create the bp-blogs tables if this is a multisite install */
81
  if ( is_site_admin() && bp_core_is_multisite() ) {
82
  /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
83
- if ( $bp->site_options['bp-blogs-db-version'] < BP_BLOGS_DB_VERSION )
84
  bp_blogs_install();
85
  }
86
  }
@@ -150,7 +150,6 @@ function bp_blogs_setup_nav() {
150
  do_action( 'bp_blogs_setup_nav' );
151
  }
152
  add_action( 'bp_setup_nav', 'bp_blogs_setup_nav' );
153
- add_action( 'admin_menu', 'bp_blogs_setup_nav' );
154
 
155
  function bp_blogs_directory_blogs_setup() {
156
  global $bp;
@@ -333,9 +332,12 @@ function bp_blogs_get_blogs( $args = '' ) {
333
 
334
 
335
  function bp_blogs_record_existing_blogs() {
336
- global $wpdb;
337
 
338
- $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE public = 1 AND mature = 0 AND spam = 0 AND deleted = 0" ) );
 
 
 
339
 
340
  if ( $blog_ids ) {
341
  foreach( (array)$blog_ids as $blog_id ) {
@@ -362,6 +364,9 @@ function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) {
362
  $name = get_blog_option( $blog_id, 'blogname' );
363
  $description = get_blog_option( $blog_id, 'blogdescription' );
364
 
 
 
 
365
  $recorded_blog = new BP_Blogs_Blog;
366
  $recorded_blog->user_id = $user_id;
367
  $recorded_blog->blog_id = $blog_id;
@@ -545,14 +550,23 @@ function bp_blogs_manage_comment( $comment_id, $comment_status ) {
545
  }
546
  add_action( 'wp_set_comment_status', 'bp_blogs_manage_comment', 10, 2 );
547
 
548
- function bp_blogs_add_user_to_blog( $user_id, $role, $blog_id ) {
549
- if ( $role != 'subscriber' ) {
 
 
 
 
 
550
  bp_blogs_record_blog( $blog_id, $user_id, true );
551
- }
552
  }
553
  add_action( 'add_user_to_blog', 'bp_blogs_add_user_to_blog', 10, 3 );
554
 
555
- function bp_blogs_remove_user_from_blog( $user_id, $blog_id ) {
 
 
 
 
 
556
  bp_blogs_remove_blog_for_user( $user_id, $blog_id );
557
  }
558
  add_action( 'remove_user_from_blog', 'bp_blogs_remove_user_from_blog', 10, 2 );
@@ -662,10 +676,12 @@ function bp_blogs_get_blogs_for_user( $user_id, $show_hidden = false ) {
662
  return BP_Blogs_Blog::get_blogs_for_user( $user_id, $show_hidden );
663
  }
664
 
 
665
  function bp_blogs_get_posts_for_user( $user_id ) {
666
  return BP_Blogs_Post::get_posts_for_user( $user_id );
667
  }
668
 
 
669
  function bp_blogs_get_comments_for_user( $user_id ) {
670
  return BP_Blogs_Comment::get_comments_for_user( $user_id );
671
  }
@@ -774,7 +790,7 @@ function bp_blogs_get_blogmeta( $blog_id, $meta_key = '') {
774
  return '';
775
  }
776
 
777
- $metas = array_map('maybe_unserialize', $metas);
778
 
779
  if ( 1 == count($metas) )
780
  return $metas[0];
1
  <?php
2
 
3
+ define ( 'BP_BLOGS_DB_VERSION', '2015' );
4
 
5
  /* Define the slug for the component */
6
  if ( !defined( 'BP_BLOGS_SLUG' ) )
52
  ) {$charset_collate};";
53
 
54
  $sql[] = "CREATE TABLE {$bp->blogs->table_name_blogmeta} (
55
+ id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
56
+ blog_id bigint(20) NOT NULL,
57
+ meta_key varchar(255) DEFAULT NULL,
58
+ meta_value longtext DEFAULT NULL,
59
+ KEY blog_id (blog_id),
60
+ KEY meta_key (meta_key)
61
+ ) {$charset_collate};";
62
 
63
 
64
  require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
80
  /* Only create the bp-blogs tables if this is a multisite install */
81
  if ( is_site_admin() && bp_core_is_multisite() ) {
82
  /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
83
+ if ( get_site_option( 'bp-blogs-db-version' ) < BP_BLOGS_DB_VERSION )
84
  bp_blogs_install();
85
  }
86
  }
150
  do_action( 'bp_blogs_setup_nav' );
151
  }
152
  add_action( 'bp_setup_nav', 'bp_blogs_setup_nav' );
 
153
 
154
  function bp_blogs_directory_blogs_setup() {
155
  global $bp;
332
 
333
 
334
  function bp_blogs_record_existing_blogs() {
335
+ global $bp, $wpdb;
336
 
337
+ /* Truncate user blogs table and re-record. */
338
+ $wpdb->query( "TRUNCATE TABLE {$bp->blogs->table_name}" );
339
+
340
+ $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0" ) );
341
 
342
  if ( $blog_ids ) {
343
  foreach( (array)$blog_ids as $blog_id ) {
364
  $name = get_blog_option( $blog_id, 'blogname' );
365
  $description = get_blog_option( $blog_id, 'blogdescription' );
366
 
367
+ if ( empty( $name ) )
368
+ return false;
369
+
370
  $recorded_blog = new BP_Blogs_Blog;
371
  $recorded_blog->user_id = $user_id;
372
  $recorded_blog->blog_id = $blog_id;
550
  }
551
  add_action( 'wp_set_comment_status', 'bp_blogs_manage_comment', 10, 2 );
552
 
553
+ function bp_blogs_add_user_to_blog( $user_id, $role, $blog_id = false ) {
554
+ global $current_blog;
555
+
556
+ if ( empty( $blog_id ) )
557
+ $blog_id = $current_blog->blog_id;
558
+
559
+ if ( $role != 'subscriber' )
560
  bp_blogs_record_blog( $blog_id, $user_id, true );
 
561
  }
562
  add_action( 'add_user_to_blog', 'bp_blogs_add_user_to_blog', 10, 3 );
563
 
564
+ function bp_blogs_remove_user_from_blog( $user_id, $blog_id = false ) {
565
+ global $current_blog;
566
+
567
+ if ( empty( $blog_id ) )
568
+ $blog_id = $current_blog->blog_id;
569
+
570
  bp_blogs_remove_blog_for_user( $user_id, $blog_id );
571
  }
572
  add_action( 'remove_user_from_blog', 'bp_blogs_remove_user_from_blog', 10, 2 );
676
  return BP_Blogs_Blog::get_blogs_for_user( $user_id, $show_hidden );
677
  }
678
 
679
+ /* DEPRECATED - scheduled for removal. Please use the activity stream with a 'new_blog_post' filter. */
680
  function bp_blogs_get_posts_for_user( $user_id ) {
681
  return BP_Blogs_Post::get_posts_for_user( $user_id );
682
  }
683
 
684
+ /* DEPRECATED - scheduled for removal. Please use the activity stream with a 'new_blog_comment' filter. */
685
  function bp_blogs_get_comments_for_user( $user_id ) {
686
  return BP_Blogs_Comment::get_comments_for_user( $user_id );
687
  }
790
  return '';
791
  }
792
 
793
+ $metas = array_map('maybe_unserialize', (array)$metas);
794
 
795
  if ( 1 == count($metas) )
796
  return $metas[0];
bp-blogs/bp-blogs-classes.php CHANGED
@@ -101,10 +101,10 @@ Class BP_Blogs_Blog {
101
 
102
  if ( !empty( $search_terms ) ) {
103
  $filter = like_escape( $wpdb->escape( $search_terms ) );
104
- $paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name, bm3.meta_value as description FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$bp->blogs->table_name_blogmeta} bm3, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND b.blog_id = bm3.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm3.meta_key = 'description' AND ( bm2.meta_value LIKE '%%$filter%%' || bm3.meta_value LIKE '%%$filter%%' ) {$user_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
105
  $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND bm.blog_id = b.blog_id AND bm2.blog_id = b.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'name' AND bm2.meta_key = 'description' AND ( bm.meta_value LIKE '%%$filter%%' || bm2.meta_value LIKE '%%$filter%%' ) {$user_sql}" );
106
  } else {
107
- $paged_blogs = $wpdb->get_results( $wpdb->prepare( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name, bm3.meta_value as description FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$bp->blogs->table_name_blogmeta} bm3, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND b.blog_id = bm3.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm3.meta_key = 'description' GROUP BY b.blog_id {$order_sql} {$pag_sql}" ) );
108
  $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb WHERE b.blog_id = wb.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql}" ) );
109
  }
110
 
@@ -161,9 +161,9 @@ Class BP_Blogs_Blog {
161
 
162
  // Show logged in users their hidden blogs.
163
  if ( !bp_is_my_profile() && !$show_hidden )
164
- $blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.id, bm1.meta_value as name, bm2.meta_value as description, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND b.blog_id = bm2.blog_id AND bm1.meta_key = 'name' AND bm2.meta_key = 'description' AND wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND b.user_id = %d ORDER BY b.id", $user_id) );
165
  else
166
- $blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.id, bm1.meta_value as name, bm2.meta_value as description, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND b.blog_id = bm2.blog_id AND bm1.meta_key = 'name' AND bm2.meta_key = 'description' AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND b.user_id = %d ORDER BY b.id", $user_id) );
167
 
168
  $total_blog_count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );
169
 
@@ -172,7 +172,6 @@ Class BP_Blogs_Blog {
172
  $user_blogs[$blog->id]->id = $blog->id;
173
  $user_blogs[$blog->id]->siteurl = ( is_ssl() ) ? 'https://' . $blog->domain . $blog->path : 'http://' . $blog->domain . $blog->path;
174
  $user_blogs[$blog->id]->name = $blog->name;
175
- $user_blogs[$blog->id]->description = $blog->description;
176
  }
177
 
178
  return array( 'blogs' => $user_blogs, 'count' => $total_blog_count );
@@ -209,10 +208,10 @@ Class BP_Blogs_Blog {
209
  $user_id = $bp->displayed_user->id;
210
 
211
  // If the user is logged in return the blog count including their hidden blogs.
212
- if ( !is_user_logged_in() || $user_id != $bp->loggedin_user->id )
213
- 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) );
214
- else
215
  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) );
 
 
216
  }
217
 
218
  function search_blogs( $filter, $limit = null, $page = null ) {
@@ -290,6 +289,16 @@ Class BP_Blogs_Blog {
290
  }
291
  }
292
 
 
 
 
 
 
 
 
 
 
 
293
  return $paged_blogs;
294
  }
295
 
@@ -306,6 +315,7 @@ Class BP_Blogs_Blog {
306
  }
307
  }
308
 
 
309
  Class BP_Blogs_Post {
310
  var $id;
311
  var $user_id;
@@ -513,6 +523,7 @@ Class BP_Blogs_Post {
513
 
514
  }
515
 
 
516
  Class BP_Blogs_Comment {
517
  var $id;
518
  var $user_id;
101
 
102
  if ( !empty( $search_terms ) ) {
103
  $filter = like_escape( $wpdb->escape( $search_terms ) );
104
+ $paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm2.meta_value LIKE '%%$filter%%' {$user_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
105
  $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND bm.blog_id = b.blog_id AND bm2.blog_id = b.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'name' AND bm2.meta_key = 'description' AND ( bm.meta_value LIKE '%%$filter%%' || bm2.meta_value LIKE '%%$filter%%' ) {$user_sql}" );
106
  } else {
107
+ $paged_blogs = $wpdb->get_results( $wpdb->prepare( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' GROUP BY b.blog_id {$order_sql} {$pag_sql}" ) );
108
  $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb WHERE b.blog_id = wb.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql}" ) );
109
  }
110
 
161
 
162
  // Show logged in users their hidden blogs.
163
  if ( !bp_is_my_profile() && !$show_hidden )
164
+ $blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.id, bm1.meta_value as name, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND bm1.meta_key = 'name' AND wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND b.user_id = %d ORDER BY b.id", $user_id ) );
165
  else
166
+ $blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.id, bm1.meta_value as name, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND bm1.meta_key = 'name' AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND b.user_id = %d ORDER BY b.id", $user_id ) );
167
 
168
  $total_blog_count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );
169
 
172
  $user_blogs[$blog->id]->id = $blog->id;
173
  $user_blogs[$blog->id]->siteurl = ( is_ssl() ) ? 'https://' . $blog->domain . $blog->path : 'http://' . $blog->domain . $blog->path;
174
  $user_blogs[$blog->id]->name = $blog->name;
 
175
  }
176
 
177
  return array( 'blogs' => $user_blogs, 'count' => $total_blog_count );
208
  $user_id = $bp->displayed_user->id;
209
 
210
  // If the user is logged in return the blog count including their hidden blogs.
211
+ if ( ( is_user_logged_in() && $user_id == $bp->loggedin_user->id ) || is_site_admin() )
 
 
212
  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) );
213
+ else
214
+ 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) );
215
  }
216
 
217
  function search_blogs( $filter, $limit = null, $page = null ) {
289
  }
290
  }
291
 
292
+ /* Fetch the blog description for each blog (as it may be empty we can't fetch it in the main query). */
293
+ $blog_descs = $wpdb->get_results( $wpdb->prepare( "SELECT blog_id, meta_value as description FROM {$bp->blogs->table_name_blogmeta} WHERE meta_key = 'description' AND blog_id IN ( {$blog_ids} )" ) );
294
+
295
+ for ( $i = 0; $i < count( $paged_blogs ); $i++ ) {
296
+ foreach ( (array)$blog_descs as $desc ) {
297
+ if ( $desc->blog_id == $paged_blogs[$i]->blog_id )
298
+ $paged_blogs[$i]->description = $desc->description;
299
+ }
300
+ }
301
+
302
  return $paged_blogs;
303
  }
304
 
315
  }
316
  }
317
 
318
+ /* DEPRECATED - Post DB recording is scheduled for removal. Please use the activity stream to fetch a user's posts. */
319
  Class BP_Blogs_Post {
320
  var $id;
321
  var $user_id;
523
 
524
  }
525
 
526
+ /* DEPRECATED - Comment DB recording is scheduled for removal. Please use the activity stream to fetch a user's comments. */
527
  Class BP_Blogs_Comment {
528
  var $id;
529
  var $user_id;
bp-core.php CHANGED
@@ -106,6 +106,9 @@ function bp_core_setup_globals() {
106
  /* The core userdata of the user who is currently logged in. */
107
  $bp->loggedin_user->userdata = bp_core_get_core_userdata( $bp->loggedin_user->id );
108
 
 
 
 
109
  /* The user id of the user currently being viewed, set in /bp-core/bp-core-catchuri.php */
110
  $bp->displayed_user->id = $displayed_user_id;
111
 
@@ -266,7 +269,7 @@ function bp_core_check_installed() {
266
  require ( BP_PLUGIN_DIR . '/bp-core/bp-core-admin.php' );
267
 
268
  /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
269
- if ( $bp->site_options['bp-core-db-version'] < BP_CORE_DB_VERSION )
270
  bp_core_install();
271
  }
272
  add_action( 'admin_menu', 'bp_core_check_installed' );
@@ -371,8 +374,6 @@ function bp_core_setup_nav() {
371
  }
372
  }
373
  add_action( 'bp_setup_nav', 'bp_core_setup_nav' );
374
- add_action( 'admin_menu', 'bp_core_setup_nav' );
375
-
376
 
377
  /********************************************************************************
378
  * Action Functions
@@ -1561,13 +1562,6 @@ function bp_core_get_site_options() {
1561
  global $bp, $wpdb;
1562
 
1563
  $options = apply_filters( 'bp_core_site_options', array(
1564
- 'bp-core-db-version',
1565
- 'bp-activity-db-version',
1566
- 'bp-blogs-db-version',
1567
- 'bp-friends-db-version',
1568
- 'bp-groups-db-version',
1569
- 'bp-messages-db-version',
1570
- 'bp-xprofile-db-version',
1571
  'bp-deactivated-components',
1572
  'bp-blogs-first-install',
1573
  'bp-disable-blog-forum-comments',
@@ -2049,9 +2043,10 @@ function bp_core_activation_notice() {
2049
  /* Get current theme info */
2050
  $ct = current_theme_info();
2051
 
2052
- if ( !in_array( 'buddypress', (array)$ct->tags ) ) { ?>
 
2053
  <div id="message" class="updated fade">
2054
- <p style="line-height: 150%"><?php printf( __( "<strong>BuddyPress is ready</strong>. You'll need to <a href='%s'>activate a BuddyPress compatible theme</a> to take advantage of all of the features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a>.", 'buddypress' ), admin_url( 'themes.php' ), admin_url( 'theme-install.php?type=tag&s=buddypress&tab=search' ) ) ?></p>
2055
  </div><?php
2056
  }
2057
  }
106
  /* The core userdata of the user who is currently logged in. */
107
  $bp->loggedin_user->userdata = bp_core_get_core_userdata( $bp->loggedin_user->id );
108
 
109
+ /* is_site_admin() hits the DB on single WP installs, so we need to get this separately so we can call it in a loop. */
110
+ $bp->loggedin_user->is_site_admin = is_site_admin();
111
+
112
  /* The user id of the user currently being viewed, set in /bp-core/bp-core-catchuri.php */
113
  $bp->displayed_user->id = $displayed_user_id;
114
 
269
  require ( BP_PLUGIN_DIR . '/bp-core/bp-core-admin.php' );
270
 
271
  /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
272
+ if ( get_site_option( 'bp-core-db-version' ) < BP_CORE_DB_VERSION )
273
  bp_core_install();
274
  }
275
  add_action( 'admin_menu', 'bp_core_check_installed' );
374
  }
375
  }
376
  add_action( 'bp_setup_nav', 'bp_core_setup_nav' );
 
 
377
 
378
  /********************************************************************************
379
  * Action Functions
1562
  global $bp, $wpdb;
1563
 
1564
  $options = apply_filters( 'bp_core_site_options', array(
 
 
 
 
 
 
 
1565
  'bp-deactivated-components',
1566
  'bp-blogs-first-install',
1567
  'bp-disable-blog-forum-comments',
2043
  /* Get current theme info */
2044
  $ct = current_theme_info();
2045
 
2046
+ /* The best way to remove this notice is to add a "buddypress" tag to your active theme's CSS header. */
2047
+ if ( !defined( 'BP_SILENCE_THEME_NOTICE' ) && !in_array( 'buddypress', (array)$ct->tags ) ) { ?>
2048
  <div id="message" class="updated fade">
2049
+ <p style="line-height: 150%"><?php printf( __( "<strong>BuddyPress is ready</strong>. You'll need to <a href='%s'>activate a BuddyPress compatible theme</a> to take advantage of all of the features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>upgrade your existing WordPress theme</a>.", 'buddypress' ), admin_url( 'themes.php' ), admin_url( 'theme-install.php?type=tag&s=buddypress&tab=search' ), admin_url( 'plugin-install.php?type=term&tab=search&s=bp-template-pack' ) ) ?></p>
2050
  </div><?php
2051
  }
2052
  }
bp-core/bp-core-activation.php CHANGED
@@ -75,25 +75,37 @@ function bp_core_screen_activation() {
75
  }
76
  add_action( 'wp', 'bp_core_screen_activation', 3 );
77
 
78
-
79
  /***
80
- * bp_core_disable_welcome_email()
81
- *
82
- * Since the user now chooses their password, sending it over clear-text to an
83
- * email address is no longer necessary. It's also a terrible idea security wise.
84
  *
85
- * The only exception to this is when an admin has generated an account for a user.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  *
87
- * This will only disable the email if a custom registration template is being used.
 
88
  */
89
- function bp_core_disable_welcome_email() {
 
90
  if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) )
91
- return true;
92
 
93
- return false;
94
  }
95
  if ( !is_admin() && empty( $_GET['e'] ) )
96
- add_filter( 'wpmu_welcome_user_notification', 'bp_core_disable_welcome_email' );
97
 
98
  // Notify user of signup success.
99
  function bp_core_activation_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta ) {
75
  }
76
  add_action( 'wp', 'bp_core_screen_activation', 3 );
77
 
 
78
  /***
79
+ * bp_core_filter_user_welcome_email()
 
 
 
80
  *
81
+ * Replace the generated password in the welcome email.
82
+ * This will not filter when the site admin registers a user.
83
+ */
84
+ function bp_core_filter_user_welcome_email( $welcome_email ) {
85
+ /* Don't touch the email if we don't have a custom registration template */
86
+ if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) )
87
+ return $welcome_email;
88
+
89
+ return str_replace( 'PASSWORD', __( '[User Set]', 'buddypress' ), $welcome_email );
90
+ }
91
+ if ( !is_admin() && empty( $_GET['e'] ) )
92
+ add_filter( 'update_welcome_user_email', 'bp_core_filter_user_welcome_email' );
93
+
94
+ /***
95
+ * bp_core_filter_blog_welcome_email()
96
  *
97
+ * Replace the generated password in the welcome email.
98
+ * This will not filter when the site admin registers a user.
99
  */
100
+ function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) {
101
+ /* Don't touch the email if we don't have a custom registration template */
102
  if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) )
103
+ return $welcome_email;
104
 
105
+ return str_replace( $password, __( '[User Set]', 'buddypress' ), $welcome_email );
106
  }
107
  if ( !is_admin() && empty( $_GET['e'] ) )
108
+ add_filter( 'update_welcome_email', 'bp_core_filter_blog_welcome_email', 10, 4 );
109
 
110
  // Notify user of signup success.
111
  function bp_core_activation_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta ) {
bp-core/bp-core-adminbar.php CHANGED
@@ -91,7 +91,7 @@ function bp_adminbar_account_menu() {
91
 
92
  $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
93
 
94
- echo '<li' . $alt . '><a id="bp-admin-logout" class="logout" href="' . wp_logout_url(site_url()) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
95
  echo '</ul>';
96
  echo '</li>';
97
  }
@@ -119,15 +119,16 @@ function bp_adminbar_blogs_menu() {
119
  $counter = 0;
120
  foreach ( (array)$blogs['blogs'] as $blog ) {
121
  $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
 
122
 
123
  echo '<li' . $alt . '>';
124
- echo '<a href="' . esc_attr( $blog->siteurl ) . '">' . esc_html( $blog->name ) . '</a>';
125
 
126
  echo '<ul>';
127
- echo '<li class="alt"><a href="' . esc_attr( $blog->siteurl ) . 'wp-admin/">' . __( 'Dashboard', 'buddypress' ) . '</a></li>';
128
- echo '<li><a href="' . esc_attr( $blog->siteurl ) . 'wp-admin/post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
129
- echo '<li class="alt"><a href="' . esc_attr( $blog->siteurl ) . 'wp-admin/edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
130
- echo '<li><a href="' . esc_attr( $blog->siteurl ) . 'wp-admin/edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
131
  echo '</ul>';
132
 
133
  echo '</li>';
91
 
92
  $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
93
 
94
+ echo '<li' . $alt . '><a id="bp-admin-logout" class="logout" href="' . wp_logout_url( site_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
95
  echo '</ul>';
96
  echo '</li>';
97
  }
119
  $counter = 0;
120
  foreach ( (array)$blogs['blogs'] as $blog ) {
121
  $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
122
+ $site_url = esc_attr( $blog->siteurl );
123
 
124
  echo '<li' . $alt . '>';
125
+ echo '<a href="' . $site_url . '">' . esc_html( $blog->name ) . '</a>';
126
 
127
  echo '<ul>';
128
+ echo '<li class="alt"><a href="' . $site_url . 'wp-admin/">' . __( 'Dashboard', 'buddypress' ) . '</a></li>';
129
+ echo '<li><a href="' . $site_url . 'wp-admin/post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
130
+ echo '<li class="alt"><a href="' . $site_url . 'wp-admin/edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
131
+ echo '<li><a href="' . $site_url . 'wp-admin/edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
132
  echo '</ul>';
133
 
134
  echo '</li>';
bp-core/bp-core-templatetags.php CHANGED
@@ -1590,6 +1590,15 @@ function bp_is_group_forum() {
1590
  return false;
1591
  }
1592
 
 
 
 
 
 
 
 
 
 
1593
  function bp_is_group_forum_topic() {
1594
  global $bp;
1595
 
1590
  return false;
1591
  }
1592
 
1593
+ function bp_is_group_activity() {
1594
+ global $bp;
1595
+
1596
+ if ( BP_GROUPS_SLUG == $bp->current_component && $bp->is_single_item && 'activity' == $bp->current_action )
1597
+ return true;
1598
+
1599
+ return false;
1600
+ }
1601
+
1602
  function bp_is_group_forum_topic() {
1603
  global $bp;
1604
 
bp-core/bp-core-wpabstraction.php CHANGED
@@ -96,7 +96,6 @@ if ( !function_exists( 'wpmu_validate_user_signup' ) ) {
96
 
97
  $errors = new WP_Error();
98
 
99
- $user_name = preg_replace( "/\s+/", '', sanitize_user( $user_name, true ) );
100
  $user_email = sanitize_email( $user_email );
101
 
102
  if ( empty( $user_name ) )
@@ -105,17 +104,14 @@ if ( !function_exists( 'wpmu_validate_user_signup' ) ) {
105
  $maybe = array();
106
  preg_match( "/[a-z0-9]+/", $user_name, $maybe );
107
 
108
- if( $user_name != $maybe[0] ) {
109
- $errors->add('user_name', __("Only lowercase letters and numbers allowed"));
110
- }
111
-
112
  $illegal_names = get_site_option( "illegal_names" );
113
  if( is_array( $illegal_names ) == false ) {
114
  $illegal_names = array( "www", "web", "root", "admin", "main", "invite", "administrator" );
115
  add_site_option( "illegal_names", $illegal_names );
116
  }
117
- if( in_array( $user_name, $illegal_names ) == true ) {
118
- $errors->add('user_name', __("That username is not allowed"));
 
119
  }
120
 
121
  if( strlen( $user_name ) < 4 ) {
96
 
97
  $errors = new WP_Error();
98
 
 
99
  $user_email = sanitize_email( $user_email );
100
 
101
  if ( empty( $user_name ) )
104
  $maybe = array();
105
  preg_match( "/[a-z0-9]+/", $user_name, $maybe );
106
 
 
 
 
 
107
  $illegal_names = get_site_option( "illegal_names" );
108
  if( is_array( $illegal_names ) == false ) {
109
  $illegal_names = array( "www", "web", "root", "admin", "main", "invite", "administrator" );
110
  add_site_option( "illegal_names", $illegal_names );
111
  }
112
+
113
+ if ( !validate_username( $user_name ) || in_array( $user_name, $illegal_names ) == true || $user_name != $maybe[0] ) {
114
+ $errors->add('user_name', __("Only lowercase letters and numbers allowed"));
115
  }
116
 
117
  if( strlen( $user_name ) < 4 ) {
bp-forums/bp-forums-filters.php CHANGED
@@ -28,12 +28,17 @@ add_filter( 'bp_get_the_topic_latest_post_excerpt', 'wpautop' );
28
  add_filter( 'bp_get_the_topic_post_content', 'stripslashes_deep' );
29
  add_filter( 'bp_get_the_topic_title', 'stripslashes_deep' );
30
  add_filter( 'bp_get_the_topic_latest_post_excerpt', 'stripslashes_deep' );
 
 
31
 
32
  add_filter( 'bp_get_the_topic_post_content', 'make_clickable' );
33
 
34
  add_filter( 'bp_get_forum_topic_count_for_user', 'bp_core_number_format' );
35
  add_filter( 'bp_get_forum_topic_count', 'bp_core_number_format' );
36
 
 
 
 
37
 
38
  function bp_forums_filter_kses( $content ) {
39
  global $allowedtags;
@@ -69,4 +74,13 @@ function bp_forums_filter_tag_link( $link, $tag, $page, $context ) {
69
  }
70
  add_filter( 'bb_get_tag_link', 'bp_forums_filter_tag_link', 10, 4);
71
 
 
 
 
 
 
 
 
 
 
72
  ?>
28
  add_filter( 'bp_get_the_topic_post_content', 'stripslashes_deep' );
29
  add_filter( 'bp_get_the_topic_title', 'stripslashes_deep' );
30
  add_filter( 'bp_get_the_topic_latest_post_excerpt', 'stripslashes_deep' );
31
+ add_filter( 'bp_get_the_topic_poster_name', 'stripslashes_deep' );
32
+ add_filter( 'bp_get_the_topic_last_poster_name', 'stripslashes_deep' );
33
 
34
  add_filter( 'bp_get_the_topic_post_content', 'make_clickable' );
35
 
36
  add_filter( 'bp_get_forum_topic_count_for_user', 'bp_core_number_format' );
37
  add_filter( 'bp_get_forum_topic_count', 'bp_core_number_format' );
38
 
39
+ add_filter( 'bp_get_the_topic_title', 'bp_forums_make_nofollow_filter' );
40
+ add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_forums_make_nofollow_filter' );
41
+ add_filter( 'bp_get_the_topic_post_content', 'bp_forums_make_nofollow_filter' );
42
 
43
  function bp_forums_filter_kses( $content ) {
44
  global $allowedtags;
74
  }
75
  add_filter( 'bb_get_tag_link', 'bp_forums_filter_tag_link', 10, 4);
76
 
77
+ function bp_forums_make_nofollow_filter( $text ) {
78
+ return preg_replace_callback( '|<a (.+?)>|i', 'bp_forums_make_nofollow_filter_callback', $text );
79
+ }
80
+ function bp_forums_make_nofollow_filter_callback( $matches ) {
81
+ $text = $matches[1];
82
+ $text = str_replace( array( ' rel="nofollow"', " rel='nofollow'"), '', $text );
83
+ return "<a $text rel=\"nofollow\">";
84
+ }
85
+
86
  ?>
bp-forums/bp-forums-templatetags.php CHANGED
@@ -881,7 +881,7 @@ function bp_the_topic_post_poster_link() {
881
  function bp_get_the_topic_post_poster_link() {
882
  global $topic_template;
883
 
884
- return apply_filters( 'bp_get_the_topic_post_poster_name', bp_core_get_user_domain( $topic_template->post->poster_id, $topic_template->post->poster_nicename, $topic_template->post->poster_login ) );
885
  }
886
 
887
  function bp_the_topic_post_time_since() {
881
  function bp_get_the_topic_post_poster_link() {
882
  global $topic_template;
883
 
884
+ return apply_filters( 'bp_the_topic_post_poster_link', bp_core_get_user_domain( $topic_template->post->poster_id, $topic_template->post->poster_nicename, $topic_template->post->poster_login ) );
885
  }
886
 
887
  function bp_the_topic_post_time_since() {
bp-friends.php CHANGED
@@ -56,7 +56,7 @@ function friends_check_installed() {
56
  return false;
57
 
58
  /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
59
- if ( $bp->site_options['bp-friends-db-version'] < BP_FRIENDS_DB_VERSION )
60
  friends_install();
61
  }
62
  add_action( 'admin_menu', 'friends_check_installed' );
@@ -84,9 +84,7 @@ function friends_setup_nav() {
84
 
85
  do_action( 'friends_setup_nav' );
86
  }
87
- add_action( 'wp', 'friends_setup_nav', 2 );
88
- add_action( 'admin_menu', 'friends_setup_nav', 2 );
89
-
90
 
91
  /********************************************************************************
92
  * Screen Functions
56
  return false;
57
 
58
  /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
59
+ if ( get_site_option( 'bp-friends-db-version' ) < BP_FRIENDS_DB_VERSION )
60
  friends_install();
61
  }
62
  add_action( 'admin_menu', 'friends_check_installed' );
84
 
85
  do_action( 'friends_setup_nav' );
86
  }
87
+ add_action( 'bp_setup_nav', 'friends_setup_nav' );
 
 
88
 
89
  /********************************************************************************
90
  * Screen Functions
bp-groups.php CHANGED
@@ -108,7 +108,7 @@ add_action( 'bp_setup_root_components', 'groups_setup_root_component' );
108
 
109
  function groups_check_installed() {
110
  /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
111
- if ( $bp->site_options['bp-groups-db-version'] < BP_GROUPS_DB_VERSION )
112
  groups_install();
113
  }
114
  add_action( 'admin_menu', 'groups_check_installed' );
@@ -218,7 +218,6 @@ function groups_setup_nav() {
218
  do_action( 'groups_setup_nav', $bp->groups->current_group->user_has_access );
219
  }
220
  add_action( 'bp_setup_nav', 'groups_setup_nav' );
221
- add_action( 'admin_menu', 'groups_setup_nav' );
222
 
223
  function groups_directory_groups_setup() {
224
  global $bp;
@@ -1230,7 +1229,7 @@ add_action( 'wp', 'groups_action_redirect_to_random_group', 6 );
1230
  function groups_action_group_feed() {
1231
  global $bp, $wp_query;
1232
 
1233
- if ( $bp->current_component != $bp->groups->slug || !$bp->groups->current_group || $bp->current_action != 'feed' )
1234
  return false;
1235
 
1236
  $wp_query->is_404 = false;
@@ -1296,7 +1295,7 @@ function groups_record_activity( $args = '' ) {
1296
  );
1297
 
1298
  $r = wp_parse_args( $args, $defaults );
1299
- extract( $r, EXTR_SKIP );
1300
 
1301
  return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );
1302
  }
@@ -2451,7 +2450,7 @@ function groups_get_groupmeta( $group_id, $meta_key = '') {
2451
  return '';
2452
  }
2453
 
2454
- $metas = array_map('maybe_unserialize', $metas);
2455
 
2456
  if ( 1 == count($metas) )
2457
  return $metas[0];
108
 
109
  function groups_check_installed() {
110
  /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
111
+ if ( get_site_option( 'bp-groups-db-version' ) < BP_GROUPS_DB_VERSION )
112
  groups_install();
113
  }
114
  add_action( 'admin_menu', 'groups_check_installed' );
218
  do_action( 'groups_setup_nav', $bp->groups->current_group->user_has_access );
219
  }
220
  add_action( 'bp_setup_nav', 'groups_setup_nav' );
 
221
 
222
  function groups_directory_groups_setup() {
223
  global $bp;
1229
  function groups_action_group_feed() {
1230
  global $bp, $wp_query;
1231
 
1232
+ if ( !bp_is_active( 'activity' ) || $bp->current_component != $bp->groups->slug || !$bp->groups->current_group || $bp->current_action != 'feed' )
1233
  return false;
1234
 
1235
  $wp_query->is_404 = false;
1295
  );
1296
 
1297
  $r = wp_parse_args( $args, $defaults );
1298
+ extract( $r );
1299
 
1300
  return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );
1301
  }
2450
  return '';
2451
  }
2452
 
2453
+ $metas = array_map('maybe_unserialize', (array)$metas);
2454
 
2455
  if ( 1 == count($metas) )
2456
  return $metas[0];
bp-groups/bp-groups-classes.php CHANGED
@@ -1136,7 +1136,7 @@ class BP_Group_Extension {
1136
  if ( $this->visbility == 'public' || ( $this->visbility != 'public' && $bp->groups->current_group->user_has_access ) ) {
1137
  if ( $this->enable_nav_item ) {
1138
  if ( $bp->current_component == $bp->groups->slug && $bp->is_single_item )
1139
- bp_core_new_subnav_item( array( 'name' => ( !$this->nav_item_name ) ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => BP_GROUPS_SLUG, 'parent_url' => bp_get_group_permalink( $bp->groups->current_group ) . '/', 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array( &$this, '_display_hook' ), 'user_has_access' => $this->enable_nav_item ) );
1140
 
1141
  /* When we are viewing the extension display page, set the title and options title */
1142
  if ( $bp->current_component == $bp->groups->slug && $bp->is_single_item && $bp->current_action == $this->slug ) {
@@ -1164,7 +1164,7 @@ function bp_register_group_extension( $group_extension_class ) {
1164
  return false;
1165
 
1166
  /* Register the group extension on the plugins_loaded action so we have access to all plugins */
1167
- add_action( 'plugins_loaded', create_function( '', '$extension = new ' . $group_extension_class . '; add_action( "wp", array( &$extension, "_register" ), 2 );' ) );
1168
  }
1169
 
1170
 
1136
  if ( $this->visbility == 'public' || ( $this->visbility != 'public' && $bp->groups->current_group->user_has_access ) ) {
1137
  if ( $this->enable_nav_item ) {
1138
  if ( $bp->current_component == $bp->groups->slug && $bp->is_single_item )
1139
+ bp_core_new_subnav_item( array( 'name' => ( !$this->nav_item_name ) ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => BP_GROUPS_SLUG, 'parent_url' => bp_get_group_permalink( $bp->groups->current_group ), 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array( &$this, '_display_hook' ), 'user_has_access' => $this->enable_nav_item ) );
1140
 
1141
  /* When we are viewing the extension display page, set the title and options title */
1142
  if ( $bp->current_component == $bp->groups->slug && $bp->is_single_item && $bp->current_action == $this->slug ) {
1164
  return false;
1165
 
1166
  /* Register the group extension on the plugins_loaded action so we have access to all plugins */
1167
+ add_action( 'bp_init', create_function( '', '$extension = new ' . $group_extension_class . '; add_action( "wp", array( &$extension, "_register" ), 2 );' ), 11 );
1168
  }
1169
 
1170
 
bp-groups/bp-groups-filters.php CHANGED
@@ -28,6 +28,8 @@ add_filter( 'groups_group_description_before_save', 'wp_filter_kses', 1 );
28
  add_filter( 'bp_get_group_description', 'stripslashes' );
29
  add_filter( 'bp_get_group_description_excerpt', 'stripslashes' );
30
  add_filter( 'bp_get_group_name', 'stripslashes' );
 
 
31
 
32
  add_filter( 'groups_new_group_forum_desc', 'bp_create_excerpt' );
33
 
28
  add_filter( 'bp_get_group_description', 'stripslashes' );
29
  add_filter( 'bp_get_group_description_excerpt', 'stripslashes' );
30
  add_filter( 'bp_get_group_name', 'stripslashes' );
31
+ add_filter( 'bp_get_group_member_name', 'stripslashes' );
32
+ add_filter( 'bp_get_group_member_link', 'stripslashes' );
33
 
34
  add_filter( 'groups_new_group_forum_desc', 'bp_create_excerpt' );
35
 
bp-groups/bp-groups-templatetags.php CHANGED
@@ -192,6 +192,9 @@ function bp_the_group() {
192
  function bp_group_is_visible( $group = false ) {
193
  global $bp, $groups_template;
194
 
 
 
 
195
  if ( !$group )
196
  $group =& $groups_template->group;
197
 
192
  function bp_group_is_visible( $group = false ) {
193
  global $bp, $groups_template;
194
 
195
+ if ( $bp->loggedin_user->is_site_admin )
196
+ return true;
197
+
198
  if ( !$group )
199
  $group =& $groups_template->group;
200
 
bp-languages/buddypress.pot CHANGED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: BuddyPress \n"
10
  "Report-Msgid-Bugs-To: wp-polyglots@lists.automattic.com\n"
11
- "POT-Creation-Date: 2010-02-15 14:11+0000\n"
12
  "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -86,68 +86,68 @@ msgstr ""
86
  msgid "A member replies to an update or comment you've posted"
87
  msgstr ""
88
 
89
- #: bp-activity.php:352
90
  msgid "Activity deleted"
91
  msgstr ""
92
 
93
- #: bp-activity.php:354
94
  msgid "There was an error when deleting that activity"
95
  msgstr ""
96
 
97
- #: bp-activity.php:376 bp-themes/bp-default/_inc/ajax.php:124
98
  msgid "Please enter some content to post."
99
  msgstr ""
100
 
101
- #: bp-activity.php:391
102
  msgid "Update Posted!"
103
  msgstr ""
104
 
105
- #: bp-activity.php:393
106
  msgid "There was an error when posting your update, please try again."
107
  msgstr ""
108
 
109
- #: bp-activity.php:412 bp-themes/bp-default/_inc/ajax.php:162
110
  msgid "Please do not leave the comment area blank."
111
  msgstr ""
112
 
113
- #: bp-activity.php:423
114
  msgid "Reply Posted!"
115
  msgstr ""
116
 
117
- #: bp-activity.php:425 bp-themes/bp-default/_inc/ajax.php:167
118
  #: bp-themes/bp-default/_inc/ajax.php:178
119
  msgid "There was an error posting that reply, please try again."
120
  msgstr ""
121
 
122
- #: bp-activity.php:441
123
  msgid "Activity marked as favorite."
124
  msgstr ""
125
 
126
- #: bp-activity.php:443
127
  msgid ""
128
  "There was an error marking that activity as a favorite, please try again."
129
  msgstr ""
130
 
131
- #: bp-activity.php:459
132
  msgid "Activity removed as favorite."
133
  msgstr ""
134
 
135
- #: bp-activity.php:461
136
  msgid ""
137
  "There was an error removing that activity as a favorite, please try again."
138
  msgstr ""
139
 
140
- #: bp-activity.php:687
141
  #, php-format
142
  msgid "%s posted an update:"
143
  msgstr ""
144
 
145
- #: bp-activity.php:738
146
  #, php-format
147
  msgid "%s posted a new activity comment:"
148
  msgstr ""
149
 
150
- #: bp-activity.php:952
151
  msgid "Thumbnail"
152
  msgstr ""
153
 
@@ -1273,11 +1273,11 @@ msgstr ""
1273
  msgid "Blogs"
1274
  msgstr ""
1275
 
1276
- #: bp-core/bp-core-templatetags.php:1182
1277
  msgid "Your Avatar"
1278
  msgstr ""
1279
 
1280
- #: bp-core/bp-core-templatetags.php:1258
1281
  msgid "a user"
1282
  msgstr ""
1283
 
@@ -6651,7 +6651,7 @@ msgstr ""
6651
  msgid "A member accepts your friendship request"
6652
  msgstr ""
6653
 
6654
- #: bp-friends.php:200 bp-themes/bp-default/_inc/ajax.php:339
6655
  msgid "Friendship could not be requested."
6656
  msgstr ""
6657
 
@@ -6667,7 +6667,7 @@ msgstr ""
6667
  msgid "You already have a pending friendship request with this user"
6668
  msgstr ""
6669
 
6670
- #: bp-friends.php:238 bp-themes/bp-default/_inc/ajax.php:329
6671
  msgid "Friendship could not be canceled."
6672
  msgstr ""
6673
 
@@ -6784,7 +6784,7 @@ msgid "Filter Friends"
6784
  msgstr ""
6785
 
6786
  #: bp-friends/bp-friends-templatetags.php:139
6787
- #: bp-themes/bp-default/_inc/ajax.php:341
6788
  msgid "Friendship Requested"
6789
  msgstr ""
6790
 
@@ -6793,7 +6793,7 @@ msgid "Cancel Friendship"
6793
  msgstr ""
6794
 
6795
  #: bp-friends/bp-friends-templatetags.php:143
6796
- #: bp-themes/bp-default/_inc/ajax.php:331
6797
  msgid "Add Friend"
6798
  msgstr ""
6799
 
@@ -6820,7 +6820,7 @@ msgid "Group Avatar"
6820
  msgstr ""
6821
 
6822
  #: bp-groups.php:204 bp-groups/bp-groups-templatetags.php:1076
6823
- #: bp-themes/bp-default/_inc/ajax.php:419
6824
  msgid "Request Membership"
6825
  msgstr ""
6826
 
@@ -7427,12 +7427,12 @@ msgstr ""
7427
  #: bp-groups/bp-groups-templatetags.php:1066
7428
  #: bp-groups/bp-groups-templatetags.php:1073
7429
  #: bp-groups/bp-groups-templatetags.php:1084
7430
- #: bp-themes/bp-default/_inc/ajax.php:395
7431
  msgid "Leave Group"
7432
  msgstr ""
7433
 
7434
  #: bp-groups/bp-groups-templatetags.php:1068
7435
- #: bp-themes/bp-default/_inc/ajax.php:417
7436
  msgid "Join Group"
7437
  msgstr ""
7438
 
@@ -7619,7 +7619,7 @@ msgstr ""
7619
  msgid "There was an error deleting messages."
7620
  msgstr ""
7621
 
7622
- #: bp-messages.php:353 bp-themes/bp-default/_inc/ajax.php:522
7623
  msgid "Messages deleted."
7624
  msgstr ""
7625
 
@@ -7709,7 +7709,7 @@ msgid "%d Recipients"
7709
  msgstr ""
7710
 
7711
  #: bp-messages/bp-messages-templatetags.php:732
7712
- #: bp-themes/bp-default/_inc/ajax.php:456
7713
  #, php-format
7714
  msgid "Sent %s ago"
7715
  msgstr ""
@@ -7726,72 +7726,72 @@ msgstr ""
7726
  msgid "There was a problem posting your update, please try again."
7727
  msgstr ""
7728
 
7729
- #: bp-themes/bp-default/_inc/ajax.php:223
7730
- #: bp-themes/bp-default/_inc/ajax.php:250
7731
  msgid "There was a problem when deleting. Please try again."
7732
  msgstr ""
7733
 
7734
- #: bp-themes/bp-default/_inc/ajax.php:263
7735
  #: bp-themes/bp-default/activity/entry.php:35
7736
  msgid "Remove Favorite"
7737
  msgstr ""
7738
 
7739
- #: bp-themes/bp-default/_inc/ajax.php:272
7740
  #: bp-themes/bp-default/activity/entry.php:33
7741
  msgid "Favorite"
7742
  msgstr ""
7743
 
7744
- #: bp-themes/bp-default/_inc/ajax.php:303
7745
  #: bp-themes/bp-default/groups/create.php:191
7746
  #: bp-themes/bp-default/groups/single/send-invites.php:42
7747
  msgid "Remove Invite"
7748
  msgstr ""
7749
 
7750
- #: bp-themes/bp-default/_inc/ajax.php:344
7751
  msgid "Request Pending"
7752
  msgstr ""
7753
 
7754
- #: bp-themes/bp-default/_inc/ajax.php:356
7755
  msgid "There was a problem accepting that request. Please try again."
7756
  msgstr ""
7757
 
7758
- #: bp-themes/bp-default/_inc/ajax.php:367
7759
  msgid "There was a problem rejecting that request. Please try again."
7760
  msgstr ""
7761
 
7762
- #: bp-themes/bp-default/_inc/ajax.php:393
7763
  msgid "Error joining group"
7764
  msgstr ""
7765
 
7766
- #: bp-themes/bp-default/_inc/ajax.php:403
7767
  msgid "Error requesting membership"
7768
  msgstr ""
7769
 
7770
- #: bp-themes/bp-default/_inc/ajax.php:405
7771
  msgid "Membership Requested"
7772
  msgstr ""
7773
 
7774
- #: bp-themes/bp-default/_inc/ajax.php:414
7775
  msgid "Error leaving group"
7776
  msgstr ""
7777
 
7778
- #: bp-themes/bp-default/_inc/ajax.php:431
7779
  msgid "There was a problem closing the notice."
7780
  msgstr ""
7781
 
7782
- #: bp-themes/bp-default/_inc/ajax.php:473
7783
  msgid "There was a problem sending that reply. Please try again."
7784
  msgstr ""
7785
 
7786
- #: bp-themes/bp-default/_inc/ajax.php:483
7787
  msgid "There was a problem marking messages as unread."
7788
  msgstr ""
7789
 
7790
- #: bp-themes/bp-default/_inc/ajax.php:499
7791
  msgid "There was a problem marking messages as read."
7792
  msgstr ""
7793
 
7794
- #: bp-themes/bp-default/_inc/ajax.php:515
7795
  msgid "There was a problem deleting messages."
7796
  msgstr ""
7797
 
8
  msgstr ""
9
  "Project-Id-Version: BuddyPress \n"
10
  "Report-Msgid-Bugs-To: wp-polyglots@lists.automattic.com\n"
11
+ "POT-Creation-Date: 2010-02-16 14:11+0000\n"
12
  "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
86
  msgid "A member replies to an update or comment you've posted"
87
  msgstr ""
88
 
89
+ #: bp-activity.php:355
90
  msgid "Activity deleted"
91
  msgstr ""
92
 
93
+ #: bp-activity.php:357
94
  msgid "There was an error when deleting that activity"
95
  msgstr ""
96
 
97
+ #: bp-activity.php:377 bp-themes/bp-default/_inc/ajax.php:124
98
  msgid "Please enter some content to post."
99
  msgstr ""
100
 
101
+ #: bp-activity.php:392
102
  msgid "Update Posted!"
103
  msgstr ""
104
 
105
+ #: bp-activity.php:394
106
  msgid "There was an error when posting your update, please try again."
107
  msgstr ""
108
 
109
+ #: bp-activity.php:413 bp-themes/bp-default/_inc/ajax.php:162
110
  msgid "Please do not leave the comment area blank."
111
  msgstr ""
112
 
113
+ #: bp-activity.php:424
114
  msgid "Reply Posted!"
115
  msgstr ""
116
 
117
+ #: bp-activity.php:426 bp-themes/bp-default/_inc/ajax.php:167
118
  #: bp-themes/bp-default/_inc/ajax.php:178
119
  msgid "There was an error posting that reply, please try again."
120
  msgstr ""
121
 
122
+ #: bp-activity.php:442
123
  msgid "Activity marked as favorite."
124
  msgstr ""
125
 
126
+ #: bp-activity.php:444
127
  msgid ""
128
  "There was an error marking that activity as a favorite, please try again."
129
  msgstr ""
130
 
131
+ #: bp-activity.php:460
132
  msgid "Activity removed as favorite."
133
  msgstr ""
134
 
135
+ #: bp-activity.php:462
136
  msgid ""
137
  "There was an error removing that activity as a favorite, please try again."
138
  msgstr ""
139
 
140
+ #: bp-activity.php:688
141
  #, php-format
142
  msgid "%s posted an update:"
143
  msgstr ""
144
 
145
+ #: bp-activity.php:739
146
  #, php-format
147
  msgid "%s posted a new activity comment:"
148
  msgstr ""
149
 
150
+ #: bp-activity.php:953
151
  msgid "Thumbnail"
152
  msgstr ""
153
 
1273
  msgid "Blogs"
1274
  msgstr ""
1275
 
1276
+ #: bp-core/bp-core-templatetags.php:1180
1277
  msgid "Your Avatar"
1278
  msgstr ""
1279
 
1280
+ #: bp-core/bp-core-templatetags.php:1256
1281
  msgid "a user"
1282
  msgstr ""
1283
 
6651
  msgid "A member accepts your friendship request"
6652
  msgstr ""
6653
 
6654
+ #: bp-friends.php:200 bp-themes/bp-default/_inc/ajax.php:351
6655
  msgid "Friendship could not be requested."
6656
  msgstr ""
6657
 
6667
  msgid "You already have a pending friendship request with this user"
6668
  msgstr ""
6669
 
6670
+ #: bp-friends.php:238 bp-themes/bp-default/_inc/ajax.php:341
6671
  msgid "Friendship could not be canceled."
6672
  msgstr ""
6673
 
6784
  msgstr ""
6785
 
6786
  #: bp-friends/bp-friends-templatetags.php:139
6787
+ #: bp-themes/bp-default/_inc/ajax.php:353
6788
  msgid "Friendship Requested"
6789
  msgstr ""
6790
 
6793
  msgstr ""
6794
 
6795
  #: bp-friends/bp-friends-templatetags.php:143
6796
+ #: bp-themes/bp-default/_inc/ajax.php:343
6797
  msgid "Add Friend"
6798
  msgstr ""
6799
 
6820
  msgstr ""
6821
 
6822
  #: bp-groups.php:204 bp-groups/bp-groups-templatetags.php:1076
6823
+ #: bp-themes/bp-default/_inc/ajax.php:431
6824
  msgid "Request Membership"
6825
  msgstr ""
6826
 
7427
  #: bp-groups/bp-groups-templatetags.php:1066
7428
  #: bp-groups/bp-groups-templatetags.php:1073
7429
  #: bp-groups/bp-groups-templatetags.php:1084
7430
+ #: bp-themes/bp-default/_inc/ajax.php:407
7431
  msgid "Leave Group"
7432
  msgstr ""
7433
 
7434
  #: bp-groups/bp-groups-templatetags.php:1068
7435
+ #: bp-themes/bp-default/_inc/ajax.php:429
7436
  msgid "Join Group"
7437
  msgstr ""
7438
 
7619
  msgid "There was an error deleting messages."
7620
  msgstr ""
7621
 
7622
+ #: bp-messages.php:353 bp-themes/bp-default/_inc/ajax.php:534
7623
  msgid "Messages deleted."
7624
  msgstr ""
7625
 
7709
  msgstr ""
7710
 
7711
  #: bp-messages/bp-messages-templatetags.php:732
7712
+ #: bp-themes/bp-default/_inc/ajax.php:468
7713
  #, php-format
7714
  msgid "Sent %s ago"
7715
  msgstr ""
7726
  msgid "There was a problem posting your update, please try again."
7727
  msgstr ""
7728
 
7729
+ #: bp-themes/bp-default/_inc/ajax.php:229
7730
+ #: bp-themes/bp-default/_inc/ajax.php:262
7731
  msgid "There was a problem when deleting. Please try again."
7732
  msgstr ""
7733
 
7734
+ #: bp-themes/bp-default/_inc/ajax.php:275
7735
  #: bp-themes/bp-default/activity/entry.php:35
7736
  msgid "Remove Favorite"
7737
  msgstr ""
7738
 
7739
+ #: bp-themes/bp-default/_inc/ajax.php:284
7740
  #: bp-themes/bp-default/activity/entry.php:33
7741
  msgid "Favorite"
7742
  msgstr ""
7743
 
7744
+ #: bp-themes/bp-default/_inc/ajax.php:315
7745
  #: bp-themes/bp-default/groups/create.php:191
7746
  #: bp-themes/bp-default/groups/single/send-invites.php:42
7747
  msgid "Remove Invite"
7748
  msgstr ""
7749
 
7750
+ #: bp-themes/bp-default/_inc/ajax.php:356
7751
  msgid "Request Pending"
7752
  msgstr ""
7753
 
7754
+ #: bp-themes/bp-default/_inc/ajax.php:368
7755
  msgid "There was a problem accepting that request. Please try again."
7756
  msgstr ""
7757
 
7758
+ #: bp-themes/bp-default/_inc/ajax.php:379
7759
  msgid "There was a problem rejecting that request. Please try again."
7760
  msgstr ""
7761
 
7762
+ #: bp-themes/bp-default/_inc/ajax.php:405
7763
  msgid "Error joining group"
7764
  msgstr ""
7765
 
7766
+ #: bp-themes/bp-default/_inc/ajax.php:415
7767
  msgid "Error requesting membership"
7768
  msgstr ""
7769
 
7770
+ #: bp-themes/bp-default/_inc/ajax.php:417
7771
  msgid "Membership Requested"
7772
  msgstr ""
7773
 
7774
+ #: bp-themes/bp-default/_inc/ajax.php:426
7775
  msgid "Error leaving group"
7776
  msgstr ""
7777
 
7778
+ #: bp-themes/bp-default/_inc/ajax.php:443
7779
  msgid "There was a problem closing the notice."
7780
  msgstr ""
7781
 
7782
+ #: bp-themes/bp-default/_inc/ajax.php:485
7783
  msgid "There was a problem sending that reply. Please try again."
7784
  msgstr ""
7785
 
7786
+ #: bp-themes/bp-default/_inc/ajax.php:495
7787
  msgid "There was a problem marking messages as unread."
7788
  msgstr ""
7789
 
7790
+ #: bp-themes/bp-default/_inc/ajax.php:511
7791
  msgid "There was a problem marking messages as read."
7792
  msgstr ""
7793
 
7794
+ #: bp-themes/bp-default/_inc/ajax.php:527
7795
  msgid "There was a problem deleting messages."
7796
  msgstr ""
7797
 
bp-loader.php CHANGED
@@ -4,12 +4,12 @@ Plugin Name: BuddyPress
4
  Plugin URI: http://buddypress.org/download/
5
  Description: Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress.
6
  Author: The BuddyPress Community
7
- Version: 1.2
8
  Author URI: http://buddypress.org/developers/
9
  Site Wide Only: true
10
  */
11
 
12
- define( 'BP_VERSION', '1.2' );
13
 
14
  /***
15
  * This file will load in each BuddyPress component based on which
4
  Plugin URI: http://buddypress.org/download/
5
  Description: Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress.
6
  Author: The BuddyPress Community
7
+ Version: 1.2.1
8
  Author URI: http://buddypress.org/developers/
9
  Site Wide Only: true
10
  */
11
 
12
+ define( 'BP_VERSION', '1.2.1' );
13
 
14
  /***
15
  * This file will load in each BuddyPress component based on which
bp-messages.php CHANGED
@@ -91,7 +91,7 @@ function messages_check_installed() {
91
  return false;
92
 
93
  /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
94
- if ( $bp->site_options['bp-messages-db-version'] < BP_MESSAGES_DB_VERSION )
95
  messages_install();
96
  }
97
  add_action( 'admin_menu', 'messages_check_installed' );
@@ -129,8 +129,6 @@ function messages_setup_nav() {
129
  do_action( 'messages_setup_nav' );
130
  }
131
  add_action( 'bp_setup_nav', 'messages_setup_nav' );
132
- add_action( 'admin_menu', 'messages_setup_nav' );
133
-
134
 
135
  /********************************************************************************
136
  * Screen Functions
91
  return false;
92
 
93
  /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
94
+ if ( get_site_option( 'bp-messages-db-version' ) < BP_MESSAGES_DB_VERSION )
95
  messages_install();
96
  }
97
  add_action( 'admin_menu', 'messages_check_installed' );
129
  do_action( 'messages_setup_nav' );
130
  }
131
  add_action( 'bp_setup_nav', 'messages_setup_nav' );
 
 
132
 
133
  /********************************************************************************
134
  * Screen Functions
bp-themes/bp-default/activity/entry.php CHANGED
@@ -15,7 +15,7 @@
15
  <?php bp_activity_action() ?>
16
  </div>
17
 
18
- <?php if ( bp_get_activity_content_body() ) : ?>
19
  <div class="activity-inner">
20
  <?php bp_activity_content_body() ?>
21
  </div>
15
  <?php bp_activity_action() ?>
16
  </div>
17
 
18
+ <?php if ( bp_activity_has_content() ) : ?>
19
  <div class="activity-inner">
20
  <?php bp_activity_content_body() ?>
21
  </div>
bp-themes/bp-default/functions.php CHANGED
@@ -127,7 +127,7 @@ add_action( 'pre_get_posts', 'bp_dtheme_fix_get_posts_on_activity_front' );
127
 
128
  /****
129
  * Custom header image support. You can remove this entirely in a child theme by adding this line
130
- * to your functions.php: remove_action( 'init', 'bp_dtheme_add_custom_header_support' );
131
  */
132
  function bp_dtheme_add_custom_header_support() {
133
  /* Set the defaults for the custom header image (http://ryan.boren.me/2007/01/07/custom-image-header-api/) */
@@ -199,7 +199,8 @@ function bp_dtheme_add_custom_header_support() {
199
  }
200
  add_custom_image_header( 'bp_dtheme_header_style', 'bp_dtheme_admin_header_style' );
201
  }
202
- add_action( 'init', 'bp_dtheme_add_custom_header_support' );
 
203
 
204
  /* Show a notice when the theme is activated - workaround by Ozh (http://old.nabble.com/Activation-hook-exist-for-themes--td25211004.html) */
205
  function bp_dtheme_show_notice() { ?>
@@ -229,11 +230,4 @@ function bp_dtheme_js_terms() { ?>
229
  }
230
  add_action( 'wp_footer', 'bp_dtheme_js_terms' );
231
 
232
- //Google Maps Shortcode
233
- function fn_googleMaps($atts, $content = null) {
234
- extract( shortcode_atts( array( "width" => '640', "height" => '480', "src" => '' ), $atts ) );
235
- return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'"></iframe>';
236
- }
237
- add_shortcode( "googlemap", "fn_googleMaps" );
238
-
239
  ?>
127
 
128
  /****
129
  * Custom header image support. You can remove this entirely in a child theme by adding this line
130
+ * to your functions.php: define( 'BP_DTHEME_DISABLE_CUSTOM_HEADER', true );
131
  */
132
  function bp_dtheme_add_custom_header_support() {
133
  /* Set the defaults for the custom header image (http://ryan.boren.me/2007/01/07/custom-image-header-api/) */
199
  }
200
  add_custom_image_header( 'bp_dtheme_header_style', 'bp_dtheme_admin_header_style' );
201
  }
202
+ if ( !defined( 'BP_DTHEME_DISABLE_CUSTOM_HEADER' ) )
203
+ add_action( 'init', 'bp_dtheme_add_custom_header_support' );
204
 
205
  /* Show a notice when the theme is activated - workaround by Ozh (http://old.nabble.com/Activation-hook-exist-for-themes--td25211004.html) */
206
  function bp_dtheme_show_notice() { ?>
230
  }
231
  add_action( 'wp_footer', 'bp_dtheme_js_terms' );
232
 
 
 
 
 
 
 
 
233
  ?>
bp-themes/bp-default/groups/create.php CHANGED
@@ -23,10 +23,10 @@
23
 
24
  <?php do_action( 'bp_before_group_details_creation_step' ); ?>
25
 
26
- <label for="group-name"><?php _e('* Group Name', 'buddypress') ?> <? _e( '(required)', 'buddypress' )?></label>
27
  <input type="text" name="group-name" id="group-name" value="<?php bp_new_group_name() ?>" />
28
 
29
- <label for="group-desc"><?php _e('* Group Description', 'buddypress') ?> <? _e( '(required)', 'buddypress' )?></label>
30
  <textarea name="group-desc" id="group-desc"><?php bp_new_group_description() ?></textarea>
31
 
32
  <?php do_action( 'bp_after_group_details_creation_step' ); /* Deprecated -> */ do_action( 'groups_custom_group_fields_editable' ); ?>
23
 
24
  <?php do_action( 'bp_before_group_details_creation_step' ); ?>
25
 
26
+ <label for="group-name"><?php _e('* Group Name', 'buddypress') ?> <?php _e( '(required)', 'buddypress' )?></label>
27
  <input type="text" name="group-name" id="group-name" value="<?php bp_new_group_name() ?>" />
28
 
29
+ <label for="group-desc"><?php _e('* Group Description', 'buddypress') ?> <?php _e( '(required)', 'buddypress' )?></label>
30
  <textarea name="group-desc" id="group-desc"><?php bp_new_group_description() ?></textarea>
31
 
32
  <?php do_action( 'bp_after_group_details_creation_step' ); /* Deprecated -> */ do_action( 'groups_custom_group_fields_editable' ); ?>
bp-themes/bp-default/groups/single/home.php CHANGED
@@ -38,10 +38,10 @@
38
  <?php elseif ( bp_is_group_membership_request() ) : ?>
39
  <?php locate_template( array( 'groups/single/request-membership.php' ), true ) ?>
40
 
41
- <?php elseif ( bp_group_is_visible() ) : ?>
42
  <?php locate_template( array( 'groups/single/activity.php' ), true ) ?>
43
 
44
- <?php else : ?>
45
  <?php /* The group is not visible, show the status message */ ?>
46
 
47
  <?php do_action( 'bp_before_group_status_message' ) ?>
@@ -51,6 +51,12 @@
51
  </div>
52
 
53
  <?php do_action( 'bp_after_group_status_message' ) ?>
 
 
 
 
 
 
54
  <?php endif; ?>
55
 
56
  <?php do_action( 'bp_after_group_body' ) ?>
38
  <?php elseif ( bp_is_group_membership_request() ) : ?>
39
  <?php locate_template( array( 'groups/single/request-membership.php' ), true ) ?>
40
 
41
+ <?php elseif ( bp_group_is_visible() && bp_is_active( 'activity' ) ) : ?>
42
  <?php locate_template( array( 'groups/single/activity.php' ), true ) ?>
43
 
44
+ <?php elseif ( !bp_group_is_visible() ) : ?>
45
  <?php /* The group is not visible, show the status message */ ?>
46
 
47
  <?php do_action( 'bp_before_group_status_message' ) ?>
51
  </div>
52
 
53
  <?php do_action( 'bp_after_group_status_message' ) ?>
54
+
55
+ <?php else : ?>
56
+ <?php
57
+ /* If nothing sticks, just load a group front template if one exists. */
58
+ locate_template( array( 'groups/single/front.php' ), true );
59
+ ?>
60
  <?php endif; ?>
61
 
62
  <?php do_action( 'bp_after_group_body' ) ?>
bp-themes/bp-default/registration/register.php CHANGED
@@ -174,7 +174,7 @@
174
 
175
  <p><input type="checkbox" name="signup_with_blog" id="signup_with_blog" value="1"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes, I\'d like to create a new blog', 'buddypress' ) ?></p>
176
 
177
- <div id="blog-details">
178
 
179
  <label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
180
  <?php do_action( 'bp_signup_blog_url_errors' ) ?>
@@ -297,7 +297,7 @@
297
 
298
  <script type="text/javascript">
299
  jQuery(document).ready( function() {
300
- if ( jQuery('div#blog-details').length )
301
  jQuery('div#blog-details').toggle();
302
 
303
  jQuery( 'input#signup_with_blog' ).click( function() {
174
 
175
  <p><input type="checkbox" name="signup_with_blog" id="signup_with_blog" value="1"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes, I\'d like to create a new blog', 'buddypress' ) ?></p>
176
 
177
+ <div id="blog-details"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>>
178
 
179
  <label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
180
  <?php do_action( 'bp_signup_blog_url_errors' ) ?>
297
 
298
  <script type="text/javascript">
299
  jQuery(document).ready( function() {
300
+ if ( jQuery('div#blog-details').length && !jQuery('div#blog-details').hasClass('show') )
301
  jQuery('div#blog-details').toggle();
302
 
303
  jQuery( 'input#signup_with_blog' ).click( function() {
bp-themes/bp-default/style.css CHANGED
@@ -2,7 +2,7 @@
2
  Theme Name: BuddyPress Default
3
  Theme URI: http://buddypress.org/extend/themes/
4
  Description: The default theme for BuddyPress.
5
- Version: 1.2
6
  Author: BuddyPress.org
7
  Author URI: http://buddypress.org
8
  Tags: buddypress, two-columns, custom-header, white, blue
2
  Theme Name: BuddyPress Default
3
  Theme URI: http://buddypress.org/extend/themes/
4
  Description: The default theme for BuddyPress.
5
+ Version: 1.2.1
6
  Author: BuddyPress.org
7
  Author URI: http://buddypress.org
8
  Tags: buddypress, two-columns, custom-header, white, blue
bp-xprofile.php CHANGED
@@ -71,7 +71,7 @@ function xprofile_install() {
71
  KEY user_id (user_id)
72
  ) {$charset_collate};";
73
 
74
- if ( empty( $bp->site_options['bp-xprofile-db-version'] ) ) {
75
  if ( !$wpdb->get_var( "SELECT id FROM {$bp->profile->table_name_groups} WHERE id = 1" ) )
76
  $sql[] = "INSERT INTO {$bp->profile->table_name_groups} VALUES ( 1, '" . get_site_option( 'bp-xprofile-base-group-name' ) . "', '', 0 );";
77
 
@@ -155,7 +155,7 @@ function xprofile_add_admin_menu() {
155
  add_submenu_page( 'bp-general-settings', __("Profile Field Setup", 'buddypress'), __("Profile Field Setup", 'buddypress'), 'manage_options', 'bp-profile-setup', "xprofile_admin" );
156
 
157
  /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
158
- if ( $bp->site_options['bp-xprofile-db-version'] < BP_XPROFILE_DB_VERSION )
159
  xprofile_install();
160
  }
161
  add_action( 'admin_menu', 'xprofile_add_admin_menu' );
@@ -197,8 +197,6 @@ function xprofile_setup_nav() {
197
  do_action( 'xprofile_setup_nav' );
198
  }
199
  add_action( 'bp_setup_nav', 'xprofile_setup_nav' );
200
- add_action( 'admin_menu', 'xprofile_setup_nav' );
201
-
202
 
203
  /**
204
  * xprofile_setup_adminbar_menu()
@@ -726,6 +724,32 @@ function xprofile_set_field_data( $field, $user_id, $value, $is_required = false
726
  if ( $is_required && ( empty( $value ) || !strlen( trim( $value ) ) ) )
727
  return false;
728
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
729
  $field = new BP_XProfile_ProfileData();
730
  $field->field_id = $field_id;
731
  $field->user_id = $user_id;
71
  KEY user_id (user_id)
72
  ) {$charset_collate};";
73
 
74
+ if ( '' == get_site_option( 'bp-xprofile-db-version' ) ) {
75
  if ( !$wpdb->get_var( "SELECT id FROM {$bp->profile->table_name_groups} WHERE id = 1" ) )
76
  $sql[] = "INSERT INTO {$bp->profile->table_name_groups} VALUES ( 1, '" . get_site_option( 'bp-xprofile-base-group-name' ) . "', '', 0 );";
77
 
155
  add_submenu_page( 'bp-general-settings', __("Profile Field Setup", 'buddypress'), __("Profile Field Setup", 'buddypress'), 'manage_options', 'bp-profile-setup', "xprofile_admin" );
156
 
157
  /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
158
+ if ( get_site_option( 'bp-xprofile-db-version' ) < BP_XPROFILE_DB_VERSION )
159
  xprofile_install();
160
  }
161
  add_action( 'admin_menu', 'xprofile_add_admin_menu' );
197
  do_action( 'xprofile_setup_nav' );
198
  }
199
  add_action( 'bp_setup_nav', 'xprofile_setup_nav' );
 
 
200
 
201
  /**
202
  * xprofile_setup_adminbar_menu()
724
  if ( $is_required && ( empty( $value ) || !strlen( trim( $value ) ) ) )
725
  return false;
726
 
727
+ $field = new BP_XProfile_Field( $field_id );
728
+
729
+ /* Check the value is an acceptable value */
730
+ if ( 'checkbox' == $field->type || 'radio' == $field->type || 'selectbox' == $field->type || 'multiselectbox' == $field->type ) {
731
+ $options = $field->get_children();
732
+
733
+ foreach( $options as $option )
734
+ $possible_values[] = $option->name;
735
+
736
+ if ( is_array( $value ) ) {
737
+ foreach( $value as $i => $single ) {
738
+ if ( !in_array( $single, (array)$possible_values ) )
739
+ unset( $value[$i] );
740
+ }
741
+
742
+ if ( empty( $value ) )
743
+ return false;
744
+
745
+ /* Reset the keys by merging with an empty array */
746
+ $value = array_merge( array(), $value );
747
+ } else {
748
+ if ( !in_array( $value, (array)$possible_values ) )
749
+ return false;
750
+ }
751
+ }
752
+
753
  $field = new BP_XProfile_ProfileData();
754
  $field->field_id = $field_id;
755
  $field->user_id = $user_id;
readme.txt CHANGED
@@ -2,57 +2,52 @@
2
  Contributors: apeatling
3
  Tags: buddypress, social networking, activity, profiles, messaging, friends, groups, forums, microblogging, twitter, facebook, mingle, social, community, networks, networking, cms
4
  Requires at least: WordPress 2.9.1
5
- Tested up to: WordPress 2.9.1
6
- Stable tag: 1.2
7
 
8
  == Description ==
9
 
10
- Social networking in a box. Build a social network for your company, school, sports team or niche community all
11
- based on the power and flexibility of WordPress.
12
 
13
- BuddyPress will let users register on your site and start creating profiles, posting messages, making connections,
14
- creating and interacting in groups and much more.
15
 
16
  <h4>Try the Demo</h4>
17
 
18
- If you're interested in seeing what a default installation of BuddyPress has to offer, try out the BuddyPress test
19
- drive! This site is a community of BuddyPress users looking to try out and discuss the latest features of BuddyPress.
20
 
21
  <a href="http://testbp.org/">BuddyPress Test Drive</a>
22
 
23
  <h4>Who's Using BuddyPress?</h4>
24
 
25
- More and more WordPress with BuddyPress powered sites are popping up. You can take a look at some of the best
26
- sites on the <a href="http://buddypress.org/demo/">BuddyPress demo page</a> or the
27
- <a href="http://wordpress.org/showcase/flavor/buddypress/">BuddyPress section of the WordPress showcase</a>.
 
 
28
 
29
  == Installation ==
30
 
31
- You can download and install BuddyPress using the built in WordPress plugin installer. If you download BuddyPress
32
- manually, make sure it is uploaded to "/wp-content/plugins/buddypress/".
33
 
34
  Activate BuddyPress in the "Plugins" admin panel using the "Activate" link.
35
 
36
- You will need to enable permalink support in your WordPress installation for BuddyPress pages to function correctly.
37
- You can set this up using the "Settings > Permalinks" menu in your WordPress admin area.
38
 
39
- Finally, you will need to activate a BuddyPress compatible theme. Two BuddyPress themes are bundled with the plugin,
40
- you can activate these using the "Appearance > Themes" menu in your WordPress admin area. To install other BuddyPress
41
- compatible themes, use the "Appearance > Add New Themes" menu and select the "buddypress" checkbox before hitting the
42
- "Find Themes" button.
43
 
44
  --- Forums Support ---
45
 
46
- BuddyPress also includes support for discussion forums. Each group created on your site can have its own discussion forum.
47
- If you'd like to enable this feature please use the "BuddyPress > Forums Setup" menu in your WordPress admin area and
48
- follow the on screen instructions.
49
 
50
  == Frequently Asked Questions ==
51
 
 
 
 
 
52
  = Will this work on standard WordPress and WordPress MU? =
53
 
54
- Yes! BuddyPress will run on both versions of WordPress. If you are using WordPress MU then BuddyPress will support
55
- the global tracking of blogs, posts and comments.
56
 
57
  = Where can I get support? =
58
 
2
  Contributors: apeatling
3
  Tags: buddypress, social networking, activity, profiles, messaging, friends, groups, forums, microblogging, twitter, facebook, mingle, social, community, networks, networking, cms
4
  Requires at least: WordPress 2.9.1
5
+ Tested up to: WordPress 2.9.2
6
+ Stable tag: 1.2.1
7
 
8
  == Description ==
9
 
10
+ Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress.
 
11
 
12
+ BuddyPress will let users register on your site and start creating profiles, posting messages, making connections, creating and interacting in groups and much more.
 
13
 
14
  <h4>Try the Demo</h4>
15
 
16
+ If you're interested in seeing what a default installation of BuddyPress has to offer, try out the BuddyPress test drive! This site is a community of BuddyPress users looking to try out and discuss the latest features of BuddyPress.
 
17
 
18
  <a href="http://testbp.org/">BuddyPress Test Drive</a>
19
 
20
  <h4>Who's Using BuddyPress?</h4>
21
 
22
+ More and more WordPress with BuddyPress powered sites are popping up. You can take a look at some of the best sites on the <a href="http://buddypress.org/demo/">BuddyPress demo page</a> or the <a href="http://wordpress.org/showcase/flavor/buddypress/">BuddyPress section of the WordPress showcase</a>.
23
+
24
+ <h4>More Information</h4>
25
+
26
+ Visit the <a href="http://buddypress.org/">BuddyPress website</a> for more information about BuddyPress.
27
 
28
  == Installation ==
29
 
30
+ You can download and install BuddyPress using the built in WordPress plugin installer. If you download BuddyPress manually, make sure it is uploaded to "/wp-content/plugins/buddypress/".
 
31
 
32
  Activate BuddyPress in the "Plugins" admin panel using the "Activate" link.
33
 
34
+ You will need to enable permalink support in your WordPress installation for BuddyPress pages to function correctly. You can set this up using the "Settings > Permalinks" menu in your WordPress admin area.
 
35
 
36
+ Finally, you will need to activate a BuddyPress compatible theme. Two BuddyPress themes are bundled with the plugin, you can activate these using the "Appearance > Themes" menu in your WordPress admin area. To install other BuddyPress compatible themes, use the "Appearance > Add New Themes" menu and select the "buddypress" checkbox before hitting the "Find Themes" button.
 
 
 
37
 
38
  --- Forums Support ---
39
 
40
+ BuddyPress also includes support for discussion forums. Each group created on your site can have its own discussion forum. If you'd like to enable this feature please use the "BuddyPress > Forums Setup" menu in your WordPress admin area and follow the on screen instructions.
 
 
41
 
42
  == Frequently Asked Questions ==
43
 
44
+ = Can I use my existing WordPress theme? =
45
+
46
+ Yes you can. First install and activate BuddyPress, then download and activate the <a href="http://wordpress.org/extend/plugins/bp-template-pack/">template extension pack</a>. This plugin will run you through the process step-by-step.
47
+
48
  = Will this work on standard WordPress and WordPress MU? =
49
 
50
+ Yes! BuddyPress will run on both versions of WordPress. If you are using WordPress MU then BuddyPress will support the global tracking of blogs, posts and comments.
 
51
 
52
  = Where can I get support? =
53