function _rotor_load in Rotor Banner 6.2
Same name and namespace in other branches
- 7 rotor.module \_rotor_load()
1 call to _rotor_load()
File
- ./
rotor.module, line 211 - A rotor banner consists in a set of images that will be changing. This module is made using jquery.
Code
function _rotor_load(&$node) {
if (!$node->nid) {
return;
}
$node->fid = FALSE;
$rotor_item = db_fetch_object(db_query("SELECT * FROM {rotor_item} WHERE nid = %d", $node->nid));
if ($rotor_item) {
$node->fid = $rotor_item->fid ? db_fetch_object(db_query("SELECT * FROM {files} WHERE fid = %d", $rotor_item->fid)) : FALSE;
foreach (array(
'alt_text',
'image_title',
'url',
'link_target',
) as $prop) {
$node->{$prop} = $rotor_item->{$prop};
}
}
}