You are here

function upload_load in Drupal 6

Same name and namespace in other branches
  1. 4 modules/upload.module \upload_load()
  2. 5 modules/upload/upload.module \upload_load()
1 call to upload_load()
upload_nodeapi in modules/upload/upload.module
Implementation of hook_nodeapi().

File

modules/upload/upload.module, line 557
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 {upload} r ON f.fid = r.fid WHERE r.vid = %d ORDER BY r.weight, f.fid', $node->vid);
    while ($file = db_fetch_object($result)) {
      $files[$file->fid] = $file;
    }
  }
  return $files;
}