function media_gallery_mg_item_load in Media Gallery 7
Same name and namespace in other branches
- 7.2 media_gallery.module \media_gallery_mg_item_load()
Load a file object from the database, if it is part of the media_gallery node.
Parameters
$fid: The file ID.
$nid: The media_gallery node ID.
Return value
A fully-populated file object, or FALSE if the file is not part of the media_gallery.
See also
File
- ./
media_gallery.module, line 174
Code
function media_gallery_mg_item_load($fid, $nid) {
$node = node_load($nid);
if ($node && $node->type == 'media_gallery' && in_array($fid, media_gallery_get_file_ids($node))) {
return file_load($fid);
}
return FALSE;
}