Changeset 3643
- Timestamp:
- 01/01/2011 09:36:22 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core.php
r3641 r3643 1174 1174 if ( !$fullname = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) { 1175 1175 if ( bp_is_active( 'xprofile' ) ) { 1176 $fullname = xprofile_get_field_data( $bp->site_options['bp-xprofile-fullname-field-name'], $user_id );1176 $fullname = xprofile_get_field_data( stripslashes( $bp->site_options['bp-xprofile-fullname-field-name'] ), $user_id ); 1177 1177 1178 1178 if ( empty($fullname) ) { -
trunk/bp-core/admin/bp-core-admin.php
r3477 r3643 36 36 37 37 if ( bp_is_active( 'xprofile' ) ) { 38 if ( 'bp-xprofile-base-group-name' == $key ) { 39 $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET name = %s WHERE id = 1", $value ) ); 40 } 41 42 if ( 'bp-xprofile-fullname-field-name' == $key ) { 43 $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET name = %s WHERE group_id = 1 AND id = 1", $value ) ); 44 } 38 if ( 'bp-xprofile-base-group-name' == $key ) 39 $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET name = %s WHERE id = 1", stripslashes( $value ) ) ); 40 elseif ( 'bp-xprofile-fullname-field-name' == $key ) 41 $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET name = %s WHERE group_id = 1 AND id = 1", stripslashes( $value ) ) ); 45 42 } 46 43 … … 68 65 <th scope="row"><?php _e( 'Base profile group name', 'buddypress' ) ?>:</th> 69 66 <td> 70 <input name="bp-admin[bp-xprofile-base-group-name]" id="bp-xprofile-base-group-name" value="<?php echo get_site_option('bp-xprofile-base-group-name') ?>" />67 <input name="bp-admin[bp-xprofile-base-group-name]" id="bp-xprofile-base-group-name" value="<?php echo esc_attr( stripslashes( get_site_option( 'bp-xprofile-base-group-name' ) ) ) ?>" /> 71 68 </td> 72 69 </tr> … … 74 71 <th scope="row"><?php _e( 'Full Name field name', 'buddypress' ) ?>:</th> 75 72 <td> 76 <input name="bp-admin[bp-xprofile-fullname-field-name]" id="bp-xprofile-fullname-field-name" value="<?php echo get_site_option('bp-xprofile-fullname-field-name') ?>" />73 <input name="bp-admin[bp-xprofile-fullname-field-name]" id="bp-xprofile-fullname-field-name" value="<?php echo esc_attr( stripslashes( get_site_option( 'bp-xprofile-fullname-field-name' ) ) ) ?>" /> 77 74 </td> 78 75 </tr> -
trunk/bp-core/admin/bp-core-schema.php
r3592 r3643 197 197 $charset_collate = bp_core_set_charset(); 198 198 199 update_site_option( 'bp-xprofile-base-group-name', 'Base');200 update_site_option( 'bp-xprofile-fullname-field-name', 'Name');199 update_site_option( 'bp-xprofile-base-group-name', _x( 'Base', 'First XProfile group name', 'buddypress' ) ); 200 update_site_option( 'bp-xprofile-fullname-field-name', _x( 'Name', 'XProfile fullname field name', 'buddypress' ) ); 201 201 202 202 $sql[] = "CREATE TABLE {$wpdb->base_prefix}bp_xprofile_groups ( … … 251 251 dbDelta( $sql ); 252 252 253 / * Insert the default group and fields */254 $insert_sql = false;253 // Insert the default group and fields 254 $insert_sql = array(); 255 255 256 256 if ( !$wpdb->get_var( "SELECT id FROM {$wpdb->base_prefix}bp_xprofile_groups WHERE id = 1" ) ) 257 $insert_sql[] = "INSERT INTO {$wpdb->base_prefix}bp_xprofile_groups ( name, description, can_delete ) VALUES ( '" . get_site_option( 'bp-xprofile-base-group-name' ) . "', '', 0 );";257 $insert_sql[] = "INSERT INTO {$wpdb->base_prefix}bp_xprofile_groups ( name, description, can_delete ) VALUES ( " . $wpdb->prepare( '%s', stripslashes( get_site_option( 'bp-xprofile-base-group-name' ) ) ) . ", '', 0 );"; 258 258 259 259 if ( !$wpdb->get_var( "SELECT id FROM {$wpdb->base_prefix}bp_xprofile_fields WHERE id = 1" ) ) 260 $insert_sql[] = "INSERT INTO {$wpdb->base_prefix}bp_xprofile_fields ( group_id, parent_id, type, name, description, is_required, can_delete ) VALUES ( 1, 0, 'textbox', '" . get_site_option( 'bp-xprofile-fullname-field-name' ) . "', '', 1, 0 );";260 $insert_sql[] = "INSERT INTO {$wpdb->base_prefix}bp_xprofile_fields ( group_id, parent_id, type, name, description, is_required, can_delete ) VALUES ( 1, 0, 'textbox', " . $wpdb->prepare( '%s', stripslashes( get_site_option( 'bp-xprofile-fullname-field-name' ) ) ) . ", '', 1, 0 );"; 261 261 262 262 dbDelta( $insert_sql ); -
trunk/bp-xprofile.php
r3592 r3643 26 26 27 27 /* Assign the base group and fullname field names to constants to use in SQL statements */ 28 define ( 'BP_XPROFILE_BASE_GROUP_NAME', $bp->site_options['bp-xprofile-base-group-name']);29 define ( 'BP_XPROFILE_FULLNAME_FIELD_NAME', $bp->site_options['bp-xprofile-fullname-field-name']);28 define ( 'BP_XPROFILE_BASE_GROUP_NAME', stripslashes( $bp->site_options['bp-xprofile-base-group-name'] ) ); 29 define ( 'BP_XPROFILE_FULLNAME_FIELD_NAME', stripslashes( $bp->site_options['bp-xprofile-fullname-field-name'] ) ); 30 30 31 31 /* For internal identification */ -
trunk/bp-xprofile/bp-xprofile-admin.php
r3560 r3643 48 48 </h2> 49 49 <p><?php _e( 'Your users will distinguish themselves through their profile page. You must give them profile fields that allow them to describe themselves in a way that is relevant to the theme of your social network.', 'buddypress'); ?></p> 50 <p><?php echo sprintf( __( 'NOTE: Any fields in the "%s" group will appear on the signup page.', 'buddypress' ), get_site_option( 'bp-xprofile-base-group-name' ) );?></p>50 <p><?php echo sprintf( __( 'NOTE: Any fields in the "%s" group will appear on the signup page.', 'buddypress' ), esc_html( stripslashes( get_site_option( 'bp-xprofile-base-group-name' ) ) ) ) ?></p> 51 51 52 52 <form action="" id="profile-field-form" method="post">
Note: See TracChangeset
for help on using the changeset viewer.