Make WordPress Core

Changeset 1355 for trunk/xmlrpc.php


Ignore:
Timestamp:
05/24/2004 08:22:18 AM (21 years ago)
Author:
saxmatt
Message:

Giant commit, sorry mailing list people. Move all table names to new $wpdb versions. Works but the whole app needs thorough testing now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r1351 r1355  
    164164    function blogger_getRecentPosts($args) {
    165165
    166       global $tableposts, $wpdb;
     166      global $wpdb;
    167167
    168168      $blog_ID    = $args[1]; /* though we don't use it yet */
     
    181181      }
    182182
    183       $sql = "SELECT * FROM $tableposts ORDER BY post_date DESC".$limit;
     183      $sql = "SELECT * FROM $wpdb->posts ORDER BY post_date DESC".$limit;
    184184      $result = $wpdb->get_results($sql);
    185185
     
    323323    function blogger_newPost($args) {
    324324
    325       global $tableposts, $wpdb;
     325      global $wpdb;
    326326
    327327      $blog_ID    = $args[1]; /* though we don't use it yet */
     
    376376
    377377function wp_insert_post($postarr = array()) {
    378     global $wpdb, $tableposts, $post_default_category;
     378    global $wpdb, $post_default_category;
    379379   
    380380    // export array as variables
     
    401401        $post_date_gmt = get_gmt_from_date($post_date);
    402402   
    403     $sql = "INSERT INTO $tableposts
     403    $sql = "INSERT INTO $wpdb->posts
    404404        (post_author, post_date, post_date_gmt, post_modified, post_modified_gmt, post_content, post_title, post_excerpt, post_category, post_status, post_name)
    405405        VALUES ('$post_author', '$post_date', '$post_date_gmt', '$post_date', '$post_date_gmt', '$post_content', '$post_title', '$post_excerpt', '$post_cat', '$post_status', '$post_name')";
     
    417417
    418418function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) {
    419     global $wpdb, $tablepost2cat;
     419    global $wpdb;
    420420    // If $post_categories isn't already an array, make it one:
    421421    if (!is_array($post_categories)) {
     
    431431    $old_categories = $wpdb->get_col("
    432432        SELECT category_id
    433         FROM $tablepost2cat
     433        FROM $wpdb->post2cat
    434434        WHERE post_id = $post_ID");
    435435   
     
    454454        foreach ($delete_cats as $del) {
    455455            $wpdb->query("
    456                 DELETE FROM $tablepost2cat
     456                DELETE FROM $wpdb->post2cat
    457457                WHERE category_id = $del
    458458                    AND post_id = $post_ID
     
    471471        foreach ($add_cats as $new_cat) {
    472472            $wpdb->query("
    473                 INSERT INTO $tablepost2cat (post_id, category_id)
     473                INSERT INTO $wpdb->post2cat (post_id, category_id)
    474474                VALUES ($post_ID, $new_cat)");
    475475
     
    481481
    482482function wp_get_post_cats($blogid = '1', $post_ID = 0) {
    483     global $wpdb, $tablepost2cat;
     483    global $wpdb;
    484484   
    485485    $sql = "SELECT category_id
    486         FROM $tablepost2cat
     486        FROM $wpdb->post2cat
    487487        WHERE post_id = $post_ID
    488488        ORDER BY category_id";
Note: See TracChangeset for help on using the changeset viewer.