Changeset 6364 for trunk/wp-app.php
- Timestamp:
- 12/06/2007 07:49:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-app.php
r6339 r6364 216 216 */ 217 217 function create_post() { 218 global $blog_id, $ wpdb;218 global $blog_id, $user_ID; 219 219 $this->get_accepted_content_type($this->atom_content_types); 220 220 … … 250 250 $blog_ID = (int ) $blog_id; 251 251 $post_status = ($publish) ? 'publish' : 'draft'; 252 $post_author = (int) $user ->ID;252 $post_author = (int) $user_ID; 253 253 $post_title = $entry->title[1]; 254 254 $post_content = $entry->content[1]; … … 270 270 $this->internal_error($postID->get_error_message()); 271 271 272 if (!$postID) {272 if (!$postID) 273 273 $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.')); 274 }275 274 276 275 // getting warning here about unable to set headers … … 297 296 298 297 function put_post($postID) { 299 global $wpdb;300 301 298 // checked for valid content-types (atom+xml) 302 299 // quick check and exit … … 314 311 // check for not found 315 312 global $entry; 316 $entry = $GLOBALS['entry'];317 313 $this->set_current_entry($postID); 318 314 … … 377 373 378 374 function get_attachment($postID = NULL) { 379 380 global $entry;381 375 if (!isset($postID)) { 382 376 $this->get_attachments(); … … 390 384 391 385 function create_attachment() { 392 global $wp, $wpdb, $wp_query, $blog_id;393 386 394 387 $type = $this->get_accepted_content_type(); … … 419 412 $url = $file['url']; 420 413 $file = $file['file']; 421 $filename = basename($file); 422 423 $header = apply_filters('wp_create_file_in_uploads', $file); // replicate 414 415 apply_filters('wp_create_file_in_uploads', $file); // replicate 424 416 425 417 // Construct the attachment array … … 434 426 435 427 // Save the data 436 $postID = wp_insert_attachment($attachment, $file , $post);437 438 if (!$postID) {428 $postID = wp_insert_attachment($attachment, $file); 429 430 if (!$postID) 439 431 $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.')); 440 }441 432 442 433 $output = $this->get_entry($postID, 'attachment'); … … 447 438 448 439 function put_attachment($postID) { 449 global $wpdb;450 451 440 // checked for valid content-types (atom+xml) 452 441 // quick check and exit … … 467 456 $this->auth_required(__('Sorry, you do not have the right to edit this post.')); 468 457 469 $publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true;470 471 458 extract($entry); 472 459 … … 546 533 547 534 function put_file($postID) { 548 549 $type = $this->get_accepted_content_type();550 535 551 536 // first check if user can upload … … 606 591 607 592 function the_entries_url($page = NULL) { 608 $url = $this->get_entries_url($page); 609 echo $url; 610 } 611 612 function get_categories_url($page = NULL) { 593 echo $this->get_entries_url($page); 594 } 595 596 function get_categories_url($deprecated = '') { 613 597 return $this->app_base . $this->CATEGORIES_PATH; 614 598 } 615 599 616 600 function the_categories_url() { 617 $url = $this->get_categories_url(); 618 echo $url; 601 echo $this->get_categories_url(); 619 602 } 620 603 … … 628 611 629 612 function the_attachments_url($page = NULL) { 630 $url = $this->get_attachments_url($page); 631 echo $url; 613 echo $this->get_attachments_url($page); 632 614 } 633 615 … … 639 621 if(!isset($postID)) { 640 622 global $post; 641 $postID = (int) $ GLOBALS['post']->ID;623 $postID = (int) $post->ID; 642 624 } 643 625 … … 649 631 650 632 function the_entry_url($postID = NULL) { 651 $url = $this->get_entry_url($postID); 652 echo $url; 633 echo $this->get_entry_url($postID); 653 634 } 654 635 … … 656 637 if(!isset($postID)) { 657 638 global $post; 658 $postID = (int) $ GLOBALS['post']->ID;639 $postID = (int) $post->ID; 659 640 } 660 641 … … 666 647 667 648 function the_media_url($postID = NULL) { 668 $url = $this->get_media_url($postID); 669 echo $url; 649 echo $this->get_media_url($postID); 670 650 } 671 651 … … 760 740 log_app('function',"get_entry($postID, '$post_type')"); 761 741 ob_start(); 762 global $posts, $post, $wp_query, $wp, $wpdb, $blog_id;763 742 switch($post_type) { 764 743 case 'post':
Note: See TracChangeset
for help on using the changeset viewer.