You are here

function _get_pending_revisions in Revisioning 6

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 _get_pending_revisions()
revisioning_publish_latest_revision in ./revisioning.module
Find the most recent pending revision and make it current, unless it already is.

File

./revisioning.module, line 504

Code

function _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;
}