So I wanted to create a photo gallery website. After trying a few other photo gallery softwares, ZenPhoto seemed to be the most beautiful, simple and robust of them all. After the site is up and running, I went on to select a theme for the site. The one I like most is from Stopdesign, and it showed the galleries, albums and photos beautifully. So far so good, I thought, and I wanted to browse the site from my iPhone.
Well, Safari browser, being Safari, rendered the pages quite well. However, two problems remained.
- It did not look as good on the small iPhone screen.
- I had a few flash videos; and of course, they did not play on iPhone
Looking for a theme customized for iPhone, I found the ZenPhoto iPhone theme. After installation though, the theme refused to work, since the theme was for a previous version of ZenPhoto, and some of the APIs had changed since this theme was released.
Back to the drawing board, I did a few modifications on the theme to make it compatible to the current version of ZenPhoto, and tried to contact the original creator of the theme. I never got any reply. However, a number of ZenPhoto users saw my comment and contacted me for the updated theme since they were facing the same problems as I did. I was happy to share the updated theme. But there were a few other changes I did that was not part of the theme, and therefore I could not share those with the theme files. So I thought to write a post where I speak about about the changes, and also where I can share the theme so that everybody can get a chance to use this nice iPhone theme. Read on for the details.
Note: There are two cases where I change the core ZenPhoto files; zp-core/functions.php and zp-core/zp-extensions/class-video.php. Before you use the updated files, please make a backup copy of the original files so that, if anything goes wrong, you can revert back to the original files.
First and foremost, here is the link to the theme files. It can be extracted to the themes folder within the zenphoto root folder. A little bit more work is required to make the theme work on iPhone/iPod touch. I did these changes in the functions.php file within the zp-core folder under zenphoto root folder. Here is the updated file, which can be saved as functions.php within the zp-core folder for the changes to take effect. This will use the iPhone theme when the site is opened from iPhone (using Safari or Opera Mini), but the regular ZenPhoto theme for any other platform/browser.
The other change I did was for making sure we use the flv video (or any other video that uses the flash player) when the site is opened in a computer, but the mp4 version when opened in iPhone (Safari or Opera Mini) or iPad. This is a little more involved, so please follow the steps carefully if you want to include this update. Note that for this you will need your regular flv file and a still image for preview as usual, but in addition you will need an mp4 file with the same name. There are many softwares, including free ones, that can convert various video files to mp4.
- The php file to update is zp-core/zp-extensions/class-video.php. The updated file can be downloaded here. Change the extension to php before using.
- The mp4 files should be placed in the folder mp4 under the ZenPhoto root folder. The files should have the same name as the regular video files in albums, but the extension should be mp4. Note that in my implementation this is a single folder for mp4 videos of all albums, so the file name of every mp4 file needs to be unique.
- The mp4 file, when opened in iPhone/iPod touch or iPad, will take the still image as placed in the respective album folder. No need to create separate still image for the mp4 videos.
Lastly, I wanted to make another small change to make sure when looking at the album, the video files are distinguishable from images. For that I put a small clapperboard icon on the top left corner of the video thumbnails. This is also included in the iPhone theme, so it will automatically show video files with the video icon. No extra work is needed in your part for this to take effect.
PS. Here’s a beautiful site that uses the ZenPhoto iPhone theme: http://bilder.abrocker.de. (The owner of this site had contacted me for using the ZenPhoto iPhone theme. I really liked the site, hence linking it here. Link to my own ZenPhoto site is at the top of this page – look for Photo Gallery)
UPDATE: Jay Matz is back with updates to the ZenPhoto iPhone theme. I have updated the download link to reflect the updated theme, which means the updated theme can be downloaded either from the google code page or from the link above.