Mark's Musings

A miscellany of thoughts and opinions from an unimportant small town politician and bit-part web developer

Another change to the photo gallery


My photo gallery runs on  Gallery2, which I like as a storage and display system but it’s not one of the most flexible photo gallery systems out there. Other than changing the themes and templates, it’s hard to customise the key functionality of it without using plugins – and if there isn’t one to do what you want, then you’re stuffed unless you can write your own.

In particular, what I miss in Gallery2, compared to some other galery systems, is the ability to easily show lists of albums in ways that don’t fit within the existing plugins and themes. The default front page of Gallery2 is just a set of thumbnails to albums, without any significant descriptive text or stats. So, I thought I’d do a little hackery and create my own.

My new gallery front page is completely standalone – it doesn’t hook into any of Gallery2’s internal routines – which has the advantage of being a lot more flexible and easy to write (once I’d got my head around the rather complex database structure). The disadvantage is that I’ll need to manually edit it if I ever change the main gallery theme or change the database structure, but that’s not really a major problem.

My four new features are: a list of the most popular albums (currently the top ten, but that’s simply a variable in the script), a list of the most recent albums (again, currently ten), a niftly little Ajaxy “people are currently viewing…” box and, on a separate page, a full text-based sitemap in tree format.

I think it looks better than the default front page (which is still there, it’s now the “thumbnail view” link from the new front page). It’s not complete yet – I want to add a few more things like “top photos this week” or similar – but it’s good enough for now.

Comments are welcome – I’d appreciate opinions on how to improve it, or anything that looks wrong to visitors.