You are here

function comment_upload_load_files in Comment Upload 6

Load attachments that belong to the comment.

Parameters

integer $cid:

Return value

array

3 calls to comment_upload_load_files()
comment_upload_alter_comment_form in ./comment_upload.module
Alter the comment form to support AHAH uploads.
comment_upload_comment_delete in ./comment_upload.module
Remove files when the comment is deleted.
comment_upload_comment_view in ./comment_upload.module
Add attachments to the comment on view or preview.

File

./comment_upload.module, line 611
Provides file attachment functionality for comments.

Code

function comment_upload_load_files($cid) {
  $files = array();
  $result = db_query('SELECT * FROM {files} f INNER JOIN {comment_upload} cu ON f.fid = cu.fid WHERE cu.cid = %d ORDER BY cu.weight, f.fid', $cid);
  while ($file = db_fetch_array($result)) {
    $files[$file['fid']] = $file;
  }
  return $files;
}