function node_revision_list

7.x node.module node_revision_list($node)
6.x node.module node_revision_list($node)

Return a list of all the existing revision numbers.

1 call to node_revision_list()
node_revision_overview in drupal-6.x/modules/node/node.pages.inc
Generate an overview table of older revisions of a node.

File

drupal-6.x/modules/node/node.module, line 1633
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_revision_list($node) {
  $revisions = array();
  $result = db_query('SELECT r.vid, r.title, r.log, r.uid, n.vid AS current_vid, r.timestamp, u.name FROM {node_revisions} r LEFT JOIN {node} n ON n.vid = r.vid INNER JOIN {users} u ON u.uid = r.uid WHERE r.nid = %d ORDER BY r.vid DESC', $node->nid);
  while ($revision = db_fetch_object($result)) {
    $revisions[$revision->vid] = $revision;
  }

  return $revisions;
}