Wednesday, February 02, 2005

That Content is Dynamic!

I searched high and I searched low. I tried using ready made scripts and I tried making my own. Forums didn't help and neither did tutorials. In the end I needed some good old html. What was I trying to do? Add that little thumbnail to my sidebar that will always show the most recent picture in my Lunch Special album.

The problem is that when I'm trying to figure something out I get a bit obsessed and I just can't let it go. I literally spent hours to add that one little thing to my blog. Of course the positive aspect of that is I now have some knowledge of how php, javascript, the object tag, and iframes all work. I love learning how things work. The biggest lesson learned by far was "look for the simplest solution".

Below is an explanation of how I did it in case someone that's trying to do the same thing stumbles across this. Warning: droll technical speak beginning now.

I use Coppermine Photo Gallery to display my pictures. I wanted to be able to show the thumbnail of the most recent picture uploaded to one specific album on the sidebar of this blog.

I found out about the ssi.php mod on the Coppermine Photo Gallery support forums. The instructions included are very good and will do a much better job of explaining how to use it to display different thumbnails than I could here.

Using the ssi.php instructions I created a new php file that calls the ssi.php script to display the specific thumbnail that I wanted. I wasn't able to use a php include or a javascript call. I found that I could do it with an iframe or an object tag. The object tag worked fine in Firefox but Internet Explorer bawked at it. So I ended up using the iframe. Unfortunately that meant I had to format it so it would display nicely. If you want to see the code just view the source and look for the iframe tag.

No comments: