Site Changes

Gallery 2 has been released into the wild, and as a result, I decided to convert mine. G2 brings real database support, real templating and theming, and loads of other goodies.

My site style grabs a new image from my Gallery every hour to use in the header. In the past, I used a hacked version of the block_random.php from Gallery 1, which output what I needed to files which are then read in by the CSS. Unfortunately, the new random image block in G2 doesn’t behave the same way.

Luckily, combined with the square thumbnail module, it’s not hard to grab random thumbs, I just had to parse some html to grab the URLs out of the returned data.

I also made the thumbnail size 90px instead of 120px, which makes the header less unwieldy.

What’s really nice is that the composition of the photo is mostly there, albeit grown and cropped for squareness. The old G1 script I wrote grabbed a 120px X 120px square from a random x and y, which sometimes didn’t look like much.

Leave a Reply

Your email address will not be published. Required fields are marked *