Changeset 6
- Timestamp:
- 04/01/2008 10:55:22 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp_default_theme
-
Property
eol-style:native
set to
bp_core.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/archive.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/archives.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/attachment.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/blog.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/comments-popup.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/comments.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/footer.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/functions.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/header.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/images
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/index.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/links.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/page.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/rtl.css
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/screenshot.png
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/search.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/searchform.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/sidebar.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/single.php
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/style.css
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_default_theme/tweaked_style.css
-
Property
eol-style:native
set to
404.php
-
Property
eol-style:native
set to
-
trunk/bp_friends.php
-
Property
eol-style:native
set to
bp_core.php
-
Property
eol-style:native
set to
-
trunk/bp_groups
-
Property
eol-style:native
set to
bp_core.php
-
Property
eol-style:native
set to
-
trunk/bp_groups.php
-
Property
eol-style:native
set to
bp_core.php
-
Property
eol-style:native
set to
-
trunk/bp_messages
-
Property
eol-style:native
set to
bp_core.php
-
Property
eol-style:native
set to
-
trunk/bp_messages.php
-
Property
eol-style:native
set to
bp_core.php
-
Property
eol-style:native
set to
-
trunk/bp_xprofile
-
Property
eol-style:native
set to
bp_core.php
-
Property
eol-style:native
set to
-
trunk/bp_xprofile.php
-
Property
eol-style:native
set to
bp_core.php
r5 r6 218 218 219 219 <?php 220 220 221 221 if($group->fields) 222 222 { … … 227 227 { 228 228 $field = new BP_XProfile_Field($group->fields[$j]->id); 229 $field_ids[] = $group->fields[$j]->id; 229 230 230 231 if(isset($_GET['mode']) && $_GET['mode'] == "save") 231 232 { 232 233 $post_field_string = ( $group->fields[$j]->type == 'datebox' ) ? '_day' : null; 233 $current_field = $_POST['field_' . $group->fields[$j]->id . $post_field_string]; 234 235 if(isset($current_field) /*&& ($field->data->value != $current_field)*/) 234 $posted_fields = explode(",", $_POST['field_ids']); 235 $current_field = $_POST['field_' . $posted_fields[$j] . $post_field_string]; 236 237 if(($field->is_required && !isset($current_field)) || 238 ($field->is_required && $current_field == '')) 236 239 { 237 if($field->is_required && $current_field == '') 240 // Validate the field. 241 $field->message = __($field->name . ' cannot be left blank.'); 242 $errors[] = $field->message . "<br />"; 243 } 244 else if(!$field->is_required && $current_field == '') 245 { 246 // data removed, so delete the field data from the DB. 247 $profile_data = new BP_Xprofile_ProfileData($group->fields[$j]->id); 248 $profile_data->delete(); 249 $field->data->value = null; 250 } 251 else 252 { 253 // Field validates, save. 254 $profile_data = new BP_Xprofile_ProfileData; 255 $profile_data->field_id = $group->fields[$j]->id; 256 $profile_data->user_id = $userdata->ID; 257 $profile_data->last_updated = time(); 258 259 if($post_field_string != null) 238 260 { 239 // Validate the field. 240 $field->message = __($field->name . ' cannot be left blank.'); 241 $errors[] = $field->message . "<br />"; 261 $date_value = $_POST['field_' . $group->fields[$j]->id . '_day'] . 262 $_POST['field_' . $group->fields[$j]->id . '_month'] . 263 $_POST['field_' . $group->fields[$j]->id . '_year']; 264 265 $profile_data->value = strtotime($date_value); 242 266 } 243 else if(!$field->is_required && $current_field == '')267 else 244 268 { 245 // data removed, so delete the field data from the DB. 246 $profile_data = new BP_Xprofile_ProfileData($group->fields[$j]->id); 247 $profile_data->delete(); 248 $field->data->value = null; 269 $profile_data->value = $current_field; 270 } 271 272 if(!$profile_data->save()) 273 { 274 $field->message = __('There was a problem saving changes to this field, please try again.'); 249 275 } 250 276 else 251 277 { 252 // Field validates, save. 253 $profile_data = new BP_Xprofile_ProfileData; 254 $profile_data->field_id = $group->fields[$j]->id; 255 $profile_data->user_id = $userdata->ID; 256 $profile_data->last_updated = time(); 257 258 if($post_field_string != null) 259 { 260 $date_value = $_POST['field_' . $group->fields[$j]->id . '_day'] . 261 $_POST['field_' . $group->fields[$j]->id . '_month'] . 262 $_POST['field_' . $group->fields[$j]->id . '_year']; 263 264 $profile_data->value = strtotime($date_value); 265 } 266 else 267 { 268 $profile_data->value = $current_field; 269 } 270 271 if(!$profile_data->save()) 272 { 273 $field->message = __('There was a problem saving changes to this field, please try again.'); 274 } 275 else 276 { 277 $field->data->value = $profile_data->value; 278 } 278 $field->data->value = $profile_data->value; 279 279 } 280 280 } … … 322 322 323 323 <form action="admin.php?page=<?php echo $_GET['page'] ?>&mode=save" method="post"> 324 324 <?php $field_ids = implode(",", $field_ids); ?> 325 <input type="hidden" name="field_ids" id="field_ids" value="<?php echo $field_ids; ?>" /> 326 325 327 <?php echo $list_html; ?> 326 328 -
Property
eol-style:native
set to
-
trunk/bp_xprofile/bp_xprofile.classes.php
-
Property
eol-style:native
set to
bp_xprofile.admin.php
r5 r6 611 611 { 612 612 $options = $this->get_children(); 613 613 614 ?> 614 615 … … 616 617 617 618 <h2><?php _e("Profile Settings") ?> » <?php _e('Add Field') ?></h2> 618 619 <p>You are adding a new field to the group "<?php echo $this->name; ?>".</p>620 619 621 620 <?php if($message != '') { ?> -
Property
eol-style:native
set to
-
trunk/bp_xprofile/bp_xprofile.cssjs.php
-
Property
eol-style:native
set to
bp_xprofile.admin.php
-
Property
eol-style:native
set to
-
trunk/bp_xprofile/bp_xprofile.setup.php
-
Property
eol-style:native
set to
bp_xprofile.admin.php
-
Property
eol-style:native
set to
-
trunk/bp_xprofile/bp_xprofile.signup.php
-
Property
eol-style:native
set to
bp_xprofile.admin.php
-
Property
eol-style:native
set to
-
trunk/bp_xprofile/images
-
Property
eol-style:native
set to
bp_xprofile.admin.php
-
Property
eol-style:native
set to
Note: See TracChangeset
for help on using the changeset viewer.