One more gallery trick


oh yeah, I forgot that I had also added another thing for gallery integration.

I found this neat hack which includes a php file that outputs javascript to display a link. I tweaked the script to look like this:

..
echo "document.write('<a href="" . 
    makeAlbumUrl($gallery->album->fields["name"]) . "">" . 
    $gallery->album->getThumbnailTag($gallery->album->getHighlight() ) . 
    "</a>');";
..

getThumbnailTag is cool because it its the complete <img> tag to display the particular thumbnail. It wouldn’t be hard to make that a random number to display a random thumbnail.

so now I can also say thumbnail=yes and it will display a thumbnail from the gallery specified by the gallery keyword.

  1. #1 by Dave Golden on August 6, 2004 - 2:48 pm

    This didn’t quite work for me at first, until I realized the gallery->album->getThumbnailTag was missing the $ symbol

    this worked for me
    echo “document.write(‘album->fields[“name”]) . “”> ” . $gallery->album->getThumbnailTag($gallery->album->getHighlight()) . “‘);”;

(will not be published)