Changeset 5131
- Timestamp:
- 09/09/2011 05:47:59 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-signup.php
r5014 r5131 77 77 if ( !isset( $_POST['field_' . $field_id] ) ) { 78 78 if ( isset( $_POST['field_' . $field_id . '_day'] ) ) 79 $_POST['field_' . $field_id] = strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year']);79 $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] ) ); 80 80 } 81 81 … … 128 128 if ( !isset( $_POST['field_' . $field_id] ) ) { 129 129 if ( isset( $_POST['field_' . $field_id . '_day'] ) ) 130 $_POST['field_' . $field_id] = strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year']);130 $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] ) ); 131 131 } 132 132 -
trunk/bp-xprofile/bp-xprofile-filters.php
r4961 r5131 110 110 } 111 111 112 /** 113 * xprofile_filter_format_field_value() 114 * 115 * Runs stripslashes on XProfile fields. If is field_type is 'datebox' 116 * then the date will be formatted by bp_format_time(). 117 * 118 * @since 1.0.0 119 * 120 * @param string $field_value XProfile field_value to be filtered. 121 * @param string $field_type XProfile field_type to be filtered. 122 * 123 * @uses bp_format_time() 124 * 125 * @return string $field_value Filtered XProfile field_value. False on failure. 126 */ 112 127 function xprofile_filter_format_field_value( $field_value, $field_type = '' ) { 113 128 if ( !isset( $field_value ) || empty( $field_value ) ) 114 129 return false; 115 130 116 if ( 'datebox' == $field_type ) 117 $field_value = bp_format_time( $field_value, true, false ); 118 else 131 if ( 'datebox' == $field_type ) { 132 133 // If Unix timestamp 134 if ( is_numeric( $field_value ) ) 135 $field_value = bp_format_time( $field_value, true, false ); 136 137 // If MySQL timestamp 138 else 139 $field_value = bp_format_time( strtotime( $field_value ), true, false ); 140 141 } else { 119 142 $field_value = str_replace(']]>', ']]>', $field_value ); 143 } 120 144 121 145 return stripslashes( $field_value ); -
trunk/bp-xprofile/bp-xprofile-screens.php
r4961 r5131 71 71 72 72 // Turn the concatenated value into a timestamp 73 $_POST['field_' . $field_id] = strtotime( $date_value);73 $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $date_value ) ); 74 74 } 75 75 -
trunk/bp-xprofile/bp-xprofile-template.php
r5045 r5131 570 570 571 571 if ( !empty( $date ) ) { 572 $day = date( 'j', $date ); 573 $month = date( 'F', $date ); 574 $year = date( 'Y', $date ); 572 // If Unix timestamp 573 if ( is_numeric( $date ) ) { 574 $day = date( 'j', $date ); 575 $month = date( 'F', $date ); 576 $year = date( 'Y', $date ); 577 578 // If MySQL timestamp 579 } else { 580 $day = mysql2date( 'j', $date ); 581 $month = mysql2date( 'F', $date ); 582 $year = mysql2date( 'Y', $date ); 583 } 575 584 } 576 585
Note: See TracChangeset
for help on using the changeset viewer.