You are here

function _revisioning_get_pending_revisions in Revisioning 6.3

Same name and namespace in other branches
  1. 8 revisioning_api.inc \_revisioning_get_pending_revisions()
  2. 6.4 revisioning_api.inc \_revisioning_get_pending_revisions()
  3. 7 revisioning_api.inc \_revisioning_get_pending_revisions()

Retrieve a list of revisions with a vid greater than the current.

Parameters

$nid: The node id to retrieve.

Return value

An array of revisions (latest first), each containing vid, title and content type.

1 call to _revisioning_get_pending_revisions()
_revisioning_publish_latest_revision in ./revisioning_api.inc
Find the most recent pending revision, make it current, unless it already is and publish node. Note that no check is made as to whether the initiating user has permission to publish this node.

File

./revisioning_api.inc, line 448
API functions of Revisioning module

Code

function _revisioning_get_pending_revisions($nid) {
  $sql = "SELECT r.vid, r.title, n.type FROM {node} n INNER JOIN {node_revisions} r ON n.nid=r.nid WHERE (r.vid>n.vid AND n.nid=%d) ORDER BY r.vid DESC";
  $result = db_query($sql, $nid);
  $revisions = array();
  while ($revision = db_fetch_object($result)) {
    $revisions[$revision->vid] = $revision;
  }
  return $revisions;
}