This is my photo album site. It all started as an experiment in coding. Let me explain.
"Hmm" I thought. "I wonder how hard it is to do this AJAX thing I keep hearing about." As it turns out, not very. Well, the basics, at any rate. I ran through a quick tutorial and it all seemed to make sense. I'd been wanting to do a photo album type application for a while and that seemed like a good choice to show off that kind of functionality.
Anyway, that all turned out to work quite well. The original version combined the thumbnails and main image screens, giving you a scrolling list thumbnails down the left that you could navigate (showing off the AJAX a bit). And I was pleased.
So I'm just styling it up to look vaguely presentable when my friend sends me a link to his Picassa album. And I noticed that the images are dynamically resized, leading me to investigate how that might be possible. And look, PHP has built in functionality to resize images server side. So if I used some javascript to find out the browser window dimensions, passed that to the PHP... yes, generate and return an image to fit your window. And add a bit more scripting to regenerate it if the user suddenly decides to resize their window. Cool.
Once again I'm on the verge of 'finishing' when on an unrelated topic I start learning about object oriented programming. And for the first time in my life it all makes sense (thanks a bunch, university. REAL well explained). And I'm picturing the code in my head and the concept of session variables drifts in and I come to the conclusion I could do this whole thing a lot simpler and cleaner using that.
Now we're up to rewrite number 5, or something like that (did I mention that all of the data is held in XML, but as an experiment I took a copy and converted it to work with a database instead, but you get the XML version because my hosting doesn't include MySQL? That was surprisingly easy too).
It should be mostly HTML compliant and render correctly in most browsers although I haven't exhaustively tested it. There's also a lot of error checking that probably shouldn't be here but isn't - I really wanted to get this thing online to actually display some photographs, polishing (and a better looking UI) will come later. Incidentally there's AJAX to move between pages of thumbs, but at the time of writing this I haven't added an album with enough photos to trigger it.
Sorry about the name - I needed to call it something, if only to name the directory. Any better suggestions welcome. Thanks to Jim for code sanity checking.
Man, this stuff is engrossing. Having suddenly come across jQuery and discovering the draggable function, I thought it would be brilliant for the 'full size' image option. And it is. Had to do something clever with the stylesheet (of all things) to make the photo stay within the bounds of the bounding box i.e. not leave a gap round the edge at any point. The result in IE 6 is horribly broken, but I don't care. It works in Firefox, Safari, and Opera. If IE7 is standards compliant, it'll work there too...