I am beginning to understand how to manipulate ZenPhoto/Zenpage pretty well, but I have come across a stumbling block that is pretty hard to search for, so forgive me if this has been addressed in a previous thread.
Basically what I want to do is create a 'custom page' that is called from an image page and is an alternate of image.php. This page would display unscaled images one at a time in full screen with nothing else on the page but «prev next» navigation and a close button that returns you to the original image.php.
I know this is what slideshow (js or colorbox) does, but my boss is insistent that the full screen navigation mode works without any javascript.
I think the URL should somehow be addressing the full screen image page differently than the standard image page, such as
http://mysite.com/album1/Photo1.jpg-full.php or something similar.
According to the theming tutorial the only page that calls up images is image.php, is there any way to duplicate that functionality on a different page without messing with the zenphoto core? Zenpage custom pages I don't think will work because they don't call up images as mentioned in the theming tutorial.
Thanks in advance, and feel free to ask more questions.
Stan
Comments
Then you need to create an image object of that image using the object model (see its tutorial) and make that current using the makeImageCurrent() function (see the doc for correct spelling). You need to do that because you want the prev/next navigation on that page and the link to return to the normal image.php page.
Alternatively you could just stay on the standard image.php page and use a GET command to switch the display.
in the <head> of this file I put sbillard's code with a few extra lines to make a variable for the current image.
`
<?php
$image = newImage(NULL, array('folder'=>sanitize($_GET['album'],'filename'=>sanitize($_GET['image']));
$image = makeImageCurrent($image);
$fullimgurl = getFullImageURL();
?>
`
then to start with getting the full image in there I put something like:
`
" />
`
in the body.
to switch to the imagefull page from the image.php page I would just have an href like:
`
getFolder() ?>&image=<?php echo $_zp_current_image->getFileName() ?>">FULL
`
One problem is that the album is actually a subalbum, so "album/subalbum" gets thrown into the URL. Not sure where I am going wrong, I'm learning more advanced PHP as I go here.
having a sloppy URL is not really a big deal, since the full size pages are duplicates. I can always add mod_rewrites to the .htaccess later.
Thanks again, I think I am really close!
http://www.zenphoto.org/documentation/plugins/_zp-extensions---multiple_layouts.php.html, could you use
`GetLayout()`
which says it "Gets the select layout page and returns it to the load_theme_script filter"
along with
`zp_apply_filter()` and `load_theme_script`
to do this with a button?
Thanks
You still have to have a means to decide to switch layouts on the fly. That is what the URLs are all about. So your button would either create a URL with the selector and you use $_GET to check for it or it would POST the selector and you would use $_POST to check for it.
Small step to have the url for the request go to your custom page--no other "magic" needed.
If you wish, you could implement a pugin with a filter for `load_theme_script` which did the switching, but you still have to have some clue in the page request to decide to do so.