You are here

function rotor_load in Rotor Banner 5

Same name and namespace in other branches
  1. 5.7 rotor.module \rotor_load()
  2. 6 rotor.module \rotor_load()

Implementation of hook_load().

File

./rotor.module, line 415
A rotor banner consists in a set of images that will be changing. This module is made using jquery.

Code

function rotor_load($node) {
  $additions = new stdClass();
  $rotor_item = db_fetch_object(db_query('SELECT fid, alt_text, url, link_target FROM {rotor_item} WHERE nid = %d', $node->nid));
  $file = db_fetch_object(db_query('SELECT * FROM {files} where fid = %d', $rotor_item->fid));
  $additions->rotor_image->alt_text = $rotor_item->alt_text;
  $additions->rotor_image->url = $rotor_item->url;
  $additions->rotor_image->link_target = $rotor_item->link_target;
  $additions->rotor_image->filepath = $file->filepath;
  return $additions;
}