Ticket #3865: 3865.diff
File 3865.diff, 4.1 KB (added by , 18 years ago) |
---|
-
wp-admin/admin-functions.php
8 8 return $result; 9 9 } 10 10 11 function has_edit_date_changed() { 12 if($_POST['aa']!=$_POST['aaold'] || $_POST['mm']!=$_POST['mmold'] || $_POST['jj']!=$_POST['jjold'] || $_POST['hh']!=$_POST['hhold'] || $_POST['mn'] != $_POST['mnold'] || $_POST['ss']!=$_POST['ssold']) { 13 return true; 14 } 15 16 return false; 17 } 18 11 19 // Creates a new post from the "Write Post" form using $_POST information. 12 20 function wp_write_post() { 13 21 global $user_ID; … … 91 99 if (!isset( $_POST['ping_status'] )) 92 100 $_POST['ping_status'] = 'closed'; 93 101 94 if ( !empty ( $_POST['edit_date'] )) {102 if (has_edit_date_changed()) { 95 103 $aa = $_POST['aa']; 96 104 $mm = $_POST['mm']; 97 105 $jj = $_POST['jj']; … … 257 265 if (!isset( $_POST['ping_status'] )) 258 266 $_POST['ping_status'] = 'closed'; 259 267 260 if ( !empty ( $_POST['edit_date'] )) {268 if (has_edit_date_changed()) { 261 269 $aa = $_POST['aa']; 262 270 $mm = $_POST['mm']; 263 271 $jj = $_POST['jj']; … … 315 323 $_POST['comment_content'] = $_POST['content']; 316 324 $_POST['comment_ID'] = (int) $_POST['comment_ID']; 317 325 318 if ( !empty ( $_POST['edit_date'] )) {326 if (has_edit_date_changed()) { 319 327 $aa = $_POST['aa']; 320 328 $mm = $_POST['mm']; 321 329 $jj = $_POST['jj']; … … 1090 1098 if ( $for_post ) 1091 1099 $edit = ( ('draft' == $post->post_status ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true; 1092 1100 1093 echo '<fieldset> <legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" /> <label for="timestamp">'.__( 'Edit timestamp' ).'</label></legend>';1101 echo '<fieldset>'; 1094 1102 1095 1103 $time_adj = time() + (get_option( 'gmt_offset' ) * 3600 ); 1096 1104 $post_date = ($for_post) ? $post->post_date : $comment->comment_date; … … 1101 1109 $mn = ($edit) ? mysql2date( 'i', $post_date ) : gmdate( 'i', $time_adj ); 1102 1110 $ss = ($edit) ? mysql2date( 's', $post_date ) : gmdate( 's', $time_adj ); 1103 1111 1104 echo "<select name=\"mm\" onchange=\"edit_date.checked=true\">\n";1112 echo "<select name=\"mm\">\n"; 1105 1113 for ( $i = 1; $i < 13; $i = $i +1 ) { 1106 1114 echo "\t\t\t<option value=\"$i\""; 1107 1115 if ( $i == $mm ) … … 1110 1118 } 1111 1119 ?> 1112 1120 </select> 1113 <input type="text" id="jj" name="jj" value="<?php echo $jj; ?>" size="2" maxlength="2" onchange="edit_date.checked=true"/> 1114 <input type="text" id="aa" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" onchange="edit_date.checked=true" /> @ 1115 <input type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> : 1116 <input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> 1117 <input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" /> 1121 <input type="text" id="jj" name="jj" value="<?php echo $jj; ?>" size="2" maxlength="2" /> 1122 <input type="text" id="aa" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" /> @ 1123 <input type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" /> : 1124 <input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" /> 1125 <input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" /> 1126 1127 <input type="hidden" id="mmold" name="mmold" value="<?php echo $mm; ?>" size="2" maxlength="2" /> 1128 <input type="hidden" id="jjold" name="jjold" value="<?php echo $jj; ?>" size="2" maxlength="2" /> 1129 <input type="hidden" id="aaold" name="aaold" value="<?php echo $aa ?>" size="4" maxlength="5" /> 1130 <input type="hidden" id="hhold" name="hhold" value="<?php echo $hh ?>" size="2" maxlength="2" /> 1131 <input type="hidden" id="mnold" name="mnold" value="<?php echo $mn ?>" size="2" maxlength="2" /> 1132 <input type="hidden" id="ssold" name="ssold" value="<?php echo $ss ?>" size="2" maxlength="2" /> 1118 1133 <?php 1119 1134 if ( $edit ) { 1120 1135 printf( __('Existing timestamp: %1$s %2$s, %3$s @ %4$s:%5$s' ), $wp_locale->get_month( $mm ), $jj, $aa, $hh, $mn );