You are here

function node_revision_list in Drupal 5

Same name and namespace in other branches
  1. 4 modules/node.module \node_revision_list()
  2. 6 modules/node/node.module \node_revision_list()
  3. 7 modules/node/node.module \node_revision_list()

Return a list of all the existing revision numbers.

1 call to node_revision_list()
node_revision_overview in modules/node/node.module
Generate an overview table of older revisions of a node.

File

modules/node/node.module, line 1863
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.timestamp DESC', $node->nid);
  while ($revision = db_fetch_object($result)) {
    $revisions[] = $revision;
  }
  return $revisions;
}