You are here

function node_gallery_load_image in Node Gallery 6.3

Populates a node object with the node gallery image attributes.

Parameters

$node: Reference to a populated node object.

1 call to node_gallery_load_image()
node_gallery_nodeapi in ./node_gallery.module
Implements hook_nodeapi().

File

./node_gallery.inc, line 802
Shared functions for node_gallery

Code

function node_gallery_load_image(&$node) {
  $fields = array(
    'gid',
    'weight',
  );
  $image = db_fetch_object(db_query("SELECT " . implode(", ", $fields) . " FROM {node_gallery_images} WHERE nid = %d", $node->nid));
  foreach ($fields as $attribute) {
    $node->{$attribute} = $image->{$attribute};
  }
  node_gallery_set_image_is_cover_field($node);
}