_blogapi_get_post

Versions
4.6 – 4.7
_blogapi_get_post($node, $bodies = true)
5 – 6
_blogapi_get_post($node, $bodies = TRUE)

▾ 2 functions call _blogapi_get_post()

blogapi_blogger_get_post in modules/blogapi/blogapi.module
Blogging API callback. Returns a specified blog node.
blogapi_blogger_get_recent_posts in modules/blogapi/blogapi.module
Blogging API callback. Returns the latest few postings in a user's blog. $bodies TRUE <a href="http://movabletype.org/docs/mtmanual_programmatic.html#item_mt%2EgetRecentPostTitles"> returns a bandwidth-friendly list</a>.

Code

modules/blogapi/blogapi.module, line 892

<?php
function _blogapi_get_post($node, $bodies = TRUE) {
  $xmlrpcval = array(
    'userid' => $node->name,
    'dateCreated' => xmlrpc_date($node->created),
    'title' => $node->title,
    'postid' => $node->nid,
    'link' => url('node/'. $node->nid, array('absolute' => TRUE)),
    'permaLink' => url('node/'. $node->nid, array('absolute' => TRUE)),
  );
  if ($bodies) {
    if ($node->comment == 1) {
      $comment = 2;
    }
    else if ($node->comment == 2) {
      $comment = 1;
    }
    $xmlrpcval['content'] = "<title>$node->title</title>$node->body";
    $xmlrpcval['description'] = $node->body;
    // Add MT specific fields
    $xmlrpcval['mt_allow_comments'] = (int) $comment;
    $xmlrpcval['mt_convert_breaks'] = $node->format;
  }

  return $xmlrpcval;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.