Changeset 1355 for trunk/xmlrpc.php
- Timestamp:
- 05/24/2004 08:22:18 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xmlrpc.php
r1351 r1355 164 164 function blogger_getRecentPosts($args) { 165 165 166 global $ tableposts, $wpdb;166 global $wpdb; 167 167 168 168 $blog_ID = $args[1]; /* though we don't use it yet */ … … 181 181 } 182 182 183 $sql = "SELECT * FROM $ tableposts ORDER BY post_date DESC".$limit;183 $sql = "SELECT * FROM $wpdb->posts ORDER BY post_date DESC".$limit; 184 184 $result = $wpdb->get_results($sql); 185 185 … … 323 323 function blogger_newPost($args) { 324 324 325 global $ tableposts, $wpdb;325 global $wpdb; 326 326 327 327 $blog_ID = $args[1]; /* though we don't use it yet */ … … 376 376 377 377 function wp_insert_post($postarr = array()) { 378 global $wpdb, $ tableposts, $post_default_category;378 global $wpdb, $post_default_category; 379 379 380 380 // export array as variables … … 401 401 $post_date_gmt = get_gmt_from_date($post_date); 402 402 403 $sql = "INSERT INTO $ tableposts403 $sql = "INSERT INTO $wpdb->posts 404 404 (post_author, post_date, post_date_gmt, post_modified, post_modified_gmt, post_content, post_title, post_excerpt, post_category, post_status, post_name) 405 405 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')"; … … 417 417 418 418 function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { 419 global $wpdb , $tablepost2cat;419 global $wpdb; 420 420 // If $post_categories isn't already an array, make it one: 421 421 if (!is_array($post_categories)) { … … 431 431 $old_categories = $wpdb->get_col(" 432 432 SELECT category_id 433 FROM $ tablepost2cat433 FROM $wpdb->post2cat 434 434 WHERE post_id = $post_ID"); 435 435 … … 454 454 foreach ($delete_cats as $del) { 455 455 $wpdb->query(" 456 DELETE FROM $ tablepost2cat456 DELETE FROM $wpdb->post2cat 457 457 WHERE category_id = $del 458 458 AND post_id = $post_ID … … 471 471 foreach ($add_cats as $new_cat) { 472 472 $wpdb->query(" 473 INSERT INTO $ tablepost2cat (post_id, category_id)473 INSERT INTO $wpdb->post2cat (post_id, category_id) 474 474 VALUES ($post_ID, $new_cat)"); 475 475 … … 481 481 482 482 function wp_get_post_cats($blogid = '1', $post_ID = 0) { 483 global $wpdb , $tablepost2cat;483 global $wpdb; 484 484 485 485 $sql = "SELECT category_id 486 FROM $ tablepost2cat486 FROM $wpdb->post2cat 487 487 WHERE post_id = $post_ID 488 488 ORDER BY category_id";
Note: See TracChangeset
for help on using the changeset viewer.