BuddyPress - Version 2.0.1

Version Description

See: http://codex.buddypress.org/releases/version-2-0-1/

Download this release

Release Info

Developer boonebgorges
Plugin Icon 128x128 BuddyPress
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0 to 2.0.1

bp-blogs/bp-blogs-activity.php CHANGED
@@ -852,3 +852,68 @@ function bp_blogs_activity_comment_permalink( $retval ) {
852
return $retval;
853
}
854
add_filter( 'bp_get_activity_comment_permalink', 'bp_blogs_activity_comment_permalink' );
852
return $retval;
853
}
854
add_filter( 'bp_get_activity_comment_permalink', 'bp_blogs_activity_comment_permalink' );
855
+
856
+ /**
857
+ * Changes single activity comment entries to use the blog comment permalink.
858
+ *
859
+ * This is only done if the activity comment is associated with a blog comment.
860
+ *
861
+ * @since BuddyPress (2.0.1)
862
+ *
863
+ * @param string $retval The activity permalink
864
+ * @param BP_Activity_Activity $activity
865
+ * @return string
866
+ */
867
+ function bp_blogs_activity_comment_single_permalink( $retval, $activity ) {
868
+ if ( 'activity_comment' !== $activity->type ) {
869
+ return $retval;
870
+ }
871
+
872
+ $blog_comment_id = bp_activity_get_meta( $activity->id, 'bp_blogs_post_comment_id' );
873
+
874
+ if ( ! empty( $blog_comment_id ) ) {
875
+ $retval = $activity->primary_link;
876
+ }
877
+
878
+ return $retval;
879
+ }
880
+ add_filter( 'bp_activity_get_permalink', 'bp_blogs_activity_comment_single_permalink', 10, 2 );
881
+
882
+ /**
883
+ * Formats single activity comment entries to use the blog comment action.
884
+ *
885
+ * This is only done if the activity comment is associated with a blog comment.
886
+ *
887
+ * @since BuddyPress (2.0.1)
888
+ *
889
+ * @param string $retval The activity action
890
+ * @param BP_Activity_Activity $activity
891
+ * @return string
892
+ */
893
+ function bp_blogs_activity_comment_single_action( $retval, $activity ) {
894
+ if ( 'activity_comment' !== $activity->type ) {
895
+ return $retval;
896
+ }
897
+
898
+ $blog_comment_id = bp_activity_get_meta( $activity->id, 'bp_blogs_post_comment_id' );
899
+
900
+ if ( ! empty( $blog_comment_id ) ) {
901
+ // fetch the parent blog post activity item
902
+ $parent_blog_post_activity = new BP_Activity_Activity( $activity->item_id );
903
+
904
+ // fake a 'new_blog_comment' activity object
905
+ $object = $activity;
906
+
907
+ // override 'item_id' to use blog ID
908
+ $object->item_id = $parent_blog_post_activity->item_id;
909
+
910
+ // override 'secondary_item_id' to use comment ID
911
+ $object->secondary_item_id = $blog_comment_id;
912
+
913
+ // now format the activity action using the 'new_blog_comment' action callback
914
+ $retval = bp_blogs_format_activity_action_new_blog_comment( '', $object );
915
+ }
916
+
917
+ return $retval;
918
+ }
919
+ add_filter( 'bp_get_activity_action_pre_meta', 'bp_blogs_activity_comment_single_action', 10, 2 );
bp-blogs/bp-blogs-functions.php CHANGED
@@ -540,6 +540,11 @@ function bp_blogs_update_post( $post ) {
540
* @return bool|object Returns false on failure, the comment object on success.
541
*/
542
function bp_blogs_record_comment( $comment_id, $is_approved = true ) {
543
// Get the users comment
544
$recorded_comment = get_comment( $comment_id );
545
540
* @return bool|object Returns false on failure, the comment object on success.
541
*/
542
function bp_blogs_record_comment( $comment_id, $is_approved = true ) {
543
+ // bail if activity component is not active
544
+ if ( ! bp_is_active( 'activity' ) ) {
545
+ return;
546
+ }
547
+
548
// Get the users comment
549
$recorded_comment = get_comment( $comment_id );
550
bp-core/admin/bp-core-functions.php CHANGED
@@ -276,8 +276,6 @@ function bp_core_activation_notice() {
276
'id' => 'register',
277
'name' => __( 'Register', 'buddypress' )
278
);
279
-
280
- bp_core_maybe_install_signups();
281
}
282
283
// On the first admin screen after a new installation, this isn't set, so grab it to supress a misleading error message.
@@ -793,39 +791,6 @@ function bp_admin_wp_nav_menu_restrict_items() {
793
<?php
794
}
795
796
- /**
797
- * Check if the signups table needs to be created.
798
- *
799
- * @since BuddyPress (2.0.0)
800
- *
801
- * @global $wpdb
802
- */
803
- function bp_core_maybe_install_signups() {
804
- global $wpdb;
805
-
806
- // Multisite installations already have the signups table.
807
- if ( ! empty( $wpdb->signups ) ) {
808
- return;
809
- }
810
-
811
- $bp_signups = bp_core_get_table_prefix() . 'signups';
812
-
813
- // Check for the table
814
- $suppress = $wpdb->suppress_errors();
815
- $table_exists = $wpdb->get_results( "DESCRIBE {$bp_signups};" );
816
- $wpdb->suppress_errors( $suppress );
817
-
818
- // Bail if the table exists
819
- if ( ! empty( $table_exists ) ) {
820
- return;
821
- }
822
-
823
- // Signups is not there and we need it so let's create it
824
- require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-schema.php' );
825
-
826
- bp_core_install_signups();
827
- }
828
-
829
/**
830
* Add "Mark as Spam/Ham" button to user row actions.
831
*
276
'id' => 'register',
277
'name' => __( 'Register', 'buddypress' )
278
);
279
}
280
281
// On the first admin screen after a new installation, this isn't set, so grab it to supress a misleading error message.
791
<?php
792
}
793
794
/**
795
* Add "Mark as Spam/Ham" button to user row actions.
796
*
bp-core/admin/bp-core-schema.php CHANGED
@@ -51,9 +51,8 @@ function bp_core_install( $active_components = false ) {
51
if ( !empty( $active_components['blogs'] ) )
52
bp_core_install_blog_tracking();
53
54
- // Install the signups table
55
- bp_core_install_signups();
56
-
57
}
58
59
function bp_core_install_notifications() {
@@ -348,6 +347,8 @@ function bp_core_install_blog_tracking() {
348
dbDelta( $sql );
349
}
350
351
/**
352
* Install the signups table.
353
*
@@ -359,19 +360,15 @@ function bp_core_install_blog_tracking() {
359
function bp_core_install_signups() {
360
global $wpdb;
361
362
- // Multisite installations already have the signups table
363
- if ( ! empty( $wpdb->signups ) ) {
364
- return;
365
- }
366
367
- $wpdb->signups = bp_core_get_table_prefix() . 'signups';
368
-
369
- // Setting the charset to be sure WordPress upgrade.php is loaded
370
- $charset_collate = bp_core_set_charset();
371
372
// Use WP's core CREATE TABLE query
373
$create_queries = wp_get_db_schema( 'ms_global' );
374
-
375
if ( ! is_array( $create_queries ) ) {
376
$create_queries = explode( ';', $create_queries );
377
$create_queries = array_filter( $create_queries );
@@ -380,13 +377,40 @@ function bp_core_install_signups() {
380
// Filter out all the queries except wp_signups
381
foreach ( $create_queries as $key => $query ) {
382
if ( preg_match( "|CREATE TABLE ([^ ]*)|", $query, $matches ) ) {
383
- if ( $wpdb->signups != trim( $matches[1], '`' ) ) {
384
unset( $create_queries[ $key ] );
385
}
386
}
387
}
388
389
if ( ! empty( $create_queries ) ) {
390
dbDelta( $create_queries );
391
}
392
}
51
if ( !empty( $active_components['blogs'] ) )
52
bp_core_install_blog_tracking();
53
54
+ // Maybe install (or upgrade) the signups table
55
+ bp_core_maybe_install_signups();
56
}
57
58
function bp_core_install_notifications() {
347
dbDelta( $sql );
348
}
349
350
+ /** Signups *******************************************************************/
351
+
352
/**
353
* Install the signups table.
354
*
360
function bp_core_install_signups() {
361
global $wpdb;
362
363
+ // Signups is not there and we need it so let's create it
364
+ require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-schema.php' );
365
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
366
367
+ // Never use bp_core_get_table_prefix() for any global users tables
368
+ $wpdb->signups = $wpdb->base_prefix . 'signups';
369
370
// Use WP's core CREATE TABLE query
371
$create_queries = wp_get_db_schema( 'ms_global' );
372
if ( ! is_array( $create_queries ) ) {
373
$create_queries = explode( ';', $create_queries );
374
$create_queries = array_filter( $create_queries );
377
// Filter out all the queries except wp_signups
378
foreach ( $create_queries as $key => $query ) {
379
if ( preg_match( "|CREATE TABLE ([^ ]*)|", $query, $matches ) ) {
380
+ if ( trim( $matches[1], '`' ) !== $wpdb->signups ) {
381
unset( $create_queries[ $key ] );
382
}
383
}
384
}
385
386
+ // Run WordPress's database upgrader
387
if ( ! empty( $create_queries ) ) {
388
dbDelta( $create_queries );
389
}
390
}
391
+
392
+ /**
393
+ * Update the signups table, adding `signup_id` column and drop `domain` index.
394
+ *
395
+ * This is necessary because WordPress's `pre_schema_upgrade()` function wraps
396
+ * table ALTER's in multisite checks, and other plugins may have installed their
397
+ * own sign-ups table; Eg: Gravity Forms User Registration Add On
398
+ *
399
+ * @since BuddyPress (2.0.1)
400
+ *
401
+ * @see pre_schema_upgrade()
402
+ * @link https://core.trac.wordpress.org/ticket/27855 WordPress Trac Ticket
403
+ * @link https://buddypress.trac.wordpress.org/ticket/5563 BuddyPress Trac Ticket
404
+ *
405
+ * @global WPDB $wpdb
406
+ */
407
+ function bp_core_upgrade_signups() {
408
+ global $wpdb;
409
+
410
+ // Never use bp_core_get_table_prefix() for any global users tables
411
+ $wpdb->signups = $wpdb->base_prefix . 'signups';
412
+
413
+ // Attempt to alter the signups table
414
+ $wpdb->query( "ALTER TABLE {$wpdb->signups} ADD signup_id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST" );
415
+ $wpdb->query( "ALTER TABLE {$wpdb->signups} DROP INDEX domain" );
416
+ }
bp-core/bp-core-admin.php CHANGED
@@ -652,6 +652,7 @@ class BP_Admin {
652
<?php printf( __( 'Thanks for updating! With a focus on speed, admin tools, and developer enhancements, BuddyPress %s is our leanest and most powerful version yet.', 'buddypress' ), $display_version ); ?>
653
<?php endif; ?>
654
</div>
655
<div class="bp-badge"></div>
656
657
<h2 class="nav-tab-wrapper">
652
<?php printf( __( 'Thanks for updating! With a focus on speed, admin tools, and developer enhancements, BuddyPress %s is our leanest and most powerful version yet.', 'buddypress' ), $display_version ); ?>
653
<?php endif; ?>
654
</div>
655
+
656
<div class="bp-badge"></div>
657
658
<h2 class="nav-tab-wrapper">
bp-core/bp-core-classes.php CHANGED
@@ -883,7 +883,7 @@ class BP_Core_User {
883
884
$sql = array();
885
886
- $sql['select_main'] = "SELECT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.display_name, u.user_email";
887
888
if ( 'active' == $type || 'online' == $type || 'newest' == $type ) {
889
$sql['select_active'] = ", um.meta_value as last_activity";
883
884
$sql = array();
885
886
+ $sql['select_main'] = "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.display_name, u.user_email";
887
888
if ( 'active' == $type || 'online' == $type || 'newest' == $type ) {
889
$sql['select_active'] = ", um.meta_value as last_activity";
bp-core/bp-core-filters.php CHANGED
@@ -537,10 +537,16 @@ function bp_setup_nav_menu_item( $menu_item ) {
537
break;
538
}
539
540
// Highlight the current page
541
- $current = bp_get_requested_url();
542
- if ( strpos( $current, $menu_item->url ) !== false ) {
543
- $menu_item->classes[] = 'current_page_item';
544
}
545
546
return $menu_item;
537
break;
538
}
539
540
+ // If component is deactivated, make sure menu item doesn't render
541
+ if ( empty( $menu_item->url ) ) {
542
+ $menu_item->_invalid = true;
543
+
544
// Highlight the current page
545
+ } else {
546
+ $current = bp_get_requested_url();
547
+ if ( strpos( $current, $menu_item->url ) !== false ) {
548
+ $menu_item->classes[] = 'current_page_item';
549
+ }
550
}
551
552
return $menu_item;
bp-core/bp-core-update.php CHANGED
@@ -235,6 +235,11 @@ function bp_version_updater() {
235
if ( $raw_db_version < 7892 ) {
236
bp_update_to_2_0();
237
}
238
}
239
240
/** All done! *************************************************************/
@@ -243,6 +248,8 @@ function bp_version_updater() {
243
bp_version_bump();
244
}
245
246
/**
247
* Remove unused metadata from database when upgrading from < 1.5.
248
*
@@ -338,9 +345,10 @@ function bp_update_to_1_9_2() {
338
* - Ensure that the activity tables are installed, for last_activity storage.
339
* - Migrate last_activity data from usermeta to activity table
340
* - Add values for all BuddyPress options to the options table
341
*/
342
function bp_update_to_2_0() {
343
- global $wpdb;
344
345
/** Install activity tables for 'last_activity' ***************************/
346
@@ -354,44 +362,11 @@ function bp_update_to_2_0() {
354
355
if ( ! is_multisite() ) {
356
357
- if ( empty( $wpdb->signups ) ) {
358
- bp_core_install_signups();
359
- }
360
-
361
- $signups = get_users( array(
362
- 'fields' => 'all_with_meta',
363
- 'meta_key' => 'activation_key',
364
- 'meta_compare' => 'EXISTS',
365
- ) );
366
-
367
- if ( empty( $signups ) ) {
368
- return;
369
- }
370
-
371
- foreach ( $signups as $signup ) {
372
- $meta = array();
373
-
374
- if ( bp_is_active( 'xprofile' ) ) {
375
- $meta['field_1'] = $signup->display_name;
376
- }
377
-
378
- $meta['password'] = $signup->user_pass;
379
380
- $user_login = preg_replace( '/\s+/', '', sanitize_user( $signup->user_login, true ) );
381
- $user_email = sanitize_email( $signup->user_email );
382
-
383
- BP_Signup::add( array(
384
- 'user_login' => $user_login,
385
- 'user_email' => $user_email,
386
- 'registered' => $signup->user_registered,
387
- 'activation_key' => $signup->activation_key,
388
- 'meta' => $meta
389
- ) );
390
-
391
- // Deleting these options will remove signups from users count
392
- delete_user_option( $signup->ID, 'capabilities' );
393
- delete_user_option( $signup->ID, 'user_level' );
394
- }
395
}
396
397
/** Add BP options to the options table ***********************************/
@@ -399,6 +374,20 @@ function bp_update_to_2_0() {
399
bp_add_options();
400
}
401
402
/**
403
* Redirect user to BP's What's New page on first page load after activation.
404
*
@@ -424,6 +413,56 @@ function bp_add_activation_redirect() {
424
set_transient( '_bp_activation_redirect', true, 30 );
425
}
426
427
/** Activation Actions ********************************************************/
428
429
/**
235
if ( $raw_db_version < 7892 ) {
236
bp_update_to_2_0();
237
}
238
+
239
+ // 2.0.1
240
+ if ( $raw_db_version < 8311 ) {
241
+ bp_update_to_2_0_1();
242
+ }
243
}
244
245
/** All done! *************************************************************/
248
bp_version_bump();
249
}
250
251
+ /** Upgrade Routines **********************************************************/
252
+
253
/**
254
* Remove unused metadata from database when upgrading from < 1.5.
255
*
345
* - Ensure that the activity tables are installed, for last_activity storage.
346
* - Migrate last_activity data from usermeta to activity table
347
* - Add values for all BuddyPress options to the options table
348
+ *
349
+ * @since BuddyPress (2.0.0)
350
*/
351
function bp_update_to_2_0() {
352
353
/** Install activity tables for 'last_activity' ***************************/
354
362
363
if ( ! is_multisite() ) {
364
365
+ // Maybe install the signups table
366
+ bp_core_maybe_install_signups();
367
368
+ // Run the migration script
369
+ bp_members_migrate_signups();
370
}
371
372
/** Add BP options to the options table ***********************************/
374
bp_add_options();
375
}
376
377
+ /**
378
+ * 2.0.1 database upgrade routine
379
+ *
380
+ * @since BuddyPress (2.0.1)
381
+ *
382
+ * @return void
383
+ */
384
+ function bp_update_to_2_0_1() {
385
+
386
+ // We purposely call this during both the 2.0 upgrade and the 2.0.1 upgrade.
387
+ // Don't worry; it won't break anything, and safely handles all cases.
388
+ bp_core_maybe_install_signups();
389
+ }
390
+
391
/**
392
* Redirect user to BP's What's New page on first page load after activation.
393
*
413
set_transient( '_bp_activation_redirect', true, 30 );
414
}
415
416
+ /** Signups *******************************************************************/
417
+
418
+ /**
419
+ * Check if the signups table needs to be created.
420
+ *
421
+ * @since BuddyPress (2.0.0)
422
+ *
423
+ * @global WPDB $wpdb
424
+ *
425
+ * @return bool If signups table exists
426
+ */
427
+ function bp_core_maybe_install_signups() {
428
+
429
+ // Bail if we are explicitly not upgrading global tables
430
+ if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
431
+ return false;
432
+ }
433
+
434
+ global $wpdb;
435
+
436
+ // The table to run queries against
437
+ $signups_table = $wpdb->base_prefix . 'signups';
438
+
439
+ // Suppress errors because users shouldn't see what happens next
440
+ $old_suppress = $wpdb->suppress_errors();
441
+
442
+ // Never use bp_core_get_table_prefix() for any global users tables
443
+ $table_exists = (bool) $wpdb->get_results( "DESCRIBE {$signups_table};" );
444
+
445
+ // Table already exists, so maybe upgrade instead?
446
+ if ( true === $table_exists ) {
447
+
448
+ // Look for the 'signup_id' column
449
+ $column_exists = $wpdb->query( "SHOW COLUMNS FROM {$signups_table} LIKE 'signup_id'" );
450
+
451
+ // 'signup_id' column doesn't exist, so run the upgrade
452
+ if ( empty( $column_exists ) ) {
453
+ bp_core_upgrade_signups();
454
+ }
455
+
456
+ // Table does not exist, and we are a single site, so install the multisite
457
+ // signups table using WordPress core's database schema.
458
+ } elseif ( ! is_multisite() ) {
459
+ bp_core_install_signups();
460
+ }
461
+
462
+ // Restore previous error suppression setting
463
+ $wpdb->suppress_errors( $old_suppress );
464
+ }
465
+
466
/** Activation Actions ********************************************************/
467
468
/**
bp-groups/bp-groups-functions.php CHANGED
@@ -101,6 +101,7 @@ function groups_create_group( $args = '' ) {
101
$group = groups_get_group( array( 'group_id' => (int) $group_id ) );
102
$name = ! empty( $name ) ? $name : $group->name;
103
$slug = ! empty( $slug ) ? $slug : $group->slug;
104
105
// Groups need at least a name
106
if ( empty( $name ) ) {
101
$group = groups_get_group( array( 'group_id' => (int) $group_id ) );
102
$name = ! empty( $name ) ? $name : $group->name;
103
$slug = ! empty( $slug ) ? $slug : $group->slug;
104
+ $description = ! empty( $description ) ? $description : $group->description;
105
106
// Groups need at least a name
107
if ( empty( $name ) ) {
bp-groups/bp-groups-template.php CHANGED
@@ -159,9 +159,29 @@ class BP_Groups_Template {
159
if ( 'invites' == $type ) {
160
$this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page, $exclude );
161
} else if ( 'single-group' == $type ) {
162
- $group = new stdClass;
163
- $group->group_id = bp_get_current_group_id();
164
- $this->groups = array( $group );
165
} else {
166
$this->groups = groups_get_groups( array(
167
'type' => $type,
@@ -185,9 +205,13 @@ class BP_Groups_Template {
185
$this->group_count = (int) $this->groups['total'];
186
$this->groups = $this->groups['groups'];
187
} else if ( 'single-group' == $type ) {
188
- $this->single_group = true;
189
- $this->total_group_count = 1;
190
- $this->group_count = 1;
191
} else {
192
if ( empty( $max ) || $max >= (int) $this->groups['total'] ) {
193
$this->total_group_count = (int) $this->groups['total'];
@@ -260,9 +284,6 @@ class BP_Groups_Template {
260
$this->in_the_loop = true;
261
$this->group = $this->next_group();
262
263
- if ( $this->single_group )
264
- $this->group = groups_get_current_group();
265
-
266
if ( 0 == $this->current_group ) // loop has just started
267
do_action('group_loop_start');
268
}
159
if ( 'invites' == $type ) {
160
$this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page, $exclude );
161
} else if ( 'single-group' == $type ) {
162
+ $this->single_group = true;
163
+
164
+ if ( groups_get_current_group() ) {
165
+ $group = groups_get_current_group();
166
+
167
+ } else {
168
+ $group = groups_get_group( array(
169
+ 'group_id' => BP_Groups_Group::get_id_from_slug( $r['slug'] ),
170
+ 'populate_extras' => $r['populate_extras'],
171
+ ) );
172
+ }
173
+
174
+ // backwards compatibility - the 'group_id' variable is not part of the
175
+ // BP_Groups_Group object, but we add it here for devs doing checks against it
176
+ //
177
+ // @see https://buddypress.trac.wordpress.org/changeset/3540
178
+ //
179
+ // this is subject to removal in a future release; devs should check against
180
+ // $group->id instead
181
+ $group->group_id = $group->id;
182
+
183
+ $this->groups = array( $group );
184
+
185
} else {
186
$this->groups = groups_get_groups( array(
187
'type' => $type,
205
$this->group_count = (int) $this->groups['total'];
206
$this->groups = $this->groups['groups'];
207
} else if ( 'single-group' == $type ) {
208
+ if ( empty( $group->id ) ) {
209
+ $this->total_group_count = 0;
210
+ $this->group_count = 0;
211
+ } else {
212
+ $this->total_group_count = 1;
213
+ $this->group_count = 1;
214
+ }
215
} else {
216
if ( empty( $max ) || $max >= (int) $this->groups['total'] ) {
217
$this->total_group_count = (int) $this->groups['total'];
284
$this->in_the_loop = true;
285
$this->group = $this->next_group();
286
287
if ( 0 == $this->current_group ) // loop has just started
288
do_action('group_loop_start');
289
}
bp-languages/buddypress.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
msgstr ""
5
"Project-Id-Version: BuddyPress \n"
6
"Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
7
- "POT-Creation-Date: 2014-04-15 14:30:37+00:00\n"
8
"MIME-Version: 1.0\n"
9
"Content-Type: text/plain; charset=UTF-8\n"
10
"Content-Transfer-Encoding: 8bit\n"
@@ -316,8 +316,8 @@ msgstr ""
316
#: bp-activity/bp-activity-admin.php:672 bp-activity/bp-activity-admin.php:1391
317
#: bp-forums/bp-forums-template.php:2112 bp-groups/bp-groups-admin.php:1396
318
#: bp-themes/bp-default/functions.php:509 bp-xprofile/bp-xprofile-admin.php:402
319
- #: bp-xprofile/bp-xprofile-loader.php:193
320
- #: bp-xprofile/bp-xprofile-loader.php:271
321
msgid "Edit"
322
msgstr ""
323
@@ -618,7 +618,7 @@ msgid "Search Activity..."
618
msgstr ""
619
620
#: bp-activity/bp-activity-loader.php:165
621
- #: bp-activity/bp-activity-loader.php:286
622
msgid "Personal"
623
msgstr ""
624
@@ -684,7 +684,7 @@ msgstr ""
684
#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:212
685
#: bp-themes/bp-default/groups/single/admin.php:185
686
#: bp-themes/bp-default/groups/single/admin.php:212
687
- #: bp-xprofile/bp-xprofile-loader.php:317
688
msgid "Profile picture of %s"
689
msgstr ""
690
@@ -860,8 +860,8 @@ msgstr ""
860
#: bp-templates/bp-legacy/buddypress-functions.php:248
861
#: bp-themes/bp-default/activity/entry.php:37
862
#: bp-themes/bp-default/functions.php:166
863
- #: bp-xprofile/bp-xprofile-loader.php:183
864
- #: bp-xprofile/bp-xprofile-loader.php:263
865
msgid "View"
866
msgstr ""
867
@@ -1692,23 +1692,23 @@ msgstr ""
1692
msgid "About"
1693
msgstr ""
1694
1695
- #: bp-core/bp-core-admin.php:496 bp-core/bp-core-admin.php:645
1696
msgid "Welcome to BuddyPress %s"
1697
msgstr ""
1698
1699
- #: bp-core/bp-core-admin.php:499
1700
msgid "It&#8217;s a great time to use BuddyPress! With a focus on speed, admin tools, and developer enhancements, %s is our leanest and most powerful version yet."
1701
msgstr ""
1702
1703
- #: bp-core/bp-core-admin.php:501
1704
msgid "Thanks for updating! With a focus on speed, admin tools, and developer enhancements, BuddyPress %s is our leanest and most powerful version yet."
1705
msgstr ""
1706
1707
- #: bp-core/bp-core-admin.php:509 bp-core/bp-core-admin.php:651
1708
msgid "What&#8217;s New"
1709
msgstr ""
1710
1711
- #: bp-core/bp-core-admin.php:511 bp-core/bp-core-admin.php:653
1712
msgid "Credits"
1713
msgstr ""
1714
@@ -1828,47 +1828,43 @@ msgstr ""
1828
msgid "<a href=\"%s\">&hellip;and lots more!</a>"
1829
msgstr ""
1830
1831
- #: bp-core/bp-core-admin.php:623 bp-core/bp-core-admin.php:757
1832
msgid "Go to the BuddyPress Settings page"
1833
msgstr ""
1834
1835
- #: bp-core/bp-core-admin.php:646
1836
- msgid "BuddyPress %s is our first version with a new component in over two years. Not only that, there are plenty of new features, enhancements, and bug fixes."
1837
- msgstr ""
1838
-
1839
- #: bp-core/bp-core-admin.php:657
1840
msgid "BuddyPress is created by a worldwide network of friendly folks."
1841
msgstr ""
1842
1843
- #: bp-core/bp-core-admin.php:659
1844
msgid "Project Leaders"
1845
msgstr ""
1846
1847
- #: bp-core/bp-core-admin.php:664
1848
msgid "Project Lead"
1849
msgstr ""
1850
1851
- #: bp-core/bp-core-admin.php:669 bp-core/bp-core-admin.php:674
1852
msgid "Lead Developer"
1853
msgstr ""
1854
1855
- #: bp-core/bp-core-admin.php:678
1856
msgid "Core Team"
1857
msgstr ""
1858
1859
- #: bp-core/bp-core-admin.php:683 bp-core/bp-core-admin.php:688
1860
msgid "Core Developer"
1861
msgstr ""
1862
1863
- #: bp-core/bp-core-admin.php:693
1864
msgid "Navigator"
1865
msgstr ""
1866
1867
- #: bp-core/bp-core-admin.php:697
1868
msgid "Recent Rockstars"
1869
msgstr ""
1870
1871
- #: bp-core/bp-core-admin.php:709
1872
msgid "Contributors to BuddyPress 2.0"
1873
msgstr ""
1874
@@ -2153,10 +2149,10 @@ msgid "Not recently active"
2153
msgstr ""
2154
2155
#: bp-core/bp-core-loader.php:233 bp-members/bp-members-admin.php:329
2156
- #: bp-members/bp-members-loader.php:184 bp-xprofile/bp-xprofile-loader.php:162
2157
- #: bp-xprofile/bp-xprofile-loader.php:223
2158
- #: bp-xprofile/bp-xprofile-loader.php:255
2159
- #: bp-xprofile/bp-xprofile-loader.php:295
2160
msgid "Profile"
2161
msgstr ""
2162
@@ -2340,7 +2336,7 @@ msgstr ""
2340
#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:8
2341
#: bp-themes/bp-default/activity/post-form.php:45
2342
#: bp-themes/bp-default/members/single/profile/profile-wp.php:8
2343
- #: bp-xprofile/bp-xprofile-loader.php:312
2344
msgid "My Profile"
2345
msgstr ""
2346
@@ -2842,7 +2838,7 @@ msgstr ""
2842
msgid "A member accepts your friendship request"
2843
msgstr ""
2844
2845
- #: bp-friends/bp-friends-template.php:66 bp-xprofile/bp-xprofile-loader.php:122
2846
msgid "My Friends"
2847
msgstr ""
2848
@@ -4566,8 +4562,8 @@ msgstr ""
4566
msgid "<strong>ERROR</strong>: Couldn&#8217;t register you. Please contact the <a href=\"mailto:%s\">webmaster</a>."
4567
msgstr ""
4568
4569
- #: bp-members/bp-members-classes.php:512 bp-members/bp-members-classes.php:573
4570
- #: bp-members/bp-members-classes.php:628
4571
msgid "the sign-up has already been activated."
4572
msgstr ""
4573
@@ -6264,8 +6260,8 @@ msgstr ""
6264
6265
#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:1
6266
#: bp-themes/bp-default/members/single/profile/change-avatar.php:1
6267
- #: bp-xprofile/bp-xprofile-loader.php:205
6268
- #: bp-xprofile/bp-xprofile-loader.php:280
6269
msgid "Change Avatar"
6270
msgstr ""
6271
@@ -7159,15 +7155,15 @@ msgstr ""
7159
msgid "Add Another Option"
7160
msgstr ""
7161
7162
- #: bp-xprofile/bp-xprofile-loader.php:107
7163
msgid "Everyone"
7164
msgstr ""
7165
7166
- #: bp-xprofile/bp-xprofile-loader.php:111
7167
msgid "Only Me"
7168
msgstr ""
7169
7170
- #: bp-xprofile/bp-xprofile-loader.php:115
7171
msgid "All Members"
7172
msgstr ""
7173
4
msgstr ""
5
"Project-Id-Version: BuddyPress \n"
6
"Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
7
+ "POT-Creation-Date: 2014-04-18 17:30:35+00:00\n"
8
"MIME-Version: 1.0\n"
9
"Content-Type: text/plain; charset=UTF-8\n"
10
"Content-Transfer-Encoding: 8bit\n"
316
#: bp-activity/bp-activity-admin.php:672 bp-activity/bp-activity-admin.php:1391
317
#: bp-forums/bp-forums-template.php:2112 bp-groups/bp-groups-admin.php:1396
318
#: bp-themes/bp-default/functions.php:509 bp-xprofile/bp-xprofile-admin.php:402
319
+ #: bp-xprofile/bp-xprofile-loader.php:195
320
+ #: bp-xprofile/bp-xprofile-loader.php:273
321
msgid "Edit"
322
msgstr ""
323
618
msgstr ""
619
620
#: bp-activity/bp-activity-loader.php:165
621
+ #: bp-activity/bp-activity-loader.php:276
622
msgid "Personal"
623
msgstr ""
624
684
#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:212
685
#: bp-themes/bp-default/groups/single/admin.php:185
686
#: bp-themes/bp-default/groups/single/admin.php:212
687
+ #: bp-xprofile/bp-xprofile-loader.php:314
688
msgid "Profile picture of %s"
689
msgstr ""
690
860
#: bp-templates/bp-legacy/buddypress-functions.php:248
861
#: bp-themes/bp-default/activity/entry.php:37
862
#: bp-themes/bp-default/functions.php:166
863
+ #: bp-xprofile/bp-xprofile-loader.php:185
864
+ #: bp-xprofile/bp-xprofile-loader.php:265
865
msgid "View"
866
msgstr ""
867
1692
msgid "About"
1693
msgstr ""
1694
1695
+ #: bp-core/bp-core-admin.php:496 bp-core/bp-core-admin.php:647
1696
msgid "Welcome to BuddyPress %s"
1697
msgstr ""
1698
1699
+ #: bp-core/bp-core-admin.php:499 bp-core/bp-core-admin.php:650
1700
msgid "It&#8217;s a great time to use BuddyPress! With a focus on speed, admin tools, and developer enhancements, %s is our leanest and most powerful version yet."
1701
msgstr ""
1702
1703
+ #: bp-core/bp-core-admin.php:501 bp-core/bp-core-admin.php:652
1704
msgid "Thanks for updating! With a focus on speed, admin tools, and developer enhancements, BuddyPress %s is our leanest and most powerful version yet."
1705
msgstr ""
1706
1707
+ #: bp-core/bp-core-admin.php:509 bp-core/bp-core-admin.php:660
1708
msgid "What&#8217;s New"
1709
msgstr ""
1710
1711
+ #: bp-core/bp-core-admin.php:511 bp-core/bp-core-admin.php:662
1712
msgid "Credits"
1713
msgstr ""
1714
1828
msgid "<a href=\"%s\">&hellip;and lots more!</a>"
1829
msgstr ""
1830
1831
+ #: bp-core/bp-core-admin.php:623 bp-core/bp-core-admin.php:766
1832
msgid "Go to the BuddyPress Settings page"
1833
msgstr ""
1834
1835
+ #: bp-core/bp-core-admin.php:666
1836
msgid "BuddyPress is created by a worldwide network of friendly folks."
1837
msgstr ""
1838
1839
+ #: bp-core/bp-core-admin.php:668
1840
msgid "Project Leaders"
1841
msgstr ""
1842
1843
+ #: bp-core/bp-core-admin.php:673
1844
msgid "Project Lead"
1845
msgstr ""
1846
1847
+ #: bp-core/bp-core-admin.php:678 bp-core/bp-core-admin.php:683
1848
msgid "Lead Developer"
1849
msgstr ""
1850
1851
+ #: bp-core/bp-core-admin.php:687
1852
msgid "Core Team"
1853
msgstr ""
1854
1855
+ #: bp-core/bp-core-admin.php:692 bp-core/bp-core-admin.php:697
1856
msgid "Core Developer"
1857
msgstr ""
1858
1859
+ #: bp-core/bp-core-admin.php:702
1860
msgid "Navigator"
1861
msgstr ""
1862
1863
+ #: bp-core/bp-core-admin.php:706
1864
msgid "Recent Rockstars"
1865
msgstr ""
1866
1867
+ #: bp-core/bp-core-admin.php:718
1868
msgid "Contributors to BuddyPress 2.0"
1869
msgstr ""
1870
2149
msgstr ""
2150
2151
#: bp-core/bp-core-loader.php:233 bp-members/bp-members-admin.php:329
2152
+ #: bp-members/bp-members-loader.php:184 bp-xprofile/bp-xprofile-loader.php:164
2153
+ #: bp-xprofile/bp-xprofile-loader.php:225
2154
+ #: bp-xprofile/bp-xprofile-loader.php:257
2155
+ #: bp-xprofile/bp-xprofile-loader.php:339
2156
msgid "Profile"
2157
msgstr ""
2158
2336
#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:8
2337
#: bp-themes/bp-default/activity/post-form.php:45
2338
#: bp-themes/bp-default/members/single/profile/profile-wp.php:8
2339
+ #: bp-xprofile/bp-xprofile-loader.php:309
2340
msgid "My Profile"
2341
msgstr ""
2342
2838
msgid "A member accepts your friendship request"
2839
msgstr ""
2840
2841
+ #: bp-friends/bp-friends-template.php:66 bp-xprofile/bp-xprofile-loader.php:124
2842
msgid "My Friends"
2843
msgstr ""
2844
4562
msgid "<strong>ERROR</strong>: Couldn&#8217;t register you. Please contact the <a href=\"mailto:%s\">webmaster</a>."
4563
msgstr ""
4564
4565
+ #: bp-members/bp-members-classes.php:512 bp-members/bp-members-classes.php:577
4566
+ #: bp-members/bp-members-classes.php:632
4567
msgid "the sign-up has already been activated."
4568
msgstr ""
4569
6260
6261
#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:1
6262
#: bp-themes/bp-default/members/single/profile/change-avatar.php:1
6263
+ #: bp-xprofile/bp-xprofile-loader.php:207
6264
+ #: bp-xprofile/bp-xprofile-loader.php:282
6265
msgid "Change Avatar"
6266
msgstr ""
6267
7155
msgid "Add Another Option"
7156
msgstr ""
7157
7158
+ #: bp-xprofile/bp-xprofile-loader.php:109
7159
msgid "Everyone"
7160
msgstr ""
7161
7162
+ #: bp-xprofile/bp-xprofile-loader.php:113
7163
msgid "Only Me"
7164
msgstr ""
7165
7166
+ #: bp-xprofile/bp-xprofile-loader.php:117
7167
msgid "All Members"
7168
msgstr ""
7169
bp-loader.php CHANGED
@@ -16,7 +16,7 @@
16
* 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.
17
* Author: The BuddyPress Community
18
* Author URI: http://buddypress.org/community/members/
19
- * Version: 2.0
20
* Text Domain: buddypress
21
* Domain Path: /bp-languages/
22
* License: GPLv2 or later (license.txt)
@@ -303,8 +303,8 @@ class BuddyPress {
303
304
/** Versions **************************************************/
305
306
- $this->version = '2.0';
307
- $this->db_version = 7892;
308
309
/** Loading ***************************************************/
310
16
* 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.
17
* Author: The BuddyPress Community
18
* Author URI: http://buddypress.org/community/members/
19
+ * Version: 2.0.1
20
* Text Domain: buddypress
21
* Domain Path: /bp-languages/
22
* License: GPLv2 or later (license.txt)
303
304
/** Versions **************************************************/
305
306
+ $this->version = '2.0.1';
307
+ $this->db_version = 8311;
308
309
/** Loading ***************************************************/
310
bp-members/bp-members-admin.php CHANGED
@@ -822,6 +822,10 @@ class BP_Members_Admin {
822
return;
823
}
824
825
if ( $this->users_page != get_current_screen()->id ) {
826
return;
827
}
822
return;
823
}
824
825
+ if ( ! function_exists( 'get_current_screen' ) ) {
826
+ return;
827
+ }
828
+
829
if ( $this->users_page != get_current_screen()->id ) {
830
return;
831
}
bp-members/bp-members-classes.php CHANGED
@@ -565,9 +565,13 @@ class BP_Signup {
565
566
if ( ! empty( $user->errors ) ) {
567
568
- $user_id = username_exists( $signup->user_login ) && 2 != self::check_user_status( $user_id );
569
570
- if ( !empty( $user_id ) ) {
571
572
// Status is not 2, so user's account has been activated
573
$result['errors'][ $signup->signup_id ] = array( $signup->user_login, esc_html__( 'the sign-up has already been activated.', 'buddypress' ) );
565
566
if ( ! empty( $user->errors ) ) {
567
568
+ $user_id = username_exists( $signup->user_login );
569
570
+ if ( 2 !== self::check_user_status( $user_id ) ) {
571
+ $user_id = false;
572
+ }
573
+
574
+ if ( empty( $user_id ) ) {
575
576
// Status is not 2, so user's account has been activated
577
$result['errors'][ $signup->signup_id ] = array( $signup->user_login, esc_html__( 'the sign-up has already been activated.', 'buddypress' ) );
bp-members/bp-members-functions.php CHANGED
@@ -1054,10 +1054,6 @@ function bp_core_delete_account( $user_id = 0 ) {
1054
if ( empty( $user_id ) )
1055
$user_id = bp_loggedin_user_id();
1056
1057
- // Bail if account deletion is disabled
1058
- if ( bp_disable_account_deletion() )
1059
- return false;
1060
-
1061
// Site admins cannot be deleted
1062
if ( is_super_admin( $user_id ) )
1063
return false;
@@ -1637,6 +1633,87 @@ function bp_core_activate_signup( $key ) {
1637
return $user_id;
1638
}
1639
1640
function bp_core_new_user_activity( $user ) {
1641
if ( empty( $user ) || !bp_is_active( 'activity' ) )
1642
return false;
1054
if ( empty( $user_id ) )
1055
$user_id = bp_loggedin_user_id();
1056
1057
// Site admins cannot be deleted
1058
if ( is_super_admin( $user_id ) )
1059
return false;
1633
return $user_id;
1634
}
1635
1636
+ /**
1637
+ * Migrate signups from pre-2.0 configuration to wp_signups.
1638
+ *
1639
+ * @since BuddyPress (2.0.1)
1640
+ */
1641
+ function bp_members_migrate_signups() {
1642
+ global $wpdb;
1643
+
1644
+ $status_2_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->users} WHERE user_status = '2'" );
1645
+
1646
+ if ( ! empty( $status_2_ids ) ) {
1647
+ $signups = get_users( array(
1648
+ 'fields' => array(
1649
+ 'ID',
1650
+ 'user_login',
1651
+ 'user_pass',
1652
+ 'user_registered',
1653
+ 'user_email',
1654
+ 'display_name',
1655
+ ),
1656
+ 'include' => $status_2_ids,
1657
+ ) );
1658
+
1659
+ // Fetch activation keys separately, to avoid the all_with_meta
1660
+ // overhead
1661
+ $status_2_ids_sql = implode( ',', $status_2_ids );
1662
+ $ak_data = $wpdb->get_results( "SELECT user_id, meta_value FROM {$wpdb->usermeta} WHERE meta_key = 'activation_key' AND user_id IN ({$status_2_ids_sql})" );
1663
+
1664
+ // Rekey
1665
+ $activation_keys = array();
1666
+ foreach ( $ak_data as $ak_datum ) {
1667
+ $activation_keys[ intval( $ak_datum->user_id ) ] = $ak_datum->meta_value;
1668
+ }
1669
+
1670
+ unset( $status_2_ids_sql, $status_2_ids, $ak_data );
1671
+
1672
+ // Merge
1673
+ foreach ( $signups as &$signup ) {
1674
+ if ( isset( $activation_keys[ $signup->ID ] ) ) {
1675
+ $signup->activation_key = $activation_keys[ $signup->ID ];
1676
+ }
1677
+ }
1678
+
1679
+ // Reset the signup var as we're using it to process the migration
1680
+ unset( $signup );
1681
+
1682
+ } else {
1683
+ return;
1684
+ }
1685
+
1686
+ foreach ( $signups as $signup ) {
1687
+ $meta = array();
1688
+
1689
+ // Rebuild the activation key, if missing
1690
+ if ( empty( $signup->activation_key ) ) {
1691
+ $signup->activation_key = wp_hash( $signup->ID );
1692
+ }
1693
+
1694
+ if ( bp_is_active( 'xprofile' ) ) {
1695
+ $meta['field_1'] = $signup->display_name;
1696
+ }
1697
+
1698
+ $meta['password'] = $signup->user_pass;
1699
+
1700
+ $user_login = preg_replace( '/\s+/', '', sanitize_user( $signup->user_login, true ) );
1701
+ $user_email = sanitize_email( $signup->user_email );
1702
+
1703
+ BP_Signup::add( array(
1704
+ 'user_login' => $user_login,
1705
+ 'user_email' => $user_email,
1706
+ 'registered' => $signup->user_registered,
1707
+ 'activation_key' => $signup->activation_key,
1708
+ 'meta' => $meta
1709
+ ) );
1710
+
1711
+ // Deleting these options will remove signups from users count
1712
+ delete_user_option( $signup->ID, 'capabilities' );
1713
+ delete_user_option( $signup->ID, 'user_level' );
1714
+ }
1715
+ }
1716
+
1717
function bp_core_new_user_activity( $user ) {
1718
if ( empty( $user ) || !bp_is_active( 'activity' ) )
1719
return false;
bp-settings/bp-settings-actions.php CHANGED
@@ -333,6 +333,11 @@ function bp_settings_action_delete_account() {
333
return;
334
}
335
336
// Nonce check
337
check_admin_referer( 'delete-account' );
338
333
return;
334
}
335
336
+ // Bail if account deletion is disabled
337
+ if ( bp_disable_account_deletion() && ! bp_current_user_can( 'delete_users' ) ) {
338
+ return false;
339
+ }
340
+
341
// Nonce check
342
check_admin_referer( 'delete-account' );
343
bp-templates/bp-legacy/buddypress-functions.php CHANGED
@@ -706,7 +706,7 @@ function bp_legacy_theme_post_update() {
706
if ( empty( $activity_id ) )
707
exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem posting your update, please try again.', 'buddypress' ) . '</p></div>' );
708
709
- $last_recorded = isset( $_POST['since'] ) ? date( 'Y-m-d H:i:s', intval( $_POST['since'] ) ) : 0;
710
if ( $last_recorded ) {
711
$activity_args = array( 'since' => $last_recorded );
712
$bp->activity->last_recorded = $last_recorded;
706
if ( empty( $activity_id ) )
707
exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem posting your update, please try again.', 'buddypress' ) . '</p></div>' );
708
709
+ $last_recorded = ! empty( $_POST['since'] ) ? date( 'Y-m-d H:i:s', intval( $_POST['since'] ) ) : 0;
710
if ( $last_recorded ) {
711
$activity_args = array( 'since' => $last_recorded );
712
$bp->activity->last_recorded = $last_recorded;
bp-xprofile/bp-xprofile-activity.php CHANGED
@@ -235,6 +235,10 @@ function bp_xprofile_updated_profile_activity( $user_id, $field_ids, $errors, $o
235
return false;
236
}
237
238
// Don't post if there have been no changes, or if the changes are
239
// related solely to non-public fields
240
$public_changes = false;
235
return false;
236
}
237
238
+ if ( ! bp_is_active( 'activity' ) ) {
239
+ return false;
240
+ }
241
+
242
// Don't post if there have been no changes, or if the changes are
243
// related solely to non-public fields
244
$public_changes = false;
bp-xprofile/bp-xprofile-classes.php CHANGED
@@ -1514,6 +1514,7 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type {
1514
<div class="datebox">
1515
1516
<label for="<?php bp_the_profile_field_input_name(); ?>_day"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
1517
1518
<select <?php echo $day_html; ?>>
1519
<?php bp_the_profile_field_options( array( 'type' => 'day', 'user_id' => $user_id ) ); ?>
@@ -1738,6 +1739,7 @@ class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type {
1738
<div class="checkbox">
1739
1740
<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
1741
<?php bp_the_profile_field_options( "user_id={$user_id}" ); ?>
1742
1743
</div>
@@ -1875,6 +1877,7 @@ class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type {
1875
<div class="radio">
1876
1877
<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
1878
<?php bp_the_profile_field_options( "user_id={$user_id}" );
1879
1880
if ( ! bp_get_the_profile_field_is_required() ) : ?>
@@ -2019,6 +2022,7 @@ class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type {
2019
) );
2020
?>
2021
<label for="<?php bp_the_profile_field_input_name(); ?>[]"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
2022
<select <?php echo $html; ?>>
2023
<?php bp_the_profile_field_options( "user_id={$user_id}" ); ?>
2024
</select>
@@ -2163,6 +2167,7 @@ class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type {
2163
$html = $this->get_edit_field_html_elements( $raw_properties );
2164
?>
2165
<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
2166
<select <?php echo $html; ?>>
2167
<?php bp_the_profile_field_options( "user_id={$user_id}" ); ?>
2168
</select>
@@ -2302,6 +2307,7 @@ class BP_XProfile_Field_Type_Textarea extends BP_XProfile_Field_Type {
2302
) );
2303
?>
2304
<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
2305
<textarea <?php echo $html; ?>><?php bp_the_profile_field_edit_value(); ?></textarea>
2306
<?php
2307
}
@@ -2384,6 +2390,7 @@ class BP_XProfile_Field_Type_Textbox extends BP_XProfile_Field_Type {
2384
) );
2385
?>
2386
<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
2387
<input <?php echo $html; ?>>
2388
<?php
2389
}
@@ -2463,6 +2470,7 @@ class BP_XProfile_Field_Type_Number extends BP_XProfile_Field_Type {
2463
) );
2464
?>
2465
<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
2466
<input <?php echo $html; ?>>
2467
<?php
2468
}
@@ -2496,6 +2504,52 @@ class BP_XProfile_Field_Type_Number extends BP_XProfile_Field_Type {
2496
public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
2497
}
2498
2499
/**
2500
* Represents a type of XProfile field and holds meta information about the type of value that it accepts.
2501
*
1514
<div class="datebox">
1515
1516
<label for="<?php bp_the_profile_field_input_name(); ?>_day"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
1517
+ <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
1518
1519
<select <?php echo $day_html; ?>>
1520
<?php bp_the_profile_field_options( array( 'type' => 'day', 'user_id' => $user_id ) ); ?>
1739
<div class="checkbox">
1740
1741
<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
1742
+ <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
1743
<?php bp_the_profile_field_options( "user_id={$user_id}" ); ?>
1744
1745
</div>
1877
<div class="radio">
1878
1879
<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
1880
+ <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
1881
<?php bp_the_profile_field_options( "user_id={$user_id}" );
1882
1883
if ( ! bp_get_the_profile_field_is_required() ) : ?>
2022
) );
2023
?>
2024
<label for="<?php bp_the_profile_field_input_name(); ?>[]"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
2025
+ <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
2026
<select <?php echo $html; ?>>
2027
<?php bp_the_profile_field_options( "user_id={$user_id}" ); ?>
2028
</select>
2167
$html = $this->get_edit_field_html_elements( $raw_properties );
2168
?>
2169
<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
2170
+ <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
2171
<select <?php echo $html; ?>>
2172
<?php bp_the_profile_field_options( "user_id={$user_id}" ); ?>
2173
</select>
2307
) );
2308
?>
2309
<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
2310
+ <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
2311
<textarea <?php echo $html; ?>><?php bp_the_profile_field_edit_value(); ?></textarea>
2312
<?php
2313
}
2390
) );
2391
?>
2392
<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
2393
+ <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
2394
<input <?php echo $html; ?>>
2395
<?php
2396
}
2470
) );
2471
?>
2472
<label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php esc_html_e( '(required)', 'buddypress' ); ?><?php endif; ?></label>
2473
+ <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
2474
<input <?php echo $html; ?>>
2475
<?php
2476
}
2504
public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
2505
}
2506
2507
+ /**
2508
+ * A placeholder xprofile field type. Doesn't do anything.
2509
+ *
2510
+ * Used if an existing field has an unknown type (e.g. one provided by a missing third-party plugin).
2511
+ *
2512
+ * @since BuddyPress (2.0.1)
2513
+ */
2514
+ class BP_XProfile_Field_Type_Placeholder extends BP_XProfile_Field_Type {
2515
+
2516
+ /**
2517
+ * Constructor for the placeholder field type.
2518
+ *
2519
+ * @since BuddyPress (2.0.1)
2520
+ */
2521
+ public function __construct() {
2522
+ $this->set_format( '/.*/', 'replace' );
2523
+ }
2524
+
2525
+ /**
2526
+ * Prevent any HTML being output for this field type.
2527
+ *
2528
+ * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.text.html permitted attributes} that you want to add.
2529
+ * @since BuddyPress (2.0.1)
2530
+ */
2531
+ public function edit_field_html( array $raw_properties = array() ) {
2532
+ }
2533
+
2534
+ /**
2535
+ * Prevent any HTML being output for this field type.
2536
+ *
2537
+ * @param array $raw_properties Optional key/value array of permitted attributes that you want to add.
2538
+ * @since BuddyPress (2.0.1)
2539
+ */
2540
+ public function admin_field_html( array $raw_properties = array() ) {
2541
+ }
2542
+
2543
+ /**
2544
+ * Prevent any HTML being output for this field type.
2545
+ *
2546
+ * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen.
2547
+ * @param string $control_type Optional. HTML input type used to render the current field's child options.
2548
+ * @since BuddyPress (2.0.1)
2549
+ */
2550
+ public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {}
2551
+ }
2552
+
2553
/**
2554
* Represents a type of XProfile field and holds meta information about the type of value that it accepts.
2555
*
bp-xprofile/bp-xprofile-functions.php CHANGED
@@ -95,13 +95,12 @@ function bp_xprofile_create_field_type( $type ) {
95
$class = isset( $field[$type] ) ? $field[$type] : '';
96
97
/**
98
- * For backpat and to handle (missing) field types introduced by other plugins, fallback to
99
- * textbox if a type is unknown. Textbox validation and display is intentionally low key.
100
*/
101
if ( $class && class_exists( $class ) ) {
102
return new $class;
103
} else {
104
- return new BP_XProfile_Field_Type_Textbox;
105
}
106
}
107
95
$class = isset( $field[$type] ) ? $field[$type] : '';
96
97
/**
98
+ * To handle (missing) field types, fallback to a placeholder field object if a type is unknown.
99
*/
100
if ( $class && class_exists( $class ) ) {
101
return new $class;
102
} else {
103
+ return new BP_XProfile_Field_Type_Placeholder;
104
}
105
}
106
bp-xprofile/bp-xprofile-screens.php CHANGED
@@ -232,5 +232,5 @@ function bp_xprofile_screen_settings() {
232
}
233
234
// Load the template
235
- bp_core_load_template( apply_filters( 'bp_settings_screen_xprofile', '/members/single/plugin' ) );
236
}
232
}
233
234
// Load the template
235
+ bp_core_load_template( apply_filters( 'bp_settings_screen_xprofile', '/members/single/settings/profile' ) );
236
}
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: johnjamesjacoby, DJPaul, boonebgorges, r-a-y
3
Tags: social networking, activity, profiles, messaging, friends, groups, forums, notifications, settings, twitter, facebook, social, community, networks, networking, cms
4
Requires at least: 3.6
5
Tested up to: 3.9
6
- Stable tag: 2.0
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
@@ -77,6 +77,9 @@ BuddyPress is available in more than 20 languages. For more information, check o
77
78
== Upgrade Notice ==
79
80
= 2.0 =
81
See: http://codex.buddypress.org/releases/version-2-0/
82
@@ -139,6 +142,12 @@ Fixes over 10 bugs.
139
140
== Changelog ==
141
142
= 1.9 =
143
See: http://codex.buddypress.org/releases/version-1-9/
144
3
Tags: social networking, activity, profiles, messaging, friends, groups, forums, notifications, settings, twitter, facebook, social, community, networks, networking, cms
4
Requires at least: 3.6
5
Tested up to: 3.9
6
+ Stable tag: 2.0.1
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
77
78
== Upgrade Notice ==
79
80
+ = 2.0.1 =
81
+ See: http://codex.buddypress.org/releases/version-2-0-1/
82
+
83
= 2.0 =
84
See: http://codex.buddypress.org/releases/version-2-0/
85
142
143
== Changelog ==
144
145
+ = 2.0.1 =
146
+ See: http://codex.buddypress.org/releases/version-2-0-1/
147
+
148
+ = 2.0 =
149
+ See: http://codex.buddypress.org/releases/version-2-0/
150
+
151
= 1.9 =
152
See: http://codex.buddypress.org/releases/version-1-9/
153