Changeset 873:f9ef04edef05 for inc/core/class.dc.xmlrpc.php
- Timestamp:
- 08/14/12 15:43:05 (13 years ago)
- Branch:
- sexy
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.xmlrpc.php
r852 r873 242 242 $this->setUser($user,$pwd); 243 243 $this->setBlog(); 244 $ rs = $this->core->blog->getPosts(array(244 $posts = $this->core->blog->getPosts(array( 245 245 'post_id' => (integer) $post_id, 246 246 'post_type' => $post_type 247 247 )); 248 248 249 if ( $rs->isEmpty()) {249 if (count($posts) == 0) { 250 250 throw new Exception('This entry does not exist'); 251 251 } 252 252 253 return $ rs;253 return $posts; 254 254 } 255 255 … … 494 494 495 495 $res = array(); 496 while ($posts->fetch())496 foreach ($posts as $p) 497 497 { 498 498 $tres = array(); 499 499 500 500 $tres['dateCreated'] = new xmlrpcDate($posts->getTS()); 501 $tres['userid'] = $p osts->user_id;502 $tres['postid'] = $p osts->post_id;501 $tres['userid'] = $p->user_id; 502 $tres['postid'] = $p->post_id; 503 503 504 504 if ($type == 'blogger') { 505 $tres['content'] = $p osts->post_content_xhtml;505 $tres['content'] = $p->post_content_xhtml; 506 506 } 507 507 508 508 if ($type == 'mt' || $type == 'mw') { 509 $tres['title'] = $p osts->post_title;509 $tres['title'] = $p->post_title; 510 510 } 511 511 512 512 if ($type == 'mw') { 513 $tres['description'] = $p osts->post_content_xhtml;514 $tres['link'] = $tres['permaLink'] = $p osts->getURL();515 $tres['mt_excerpt'] = $p osts->post_excerpt_xhtml;513 $tres['description'] = $p->post_content_xhtml; 514 $tres['link'] = $tres['permaLink'] = $p->getURL(); 515 $tres['mt_excerpt'] = $p->post_excerpt_xhtml; 516 516 $tres['mt_text_more'] = ''; 517 517 $tres['mt_convert_breaks'] = ''; … … 714 714 715 715 $res = array(); 716 while ($posts->fetch())716 foreach ($posts as $post) 717 717 { 718 718 $tres = array( 719 "dateCreated" => new xmlrpcDate($post s->getTS()),720 "userid" => $post s->user_id,721 "page_id" => $post s->post_id,722 "page_status" => $this->translateWpStatus((integer) $post s->post_status),723 "description" => $post s->post_content_xhtml,724 "title" => $post s->post_title,725 "link" => $post s->getURL(),726 "permaLink" => $post s->getURL(),727 "excerpt" => $post s->post_excerpt_xhtml,719 "dateCreated" => new xmlrpcDate($post->getTS()), 720 "userid" => $post->user_id, 721 "page_id" => $post->post_id, 722 "page_status" => $this->translateWpStatus((integer) $post->post_status), 723 "description" => $post->post_content_xhtml, 724 "title" => $post->post_title, 725 "link" => $post->getURL(), 726 "permaLink" => $post->getURL(), 727 "excerpt" => $post->post_excerpt_xhtml, 728 728 "text_more" => '', 729 "wp_slug" => $post s->post_url,730 "wp_password" => $post s->post_password,731 "wp_author" => $post s->getAuthorCN(),729 "wp_slug" => $post->post_url, 730 "wp_password" => $post->post_password, 731 "wp_author" => $post->getAuthorCN(), 732 732 "wp_page_parent_id" => 0, 733 733 "wp_page_parent_title" => '', 734 "wp_page_order" => $post s->post_position,735 "wp_author_id" => $post s->user_id,736 "wp_author_display_name" => $post s->getAuthorCN(),737 "date_created_gmt" => new xmlrpcDate(dt::iso8601($post s->getTS(),$posts->post_tz)),734 "wp_page_order" => $post->post_position, 735 "wp_author_id" => $post->user_id, 736 "wp_author_display_name" => $post->getAuthorCN(), 737 "date_created_gmt" => new xmlrpcDate(dt::iso8601($post->getTS(),$post->post_tz)), 738 738 "custom_fields" => array(), 739 739 "wp_page_template" => 'default' … … 790 790 $this->setBlog(); 791 791 792 $ rs = $this->core->getBlogPermissions($this->core->blog->id);792 $perms = $this->core->getBlogPermissions($this->core->blog->id); 793 793 $res = array(); 794 794 795 foreach($ rs as $k => $v)795 foreach($perms as $k => $v) 796 796 { 797 797 $res[] = array( … … 817 817 $f_url = $this->core->blog->url. 818 818 $this->core->url->getURLFor('tag_feed','%s'); 819 while ($tags->fetch())819 foreach ($tags as $tag) 820 820 { 821 821 $res[] = array( 822 'tag_id' => $tag s->meta_id,823 'name' => $tag s->meta_id,824 'count' => $tag s->count,825 'slug' => $tag s->meta_id,826 'html_url' => sprintf($url,$tag s->meta_id),827 'rss_url' => sprintf($f_url,$tag s->meta_id)822 'tag_id' => $tag->meta_id, 823 'name' => $tag->meta_id, 824 'count' => $tag->count, 825 'slug' => $tag->meta_id, 826 'html_url' => sprintf($url,$tag->meta_id), 827 'rss_url' => sprintf($f_url,$tag->meta_id) 828 828 ); 829 829 }
Note: See TracChangeset
for help on using the changeset viewer.