function _download_count_get_file_by_upload in Download Count 7.2
Same name and namespace in other branches
- 6.2 download_count.module \_download_count_get_file_by_upload()
internal functions
2 calls to _download_count_get_file_by_upload()
File
- ./
download_count.module, line 320 - Tracks file downloads for files stored in the drupal files table using the private files setting or custom private filefield.
Code
function _download_count_get_file_by_upload($filepath) {
// check if Upload is enabled
if (!function_exists('upload_perm')) {
return NULL;
}
// upload not enabled
$result = db_query("SELECT u.nid, u.vid, f.filepath, f.fid FROM {upload} u JOIN {files} f ON f.fid = u.fid WHERE f.filepath = :f.filepath", array(
':f.filepath' => $filepath,
));
return db_fetch_object($result);
}