blogap_mti_publish_post

  1. drupal
    1. 4.7
Versions
4.7 blogap_mti_publish_post($postid, $username, $password)

Blogging API callback. Publishes the given node

Code

modules/blogapi.module, line 488

<?php
function blogap_mti_publish_post($postid, $username, $password) {
  $user = blogapi_validate_user($username, $password);
  if (!$user->uid) {
    return blogapi_error($user);
  }
  $node = node_load($postid);
  if (!$node) {
    return blogapi_error(t('Invalid post.'));
  }

  $node->status = 1;
  if (!node_access('update', $node)) {
    return blogapi_error(t('You do not have permission to update this post.'));
  }

  node_save($node);

  return true;
}
?>