You are here

function upload_load in Drupal 5

Same name and namespace in other branches
  1. 4 modules/upload.module \upload_load()
  2. 6 modules/upload/upload.module \upload_load()
2 calls to upload_load()
upload_js in modules/upload/upload.module
Menu-callback for JavaScript-based uploads.
upload_nodeapi in modules/upload/upload.module
Implementation of hook_nodeapi().

File

modules/upload/upload.module, line 842
File-handling and attaching files to nodes.

Code

function upload_load($node) {
  $files = array();
  if ($node->vid) {
    $result = db_query('SELECT * FROM {files} f INNER JOIN {file_revisions} r ON f.fid = r.fid WHERE r.vid = %d ORDER BY f.fid', $node->vid);
    while ($file = db_fetch_object($result)) {
      $files[$file->fid] = $file;
    }
  }
  return $files;
}