Changeset 11323
- Timestamp:
- 05/14/2009 02:00:32 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-attachment-rows.php
r11245 r11323 132 132 $t_time = get_the_time(__('Y/m/d g:i:s A')); 133 133 $m_time = $post->post_date; 134 $time = get_post_time( 'G', true, $post );134 $time = get_post_time( 'G', true, $post, false ); 135 135 if ( ( abs($t_diff = time() - $time) ) < 86400 ) { 136 136 if ( $t_diff < 0 ) -
trunk/wp-admin/edit-form-advanced.php
r11312 r11323 42 42 43 43 // Detect if there exists an autosave newer than the post and if that autosave is different than the post 44 if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt) ) {44 if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) { 45 45 foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) { 46 46 if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) { -
trunk/wp-admin/edit-page-form.php
r11312 r11323 42 42 $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />"; 43 43 $autosave = wp_get_post_autosave( $post_ID ); 44 if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt) )44 if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) 45 45 $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); 46 46 } -
trunk/wp-admin/includes/template.php
r11322 r11323 1299 1299 <div class="ping_status">' . $post->ping_status . '</div> 1300 1300 <div class="_status">' . $post->post_status . '</div> 1301 <div class="jj">' . mysql2date( 'd', $post->post_date ) . '</div>1302 <div class="mm">' . mysql2date( 'm', $post->post_date ) . '</div>1303 <div class="aa">' . mysql2date( 'Y', $post->post_date ) . '</div>1304 <div class="hh">' . mysql2date( 'H', $post->post_date ) . '</div>1305 <div class="mn">' . mysql2date( 'i', $post->post_date ) . '</div>1306 <div class="ss">' . mysql2date( 's', $post->post_date ) . '</div>1301 <div class="jj">' . mysql2date( 'd', $post->post_date, false ) . '</div> 1302 <div class="mm">' . mysql2date( 'm', $post->post_date, false ) . '</div> 1303 <div class="aa">' . mysql2date( 'Y', $post->post_date, false ) . '</div> 1304 <div class="hh">' . mysql2date( 'H', $post->post_date, false ) . '</div> 1305 <div class="mn">' . mysql2date( 'i', $post->post_date, false ) . '</div> 1306 <div class="ss">' . mysql2date( 's', $post->post_date, false ) . '</div> 1307 1307 <div class="post_password">' . wp_specialchars($post->post_password, 1) . '</div>'; 1308 1308 … … 2533 2533 $time_adj = time() + (get_option( 'gmt_offset' ) * 3600 ); 2534 2534 $post_date = ($for_post) ? $post->post_date : $comment->comment_date; 2535 $jj = ($edit) ? mysql2date( 'd', $post_date ) : gmdate( 'd', $time_adj );2536 $mm = ($edit) ? mysql2date( 'm', $post_date ) : gmdate( 'm', $time_adj );2537 $aa = ($edit) ? mysql2date( 'Y', $post_date ) : gmdate( 'Y', $time_adj );2538 $hh = ($edit) ? mysql2date( 'H', $post_date ) : gmdate( 'H', $time_adj );2539 $mn = ($edit) ? mysql2date( 'i', $post_date ) : gmdate( 'i', $time_adj );2540 $ss = ($edit) ? mysql2date( 's', $post_date ) : gmdate( 's', $time_adj );2535 $jj = ($edit) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj ); 2536 $mm = ($edit) ? mysql2date( 'm', $post_date, false ) : gmdate( 'm', $time_adj ); 2537 $aa = ($edit) ? mysql2date( 'Y', $post_date, false ) : gmdate( 'Y', $time_adj ); 2538 $hh = ($edit) ? mysql2date( 'H', $post_date, false ) : gmdate( 'H', $time_adj ); 2539 $mn = ($edit) ? mysql2date( 'i', $post_date, false ) : gmdate( 'i', $time_adj ); 2540 $ss = ($edit) ? mysql2date( 's', $post_date, false ) : gmdate( 's', $time_adj ); 2541 2541 2542 2542 $cur_jj = gmdate( 'd', $time_adj ); -
trunk/wp-admin/includes/upgrade.php
r11318 r11323 682 682 if ( !empty($posts) ) 683 683 foreach ( $posts as $post ) 684 wp_schedule_single_event(mysql2date('U', $post->post_date ), 'publish_future_post', array($post->ID));684 wp_schedule_single_event(mysql2date('U', $post->post_date, false), 'publish_future_post', array($post->ID)); 685 685 } 686 686 } -
trunk/wp-admin/options-general.php
r11312 r11323 97 97 <tr> 98 98 <?php 99 if ( !wp_timezone_supported()) : // no magic timezone support here99 if ( !wp_timezone_supported() ) : // no magic timezone support here 100 100 ?> 101 101 <th scope="row"><label for="gmt_offset"><?php _e('Timezone') ?> </label></th> … … 125 125 ?> 126 126 </select> 127 <?php _e('hours') ?>127 <?php _e('hours'); ?> 128 128 <span id="utc-time"><?php printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), date_i18n( $time_format, false, 'gmt')); ?></span> 129 129 <?php if ($current_offset) : ?> -
trunk/wp-app.php
r11318 r11323 1107 1107 ?><feed xmlns="<?php echo $this->ATOM_NS ?>" xmlns:app="<?php echo $this->ATOMPUB_NS ?>" xml:lang="<?php echo get_option('rss_language'); ?>"> 1108 1108 <id><?php $this->the_entries_url() ?></id> 1109 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT') ); ?></updated>1109 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></updated> 1110 1110 <title type="text"><?php bloginfo_rss('name') ?></title> 1111 1111 <subtitle type="text"><?php bloginfo_rss("description") ?></subtitle> -
trunk/wp-includes/comment-template.php
r11316 r11323 354 354 global $comment; 355 355 if ( '' == $d ) 356 $date = mysql2date( 356 $date = mysql2date(get_option('date_format'), $comment->comment_date); 357 357 else 358 358 $date = mysql2date($d, $comment->comment_date); … … 592 592 * @param string $d Optional. The format of the time (defaults to user's config) 593 593 * @param bool $gmt Whether to use the GMT date 594 * @param bool $translate Whether to translate the time (for use in feeds) 594 595 * @return string The formatted time 595 596 */ 596 function get_comment_time( $d = '', $gmt = false ) {597 function get_comment_time( $d = '', $gmt = false, $translate = true ) { 597 598 global $comment; 598 599 $comment_date = $gmt? $comment->comment_date_gmt : $comment->comment_date; 599 600 if ( '' == $d ) 600 $date = mysql2date(get_option('time_format'), $comment_date );601 $date = mysql2date(get_option('time_format'), $comment_date, $translate); 601 602 else 602 $date = mysql2date($d, $comment_date );603 $date = mysql2date($d, $comment_date, $translate); 603 604 return apply_filters('get_comment_time', $date, $d, $gmt); 604 605 } -
trunk/wp-includes/comment.php
r11204 r11323 465 465 return; // don't throttle admins 466 466 if ( $lasttime = $wpdb->get_var( $wpdb->prepare("SELECT comment_date_gmt FROM $wpdb->comments WHERE comment_author_IP = %s OR comment_author_email = %s ORDER BY comment_date DESC LIMIT 1", $ip, $email) ) ) { 467 $time_lastcomment = mysql2date('U', $lasttime );468 $time_newcomment = mysql2date('U', $date );467 $time_lastcomment = mysql2date('U', $lasttime, false); 468 $time_newcomment = mysql2date('U', $date, false); 469 469 $flood_die = apply_filters('comment_flood_filter', false, $time_lastcomment, $time_newcomment); 470 470 if ( $flood_die ) { -
trunk/wp-includes/feed-atom-comments.php
r11303 r11323 25 25 <subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle> 26 26 27 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastcommentmodified('GMT') ); ?></updated>27 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastcommentmodified('GMT'), false); ?></updated> 28 28 <?php the_generator( 'atom' ); ?> 29 29 … … 66 66 67 67 <id><?php comment_guid(); ?></id> 68 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true ), false); ?></updated>69 <published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true ), false); ?></published>68 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true, false), false); ?></updated> 69 <published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true, false), false); ?></published> 70 70 <?php if ( post_password_required($comment_post) ) : ?> 71 71 <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php echo get_the_password_form(); ?>]]></content> -
trunk/wp-includes/feed-atom.php
r10952 r11323 20 20 <subtitle type="text"><?php bloginfo_rss("description") ?></subtitle> 21 21 22 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT') ); ?></updated>22 <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></updated> 23 23 <?php the_generator( 'atom' ); ?> 24 24 -
trunk/wp-includes/feed-rss2-comments.php
r11303 r11323 51 51 <link><?php comment_link() ?></link> 52 52 <dc:creator><?php echo get_comment_author_rss() ?></dc:creator> 53 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true ), false); ?></pubDate>53 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true, false), false); ?></pubDate> 54 54 <guid isPermaLink="false"><?php comment_guid() ?></guid> 55 55 <?php if ( post_password_required($comment_post) ) : ?> -
trunk/wp-includes/functions.php
r11315 r11323 123 123 $j = @$datefunc( $dateformatstring, $i ); 124 124 // allow plugins to redo this entirely for languages with untypical grammars 125 $j = apply_filters('date_i18n', $j, $req_format, $ unixtimestamp, $gmt);125 $j = apply_filters('date_i18n', $j, $req_format, $i, $gmt); 126 126 return $j; 127 127 } -
trunk/wp-includes/general-template.php
r11312 r11323 1178 1178 function the_date_xml() { 1179 1179 global $post; 1180 echo mysql2date('Y-m-d', $post->post_date );1180 echo mysql2date('Y-m-d', $post->post_date, false); 1181 1181 } 1182 1182 … … 1237 1237 function get_the_modified_date($d = '') { 1238 1238 if ( '' == $d ) 1239 $the_time = get_post_modified_time(get_option('date_format') );1239 $the_time = get_post_modified_time(get_option('date_format'), null, null, true); 1240 1240 else 1241 $the_time = get_post_modified_time($d );1241 $the_time = get_post_modified_time($d, null, null, true); 1242 1242 return apply_filters('get_the_modified_date', $the_time, $d); 1243 1243 } … … 1267 1267 1268 1268 if ( '' == $d ) 1269 $the_time = get_post_time(get_option('time_format'), false, $post );1269 $the_time = get_post_time(get_option('time_format'), false, $post, true); 1270 1270 else 1271 $the_time = get_post_time($d, false, $post );1271 $the_time = get_post_time($d, false, $post, true); 1272 1272 return apply_filters('get_the_time', $the_time, $d, $post); 1273 1273 } … … 1281 1281 * @param bool $gmt Whether of not to return the gmt time. 1282 1282 * @param int|object $post Optional post ID or object. Default is global $post object. 1283 * @param bool $translate Whether to translate the time string or not 1283 1284 * @return string 1284 1285 */ 1285 function get_post_time( $d = 'U', $gmt = false, $post = null ) { // returns timestamp1286 function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { // returns timestamp 1286 1287 $post = get_post($post); 1287 1288 … … 1291 1292 $time = $post->post_date; 1292 1293 1293 $time = mysql2date($d, $time );1294 $time = mysql2date($d, $time, $translate); 1294 1295 return apply_filters('get_post_time', $time, $d, $gmt); 1295 1296 } … … 1316 1317 function get_the_modified_time($d = '') { 1317 1318 if ( '' == $d ) 1318 $the_time = get_post_modified_time(get_option('time_format') );1319 $the_time = get_post_modified_time(get_option('time_format'), null, null, true); 1319 1320 else 1320 $the_time = get_post_modified_time($d );1321 $the_time = get_post_modified_time($d, null, null, true); 1321 1322 return apply_filters('get_the_modified_time', $the_time, $d); 1322 1323 } … … 1329 1330 * @param string $d Either 'G', 'U', or php date format. 1330 1331 * @param bool $gmt Whether of not to return the gmt time. 1332 * @param int|object $post A post_id or post object 1333 * @param bool translate Whether to translate the result or not 1331 1334 * @return string Returns timestamp 1332 1335 */ 1333 function get_post_modified_time( $d = 'U', $gmt = false ) {1334 global $post;1336 function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { 1337 $post = get_post($post); 1335 1338 1336 1339 if ( $gmt ) … … 1338 1341 else 1339 1342 $time = $post->post_modified; 1340 $time = mysql2date($d, $time );1343 $time = mysql2date($d, $time, $translate); 1341 1344 1342 1345 return apply_filters('get_the_modified_time', $time, $d, $gmt); … … 1352 1355 function the_weekday() { 1353 1356 global $wp_locale, $post; 1354 $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date ));1357 $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date, false)); 1355 1358 $the_weekday = apply_filters('the_weekday', $the_weekday); 1356 1359 echo $the_weekday; … … 1373 1376 if ( $day != $previousweekday ) { 1374 1377 $the_weekday_date .= $before; 1375 $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date ));1378 $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date, false)); 1376 1379 $the_weekday_date .= $after; 1377 1380 $previousweekday = $day; -
trunk/wp-includes/post.php
r11305 r11323 1468 1468 if ( 'publish' == $post_status ) { 1469 1469 $now = gmdate('Y-m-d H:i:59'); 1470 if ( mysql2date('U', $post_date_gmt ) > mysql2date('U', $now) )1470 if ( mysql2date('U', $post_date_gmt, false) > mysql2date('U', $now, false) ) 1471 1471 $post_status = 'future'; 1472 1472 } -
trunk/wp-includes/query.php
r11259 r11323 2661 2661 $authordata = get_userdata($post->post_author); 2662 2662 2663 $day = mysql2date('d.m.y', $post->post_date );2664 $currentmonth = mysql2date('m', $post->post_date );2663 $day = mysql2date('d.m.y', $post->post_date, false); 2664 $currentmonth = mysql2date('m', $post->post_date, false); 2665 2665 $numpages = 1; 2666 2666 $page = get_query_var('page'); -
trunk/xmlrpc.php
r11190 r11323 524 524 525 525 // Format page date. 526 $page_date = mysql2date("Ymd\TH:i:s", $page->post_date );527 $page_date_gmt = mysql2date("Ymd\TH:i:s", $page->post_date_gmt );526 $page_date = mysql2date("Ymd\TH:i:s", $page->post_date, false); 527 $page_date_gmt = mysql2date("Ymd\TH:i:s", $page->post_date_gmt, false); 528 528 529 529 // Pull the categories info together. … … 800 800 $num_pages = count($page_list); 801 801 for($i = 0; $i < $num_pages; $i++) { 802 $post_date = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date );803 $post_date_gmt = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date_gmt );802 $post_date = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date, false); 803 $post_date_gmt = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date_gmt, false); 804 804 805 805 $page_list[$i]->dateCreated = new IXR_Date($post_date); … … 1048 1048 1049 1049 // Format page date. 1050 $comment_date = mysql2date("Ymd\TH:i:s", $comment->comment_date );1051 $comment_date_gmt = mysql2date("Ymd\TH:i:s", $comment->comment_date_gmt );1050 $comment_date = mysql2date("Ymd\TH:i:s", $comment->comment_date, false); 1051 $comment_date_gmt = mysql2date("Ymd\TH:i:s", $comment->comment_date_gmt, false); 1052 1052 1053 1053 if ( 0 == $comment->comment_approved ) … … 1680 1680 $struct = array( 1681 1681 'userid' => $post_data['post_author'], 1682 'dateCreated' => new IXR_Date(mysql2date('Ymd\TH:i:s', $post_data['post_date'] )),1682 'dateCreated' => new IXR_Date(mysql2date('Ymd\TH:i:s', $post_data['post_date'], false)), 1683 1683 'content' => $content, 1684 1684 'postid' => $post_data['ID'] … … 1722 1722 continue; 1723 1723 1724 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'] );1724 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false); 1725 1725 $categories = implode(',', wp_get_post_categories($entry['ID'])); 1726 1726 … … 2572 2572 2573 2573 if ($postdata['post_date'] != '') { 2574 $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date'] );2575 $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt'] );2574 $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date'], false); 2575 $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt'], false); 2576 2576 2577 2577 $categories = array(); … … 2688 2688 continue; 2689 2689 2690 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'] );2691 $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'] );2690 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false); 2691 $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false); 2692 2692 2693 2693 $categories = array(); … … 2923 2923 continue; 2924 2924 2925 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'] );2926 $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'] );2925 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false); 2926 $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false); 2927 2927 2928 2928 $struct[] = array(
Note: See TracChangeset
for help on using the changeset viewer.