Make WordPress Core

Changeset 1259


Ignore:
Timestamp:
05/10/2004 08:33:03 AM (21 years ago)
Author:
saxmatt
Message:

Some tricks that in some cases speed up perceived posting time.

File:
1 edited

Legend:

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

    r1256 r1259  
    9494    }
    9595
     96    // What to do based on which button they pressed
     97    if ('' != $_POST['saveasdraft']) $post_status = 'draft';
     98    if ('' != $_POST['saveasprivate']) $post_status = 'private';
     99    if ('' != $_POST['publish']) $post_status = 'publish';
     100    if ('' != $_POST['advanced']) $post_status = 'draft';
     101
     102
     103    if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {
     104    $postquery ="INSERT INTO $tableposts
     105            (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_lat, post_lon, post_excerpt,  post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt)
     106            VALUES
     107            ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt')
     108            ";
     109    } else {
     110    $postquery ="INSERT INTO $tableposts
     111            (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt,  post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt)
     112            VALUES
     113            ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt')
     114            ";
     115    }
     116    $postquery =
     117    $result = $wpdb->query($postquery);
     118
     119    $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1");
     120
    96121    if (!empty($_POST['mode'])) {
    97122    switch($_POST['mode']) {
     
    109134        $location = 'post.php';
    110135    }
    111 
    112     // What to do based on which button they pressed
    113     if ('' != $_POST['saveasdraft']) $post_status = 'draft';
    114     if ('' != $_POST['saveasprivate']) $post_status = 'private';
    115     if ('' != $_POST['publish']) $post_status = 'publish';
    116     if ('' != $_POST['advanced']) $post_status = 'draft';
    117 
    118 
    119     if((get_settings('use_geo_positions')) && (strlen($latstr) > 2) && (strlen($lonstr) > 2) ) {
    120     $postquery ="INSERT INTO $tableposts
    121             (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_lat, post_lon, post_excerpt,  post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt)
    122             VALUES
    123             ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', $post_latf, $post_lonf,'$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt')
    124             ";
    125     } else {
    126     $postquery ="INSERT INTO $tableposts
    127             (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt,  post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt)
    128             VALUES
    129             ('0', '$user_ID', '$now', '$now_gmt', '$content', '$post_title', '$excerpt', '$post_status', '$comment_status', '$ping_status', '$post_password', '$post_name', '$trackback', '$now', '$now_gmt')
    130             ";
    131     }
    132     $postquery =
    133     $result = $wpdb->query($postquery);
    134 
    135     $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1");
    136 
    137136    if ('' != $_POST['advanced'])
    138137        $location = "post.php?action=edit&post=$post_ID";
     138
     139    header("Location: $location"); // Send user on their way while we keep working
    139140
    140141
     
    161162            sleep($sleep_after_edit);
    162163    }
    163 
    164    
    165     header("Location: $location");
    166164
    167165    if ($post_status == 'publish') {
     
    323321        $datemodif_gmt = '';
    324322    }
     323
     324    if ($_POST['save']) {
     325        $location = $_SERVER['HTTP_REFERER'];
     326    } elseif ($_POST['updatemeta']) {
     327        $location = $_SERVER['HTTP_REFERER'] . '&message=2#postcustom';
     328    } elseif ($_POST['deletemeta']) {
     329        $location = $_SERVER['HTTP_REFERER'] . '&message=3#postcustom';
     330    } else {
     331        $location = 'post.php';
     332    }
     333    header ('Location: ' . $location); // Send user on their way while we keep working
    325334
    326335$now = current_time('mysql');
     
    407416    add_meta($post_ID);
    408417
    409     if ($_POST['save']) {
    410         $location = $_SERVER['HTTP_REFERER'];
    411     } elseif ($_POST['updatemeta']) {
    412         $location = $_SERVER['HTTP_REFERER'] . '&message=2#postcustom';
    413     } elseif ($_POST['deletemeta']) {
    414         $location = $_SERVER['HTTP_REFERER'] . '&message=3#postcustom';
    415     } else {
    416         $location = 'post.php';
    417     }
    418     header ('Location: ' . $location);
    419418    do_action('edit_post', $post_ID);
    420419    exit();
Note: See TracChangeset for help on using the changeset viewer.