Skip to:
Content

BuddyPress.org

Changeset 1977


Ignore:
Timestamp:
09/28/2009 07:42:55 PM (15 years ago)
Author:
apeatling
Message:

Xprofile fixes - default option radio button on field creation. Disabling register page for logged in site admins as it causes problems. Datebox tweaks.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-signup.php

    r1952 r1977  
    77        return false;
    88       
    9     /* If the user is logged in, and is not a site admin, redirect away from here */
    10     if ( is_user_logged_in() && !is_site_admin() )
     9    /* If the user is logged in, redirect away from here */
     10    if ( is_user_logged_in() )
    1111        bp_core_redirect( $bp->root_domain );
    1212   
     
    210210    if ( false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php') )
    211211        return false;
    212        
     212
    213213    if ( '' != locate_template( array( 'registration/register.php' ), false ) || '' != locate_template( array( 'register.php' ), false ) )
    214214        die;
  • trunk/bp-xprofile.php

    r1960 r1977  
    883883    if ( !$user_id )
    884884        $user_id = $bp->displayed_user->id;
     885   
     886    if ( !$user_id )
     887        return false;
    885888
    886889    if ( is_numeric( $field ) )
     
    891894    if ( !$field_id )
    892895        return false;
    893        
     896
    894897    return apply_filters( 'xprofile_get_field_data', BP_XProfile_ProfileData::get_value_byid( $field_id, $user_id ) );
    895898}
  • trunk/bp-xprofile/admin/js/admin.js

    r1798 r1977  
    2828   
    2929    isDefault.setAttribute('value', theId);
    30 
     30   
    3131    var label1 = document.createElement('label');
    3232    var txt1 = document.createTextNode(" Default Value ");
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r1960 r1977  
    503503                   
    504504                    <p><?php _e('Option', 'buddypress') ?> 1: <input type="text" name="<?php echo $type ?>_option[1]" id="<?php echo $type ?>_option1" />
    505                     <input type="<?php echo $default_input ?>" name="isDefault_<?php echo $type ?>_option<?php echo $default_name; ?>" id="isDefault_<?php echo $type ?>_option" <?php if ( $default_input == 'radio' ) {?> checked="checked"<?php } ?>" value="1" /> <?php _e( 'Default Value', 'buddypress' ) ?>
     505                    <input type="<?php echo $default_input ?>" name="isDefault_<?php echo $type ?>_option<?php echo $default_name; ?>" id="isDefault_<?php echo $type ?>_option" value="1" /> <?php _e( 'Default Value', 'buddypress' ) ?>
    506506                    <input type="hidden" name="<?php echo $type ?>_option_number" id="<?php echo $type ?>_option_number" value="2" />
    507507               
  • trunk/bp-xprofile/bp-xprofile-templatetags.php

    r1973 r1977  
    471471           
    472472            case 'datebox':
    473                
     473           
    474474                if ( $field->data->value != '' ) {
    475475                    $day = date("j", $field->data->value);
     
    477477                    $year = date("Y", $field->data->value);
    478478                    $default_select = ' selected="selected"';
    479                    
    480                     /* Check for updated posted values, but errors preventing them from being saved first time */
    481                     if ( isset( $_POST['field_' . $field->id . '_day'] ) && $day != $_POST['field_' . $field->id . '_day'] ) {
    482                         if ( !empty( $_POST['field_' . $field->id . '_day'] ) )
    483                             $day = $_POST['field_' . $field->id . '_day'];
    484                     }
    485                    
    486                     if ( isset( $_POST['field_' . $field->id . '_month'] ) && $month != $_POST['field_' . $field->id . '_month'] ) {
    487                         if ( !empty( $_POST['field_' . $field->id . '_month'] ) )
    488                             $month = $_POST['field_' . $field->id . '_month'];
    489                     }
    490                    
    491                     if ( isset( $_POST['field_' . $field->id . '_year'] ) && $year != date("j", $_POST['field_' . $field->id . '_year'] ) ) {
    492                         if ( !empty( $_POST['field_' . $field->id . '_year'] ) )
    493                             $year = $_POST['field_' . $field->id . '_year'];
    494                     }
     479                }
     480               
     481                /* Check for updated posted values, but errors preventing them from being saved first time */
     482                if ( isset( $_POST['field_' . $field->id . '_day'] ) && $day != $_POST['field_' . $field->id . '_day'] ) {
     483                    if ( !empty( $_POST['field_' . $field->id . '_day'] ) )
     484                        $day = $_POST['field_' . $field->id . '_day'];
     485                }
     486               
     487                if ( isset( $_POST['field_' . $field->id . '_month'] ) && $month != $_POST['field_' . $field->id . '_month'] ) {
     488                    if ( !empty( $_POST['field_' . $field->id . '_month'] ) )
     489                        $month = $_POST['field_' . $field->id . '_month'];
     490                }
     491               
     492                if ( isset( $_POST['field_' . $field->id . '_year'] ) && $year != date("j", $_POST['field_' . $field->id . '_year'] ) ) {
     493                    if ( !empty( $_POST['field_' . $field->id . '_year'] ) )
     494                        $year = $_POST['field_' . $field->id . '_year'];
    495495                }
    496496               
Note: See TracChangeset for help on using the changeset viewer.