I added a function that I copied from the image cycle module to the image_gallery module so I could retrieve the complete gallery. I didn't want to have a limit on the number of nodes to be returned so I removed the pager call. BTW: I pasted code here cause I haven't read the how to patch manual, in the mean time this would work I guess.

function image_gallery_get_images($tid) {
  // Allow images to be sorted in a useful order.
  $query = "SELECT n.nid FROM {term_node} t INNER JOIN {node} n ON t.nid = n.nid WHERE n.status = 1 AND n.type = 'image' AND t.tid = %d ";
  $args = array($tid);
  switch (variable_get('image_gallery_sort_order', IMAGE_GALLERY_SORT_CREATE_DESC)) {
    case IMAGE_GALLERY_SORT_CREATE_DESC:
      $query .= 'ORDER BY n.sticky DESC, n.created DESC';
      break;

    case IMAGE_GALLERY_SORT_CREATE_ASC:
      $query .= 'ORDER BY n.sticky DESC, n.created   ASC';
      break;

    case IMAGE_GALLERY_SORT_TITLE:
      $query .= 'ORDER BY n.sticky DESC, n.title ASC';
      break;
  }
  $result = db_query($query,$args);
  while ($node = db_fetch_object($result)) {
    $images[] = node_load(array('nid' => $node->nid));
  }
  return $images;
}

Comments

sun’s picture

Title: add a function to retrieve the content of a complete gallery » Allow to retrieve all images in a gallery
Version: 5.x-1.x-dev » 6.x-1.x-dev

New features go into HEAD only.

pepe roni’s picture

Of course you can invent the wheel again. But why not use views?

sun’s picture

Status: Active » Closed (won't fix)

druppi is right.

rpalomo’s picture

I wanted to display the images using the JCarousel module but instead of reading files from a folder or from one node, I wanted to use the slideshow already created. So, I'm not sure would I be able to retrieve the image nodes from a view and the use that in my code for Jquery.