Commit 636cb7f2 authored by lechuck's avatar lechuck Committed by lucha
Browse files

Upgraded Buddypress to version 2.0.2

parent dde8528f
......@@ -16,7 +16,7 @@
* 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.
* Author: The BuddyPress Community
* Author URI: http://buddypress.org/community/members/
* Version: 2.0.1
* Version: 2.0.2
* Text Domain: buddypress
* Domain Path: /bp-languages/
* License: GPLv2 or later (license.txt)
......@@ -303,7 +303,7 @@ class BuddyPress {
/** Versions **************************************************/
$this->version = '2.0.1';
$this->version = '2.0.2';
$this->db_version = 8311;
/** Loading ***************************************************/
......
......@@ -2,7 +2,7 @@
* Theme Name: BuddyPress Default
* Theme URI: http://buddypress.org/extend/themes/
* Description: Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor.
* Version: 1.9
* Version: 2.0.2
* Author: the BuddyPress team
* Author URI: http://buddypress.org
* License: GNU General Public License
......
......@@ -2,7 +2,7 @@
* Theme Name: BuddyPress Default
* Theme URI: http://buddypress.org/extend/themes/
* Description: [NOTE: except for security issues, BuddyPress Default is no longer being actively maintained by the BuddyPress team.] Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor.
* Version: 1.9
* Version: 2.0.2
* Author: the BuddyPress team
* Author URI: http://buddypress.org
* License: GNU General Public License
......
......@@ -1189,10 +1189,12 @@ class BP_XProfile_ProfileData {
// If no value was found, cache an empty item
// to avoid future cache misses
} else {
$d = new stdClass;
$d->id = '';
$d->field_id = $field_id;
$d->value = '';
$d = new stdClass;
$d->id = '';
$d->user_id = '';
$d->field_id = $field_id;
$d->value = '';
$d->last_updated = '';
wp_cache_set( $field_id, $d, $cache_group );
}
......@@ -1547,8 +1549,9 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type {
* @since BuddyPress (2.0.0)
*/
public function edit_field_options_html( array $args = array() ) {
$options = $this->field_obj->get_children();
$date = BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] );
$options = $this->field_obj->get_children();
$date = BP_XProfile_ProfileData::get_value_byid( $this->field_obj->id, $args['user_id'] );
$eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' );
$day = 0;
$month = 0;
......@@ -1579,12 +1582,17 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type {
}
if ( ! empty( $_POST['field_' . $this->field_obj->id . '_month'] ) ) {
$new_month = (int) $_POST['field_' . $this->field_obj->id . '_month'];
$month = ( $month != $new_month ) ? $new_month : $month;
if ( in_array( $_POST['field_' . $this->field_obj->id . '_month'], $eng_months ) ) {
$new_month = $_POST['field_' . $this->field_obj->id . '_month'];
} else {
$new_month = $month;
}
$month = ( $month !== $new_month ) ? $new_month : $month;
}
if ( ! empty( $_POST['field_' . $this->field_obj->id . '_year'] ) ) {
$new_year = date( 'j', (int) $_POST['field_' . $this->field_obj->id . '_year'] );
$new_year = (int) $_POST['field_' . $this->field_obj->id . '_year'];
$year = ( $year != $new_year ) ? $new_year : $year;
}
......@@ -1599,8 +1607,6 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type {
break;
case 'month':
$eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' );
$months = array(
__( 'January', 'buddypress' ),
__( 'February', 'buddypress' ),
......@@ -2830,9 +2836,14 @@ abstract class BP_XProfile_Field_Type {
<p class="sortable">
<span>&nbsp;&Xi;&nbsp;</span>
<input type="text" name="<?php echo esc_attr( "{$type}_option[{$j}]" ); ?>" id="<?php echo esc_attr( "{$type}_option{$j}" ); ?>" value="<?php echo esc_attr( $options[$i]->name ); ?>" />
<input type="text" name="<?php echo esc_attr( "{$type}_option[{$j}]" ); ?>" id="<?php echo esc_attr( "{$type}_option{$j}" ); ?>" value="<?php echo esc_attr( stripslashes( $options[$i]->name ) ); ?>" />
<input type="<?php echo esc_attr( $control_type ); ?>" name="<?php echo esc_attr( "isDefault_{$type}_option{$default_name}" ); ?>" <?php checked( $options[$i]->is_default_option, true ); ?> value="<?php echo esc_attr( $j ); ?>" />
<span><?php _e( 'Default Value', 'buddypress' ); ?></span>
<?php if ( 1 <= $i ) : ?>
<a href="<?php echo esc_url( 'users.php?page=bp-profile-setup&amp;mode=delete_option&amp;option_id=' . $options[$i]->id ); ?>" class="ajax-option-delete" id="delete-<?php echo esc_attr( $options[$i]->id ); ?>">[x]</a>
<?php endif ;?>
</p>
<?php endfor; ?>
......
......@@ -108,15 +108,7 @@ function xprofile_screen_edit_profile() {
// Certain types of fields (checkboxes, multiselects) may come through empty. Save them as an empty array so that they don't get overwritten by the default on the next edit.
$value = isset( $_POST['field_' . $field_id] ) ? $_POST['field_' . $field_id] : '';
if ( !xprofile_set_field_data( $field_id, bp_displayed_user_id(), $value, $is_required[$field_id] ) ) {
$errors = true;
} else {
do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
}
// Save the visibility level
$visibility_level = !empty( $_POST['field_' . $field_id . '_visibility'] ) ? $_POST['field_' . $field_id . '_visibility'] : 'public';
xprofile_set_field_visibility_level( $field_id, bp_displayed_user_id(), $visibility_level );
// Save the old and new values. They will be
// passed to the filter and used to determine
......@@ -129,6 +121,15 @@ function xprofile_screen_edit_profile() {
'value' => $value,
'visibility' => $visibility_level,
);
if ( !xprofile_set_field_data( $field_id, bp_displayed_user_id(), $value, $is_required[$field_id] ) ) {
$errors = true;
} else {
do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
}
// Save the visibility level
xprofile_set_field_visibility_level( $field_id, bp_displayed_user_id(), $visibility_level );
}
do_action( 'xprofile_updated_profile', bp_displayed_user_id(), $posted_field_ids, $errors, $old_values, $new_values );
......
......@@ -731,7 +731,7 @@ function bp_profile_visibility_radio_buttons( $args = '' ) {
<?php echo $r['before_radio']; ?>
<label for="<?php esc_attr( 'see-field_' . $r['field_id'] . '_' . $level['id'] ); ?>">
<label for="<?php echo esc_attr( 'see-field_' . $r['field_id'] . '_' . $level['id'] ); ?>">
<input type="radio" id="<?php echo esc_attr( 'see-field_' . $r['field_id'] . '_' . $level['id'] ); ?>" name="<?php echo esc_attr( 'field_' . $r['field_id'] . '_visibility' ); ?>" value="<?php echo esc_attr( $level['id'] ); ?>" <?php checked( $level['id'], bp_get_the_profile_field_visibility_level() ); ?> />
<span class="field-visibility-text"><?php echo esc_html( $level['label'] ); ?></span>
</label>
......
......@@ -2,8 +2,8 @@
Contributors: johnjamesjacoby, DJPaul, boonebgorges, r-a-y
Tags: social networking, activity, profiles, messaging, friends, groups, forums, notifications, settings, twitter, facebook, social, community, networks, networking, cms
Requires at least: 3.6
Tested up to: 3.9
Stable tag: 2.0.1
Tested up to: 3.9.1
Stable tag: 2.0.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
......@@ -77,6 +77,9 @@ BuddyPress is available in more than 20 languages. For more information, check o
== Upgrade Notice ==
= 2.0.2 =
See: http://codex.buddypress.org/releases/version-2-0-2/
= 2.0.1 =
See: http://codex.buddypress.org/releases/version-2-0-1/
......@@ -142,6 +145,9 @@ Fixes over 10 bugs.
== Changelog ==
= 2.0.2 =
See: http://codex.buddypress.org/releases/version-2-0-2/
= 2.0.1 =
See: http://codex.buddypress.org/releases/version-2-0-1/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment