Make WordPress Core


Ignore:
Timestamp:
04/30/2004 08:56:49 AM (22 years ago)
Author:
saxmatt
Message:

Fixes for post screen.

File:
1 edited

Legend:

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

    r1205 r1215  
    2424
    2525function get_nested_categories($default = 0) {
    26  global $post, $tablecategories, $tablepost2cat, $mode, $wpdb;
    27 
    28  if ($post->ID) {
     26 global $post_ID, $tablecategories, $tablepost2cat, $mode, $wpdb;
     27
     28 if ($post_ID) {
    2929   $checked_categories = $wpdb->get_col("
    3030     SELECT category_id
    3131     FROM  $tablecategories, $tablepost2cat
    32      WHERE $tablepost2cat.category_id = cat_ID AND $tablepost2cat.post_id = '$post->ID'
     32     WHERE $tablepost2cat.category_id = cat_ID AND $tablepost2cat.post_id = '$post_ID'
    3333     ");
    3434 } else {
     
    326326}
    327327
     328function touch_time($edit = 1) {
     329    global $month, $postdata;
     330    // echo $postdata['Date'];
     331    if ('draft' == $postdata->post_status) {
     332        $checked = 'checked="checked" ';
     333        $edit = false;
     334    } else {
     335        $checked = ' ';
     336    }
     337
     338    echo '<p><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp" '.$checked.'/> <label for="timestamp">' . __('Edit timestamp') . '</label> <a href="http://wordpress.org/docs/reference/post/#edit_timestamp" title="' . __('Help on changing the timestamp') . '">?</a><br />';
     339   
     340    $time_adj = time() + (get_settings('gmt_offset') * 3600);
     341    $post_date = $postdata->post_date;
     342    $jj = ($edit) ? mysql2date('d', $post_date) : gmdate('d', $time_adj);
     343    $mm = ($edit) ? mysql2date('m', $post_date) : gmdate('m', $time_adj);
     344    $aa = ($edit) ? mysql2date('Y', $post_date) : gmdate('Y', $time_adj);
     345    $hh = ($edit) ? mysql2date('H', $post_date) : gmdate('H', $time_adj);
     346    $mn = ($edit) ? mysql2date('i', $post_date) : gmdate('i', $time_adj);
     347    $ss = ($edit) ? mysql2date('s', $post_date) : gmdate('s', $time_adj);
     348
     349    echo '<input type="text" name="jj" value="'.$jj.'" size="2" maxlength="2" />'."\n";
     350    echo "<select name=\"mm\">\n";
     351    for ($i=1; $i < 13; $i=$i+1) {
     352        echo "\t\t\t<option value=\"$i\"";
     353        if ($i == $mm)
     354        echo " selected='selected'";
     355        if ($i < 10) {
     356            $ii = "0".$i;
     357        } else {
     358            $ii = "$i";
     359        }
     360        echo ">".$month["$ii"]."</option>\n";
     361    } ?>
     362</select>
     363<input type="text" name="aa" value="<?php echo $aa ?>" size="4" maxlength="5" /> @
     364<input type="text" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" /> :
     365<input type="text" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" /> :
     366<input type="text" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" /> </p>
     367    <?php
     368}
     369
    328370?>
Note: See TracChangeset for help on using the changeset viewer.