I am still using very old zen-photo 1.0.8. Here are some hacks for mobile compatible zen-photo gallery.
1. Create separate mobile folder called "mobile" or "iphone" or "wap" into theme folder. Write your wap/xhtml/iphone specific theme code in "index.php", "album.php" & "image.php"
2. open index.php,
now, we need to detect mobile, & replacing existing theme with mobile one. So, we can get theme with $theme = $_zp_gallery->getCurrentTheme();
Replace that line with $UA = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "";
$cldc = stristr($UA, 'cldc') ? true : false;
$midp = stristr($UA, 'midp') ? true : false;
$OPWV = stristr($UA, 'OPWV') ? true : false;
$iphone = stristr($UA, 'iPhone') ? true : false;
if($cldc || $midp || $OPWV || $iphone){
$theme = "mobile"; // It's telling zenphoto to open mobile theme.
}else{
$theme = $_zp_gallery->getCurrentTheme(); // It's your regular theme
}
3. open zen/zp_config.php here we need to change thumbnail, resolution, photo, album par page, photos per page etc accoding to mobile compitibility.
e.g.
if($cldc || $midp || $OPWV || $iphone){
$conf['image_quality'] = 55; // lesser values for faster loading on mobile
$conf['thumb_quality'] = 60;
$conf['albums_per_page'] = 5; // less albums to prevent memory overflow in 40 series mobile
$conf['images_per_page'] = 5; // less photos to prevent memory overflow in 40 series mobile
//... change some other parameters for mobile compatibilities
}else{
// your regular one
}
So, finally BollySite (
http://actress.bollysite.com) zen-photo goes mobile. You may check it on your mobile GPRS.
Still I am beautifying the theme in incremental way... but zenphoto team may think to include these feature by next release.
Comments
Generally any theme that separates html and css styling should be somehow usable in an mobile environment. So could you please open a feature request ticket and attach that code there, so this does not get lost? Thanks.