It would be handy to have a block that contains a list of image galleries.

Attached is a patch that provides a simple list of top-level taxonomy terms that are in the image vocabulary, and link to the corresponding gallery.

If nobody objects, I will commit this change to the contrib cvs repo.

A nice enhancement would be to optionally enable sub-taxo terms in the image vocab hierarchy.

CommentFileSizeAuthor
#3 imagemodulev1.108.patch850 bytesjasmeetc
image.patch1.89 KBmrowe

Comments

Anonymous’s picture

I achieved more or less the same with by adding a user definen block with the following PHP content:

$albums = taxonomy_get_children(0, variable_get("image_nav_vocabulary", ""));
$albums = _image_album_properties($albums);
$image_nav_vocabulary = taxonomy_get_vocabulary(variable_get("image_nav_vocabulary", ""));
foreach ($albums as $tid => $album) {
if(strpos($album->name,"QQ") === FALSE) $output .= "

  • ". l($album->name, "image/tid/$album->tid") ."
  • ";
    }
    return $output."

    " ;

    I do not display galleries whose name start with QQ. That can be used for:
    - images used in articles. Going to websitename/image I can easily find those images.
    - when working on a gallery
    - to put a gallery out of sight for a certain period of the year

    jasmeetc’s picture

    Title: A block to display image galleries » Add random thumb display to A block to display image galleries

    I changed the theme_image_block code to display a random thumbnail along with the galleries list. Just thought that this snipet might be useful to somebody.

    function theme_image_block($albums) {
    $sql = "SELECT n.nid, n.title, n.teaser, n.body, i.thumb_path FROM {node} n, {term_node} t, {image} i WHERE i.personal = 0 AND n.moderate = 0 ORDER BY RAND() LIMIT 1";
    $result = db_query($sql);
    $image = db_fetch_object($result);
    $output = "nid."\"> Only local images are allowed.thumb_path."\">";

    $output .= "

      ";
      foreach ($albums as $album) {
      $output .= "
    • " . l($album->name, "image/tid/" . $album->tid) . "
    • ";
      }
      $output .= "

    ";
    return $output;
    }

    jasmeetc’s picture

    StatusFileSize
    new850 bytes

    Oops the last comment is all screwed. I have attached the patch. It is pretty simple and displays eandom thumnail in the block. Also, if you click on the thumbnail, it goes to the correct node.

    Hope that helps.

    Tarlbot’s picture

    Where can I find the 1.008 version of the image.module that I can apply the patch attached to comment #2 to? Assume I know nothing about CVS.

    killes@www.drop.org’s picture

    This appears to be in the cvs version.

    Anonymous’s picture