function bg_image_field_has_image in Background Images 6
Same name and namespace in other branches
- 7 bg_image.module \bg_image_field_has_image()
Check if a node has an image set on the configured field
Parameters
$nid: The nid of the node to check
Return value
If the node has an image set for the field returns TRUE, otherwise returns FALSE
File
- ./
bg_image.module, line 533 - Allows for customizable background images per page
Code
function bg_image_field_has_image($nid) {
$node = node_load($nid);
$field_name = variable_get('bg_image_node_field', '');
if ($node && $node->{$field_name}) {
return TRUE;
}
else {
return FALSE;
}
}