function _linkimagefield_file_load in Link Image Field 5
2 calls to _linkimagefield_file_load()
- linkimagefield_field in ./
linkimagefield.module - Implementation of hook_field().
- linkimagefield_field_formatter in ./
linkimagefield.module - Implementation of hook_field_formatter().
File
- ./
linkimagefield.module, line 600 - Defines an link image field type. linkimagefield uses content.module to store the fid, and the drupal files table to store the actual file data.
Code
function _linkimagefield_file_load($fid = NULL) {
// Don't bother if we weren't passed and fid.
if (!empty($fid) && is_numeric($fid)) {
$result = db_query('SELECT * FROM {files} WHERE fid = %d', $fid);
$file = db_fetch_array($result);
if ($file) {
return $file;
}
}
// return an empty array if nothing was found.
return array();
}