Make WordPress Core


Ignore:
Timestamp:
11/14/2005 09:56:41 AM (21 years ago)
Author:
matt
Message:

Fixes #1837 timestamp funkiness

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r3064 r3074  
    837837function touch_time($edit = 1, $for_post = 1) {
    838838    global $month, $post, $comment;
    839     if ($for_post && ('draft' == $post->post_status)) {
    840         $checked = 'checked="checked" ';
    841         $edit = false;
    842     } else {
    843         $checked = ' ';
    844     }
    845 
    846     echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" '.$checked.'/> <label for="timestamp">'.__('Edit timestamp').'</label></legend>';
     839
     840    if ( $for_post )
     841        $edit = ( ('draft' == $post->post_status) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date) ) ? false : true;
     842 
     843    echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" /> <label for="timestamp">'.__('Edit timestamp').'</label></legend>';
    847844
    848845    $time_adj = time() + (get_settings('gmt_offset') * 3600);
     
    874871<input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" />
    875872<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" />
    876 <?php _e('Existing timestamp'); ?>:
    877     <?php
    878 
    879     // We might need to readjust to display proper existing timestamp
    880     if ($for_post && ('draft' == $post->post_status)) {
    881         $jj = mysql2date('d', $post_date);
    882         $mm = mysql2date('m', $post_date);
    883         $aa = mysql2date('Y', $post_date);
    884         $hh = mysql2date('H', $post_date);
    885         $mn = mysql2date('i', $post_date);
    886         $ss = mysql2date('s', $post_date);
    887     }
    888     echo "{$month[$mm]} $jj, $aa @ $hh:$mn";
     873<?php
     874    if ( $edit ) {
     875        _e('Existing timestamp');
     876        echo ": {$month[$mm]} $jj, $aa @ $hh:$mn";
     877    }
    889878?>
    890879</fieldset>
Note: See TracChangeset for help on using the changeset viewer.