Hi hope you guys are doing great. I am coming here after a long time and have even forgotten the zenphoto standard terminologies regarding albums/galleries etc (not your headache i know) so i'll explain what i need to know:
I want un-registered users to view up till here:
http://www.outzeal.com/index.php?album=skiing/photos/usa-coloradoAfter this point I want them to log in so that they can view this:
http://www.outzeal.com/index.php?album=skiing/photos/usa-colorado&image=001.jpgIf it is already mentioned somewhere pls share the link (sorry for wasting your time).
If its not mentioned before pls let me know how this can be done.
Thanks
Comments
http://www.zenphoto.org/news/an-overview-of-zenphoto-users
Protected image guest user: When these are set and image protection is set to protected, viewers will be required to login to view the full sized image.
However what I want is something similar but at a different level (i.e. one step earlier). I want unrestricted access for viewers so that they can see the albums with image icons only. Once they click on the icon to see the image, I want viewers to login first.
If you want to require being loggedin to view images at all you can modify your theme's image.php to check for the login status and refuse access of course. So don't protect the albums and modify the image.php file to refuse acccess if e.g. the vistior is not logged in and/or has a specific right.
<head>
if (zp_loggedin(user)) {load_CurrentPage;} else {load_LoginPage;}
</head>
do i need to do something like this. if yes then what will be the code to check log in status and displaying of current page or login page?
Is there a guide about these functions, thanks.
`
if(zp_loggedin()) {
// your actual single image content
} else {
printPasswordForm('', true, false);
}
`
Just using `zp_loggedin()` requires being logged in but you can also request specific rights like `zp_loggedin(VIEW_GALLERY_RIGHTS)`. You find an overview here:
http://www.zenphoto.org/news/an-overview-of-zenphoto-users
When the else command runs it prints the Password Form at the location of this code and then carries on with the rest of the script and displays the image. e.g. please follow this link to see what I mean:
http://www.outzeal.com/index.php?album=skiing/photos/usa-colorado
I tried to get the login litebox to pop up but could'nt do it. Need help thanks.
`
if (!defined('WEBPATH'))
die();
`
place:
`
if(!zp_loggedin()) {
include ('password.php');
exitZP();
}
`
I tried this instead:
if(!zp_loggedin()) {
printPasswordForm('', true, false);
exitZP();
}
this brings up the login page but not within the site.
But if I place the code after the body tag then it pops up the login page within the site and masks everything else with black color. This works good, however in this case there is no registration link visible for visitors that are not yet registered.
So the issue now is how to bring login page, if I use:
if(!zp_loggedin()) {
include ('password.php');
exitZP();
}
Or how to show register link if I use:
if(!zp_loggedin()) {
printPasswordForm('', true, false);
exitZP();
}
Thanks for your time, much appreciated
http://www.zenphoto.org/test/passwordprotected_imagepage_code.jpg.html
You get this:
http://www.zenphoto.org/test/passwordprotected_imagepage.jpg.html
So exactly what you wanted or not? Of course the function has several parameters. You can review them on the documentation as usual:
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintPasswordForm
Registering is something different but the link should be show below the form if you have th register_user plugin enabled. Otherwise you can look at the theme's register.php page.
http://www.outzeal.com/pswd_protect_code.jpg
I get this:
http://www.outzeal.com/pswd_protect_result.jpg
Your result is exactly what I need but I cant figure out why I am not getting the username field.
What does this mean 'master / support build to get the name"
if i ugrade from 1.4.5.7 to 1.4.7 support build without updating the theme ... is it ok? (i know its not recommended)
You will in any case have to update your theme in some place if you update from 1.4.5 to 1.4.6 as that was a bigger release but 1.4.7 is just a bugfix release (as the version numbering change was noted on its release).
there is no 1.4.6? any special reason?
the last digit is for the bug fix release, so is it ok to upgrade directly from 1.4.5.7 to 1.4.7 support build by skipping the intermediate releases?
You should be able to safely upgrade to 1.4.7 directly.
As @acrylian said, you will probably have to change some functions in your theme manually.
The initial issue (to be logged in for viewing images) has been resolved and it works properly now.
However if you click on the login link, the form is printed but doesn't go away after submission. I have to click on the index link to go back to the gallery/album.
Though the login function is working properly and the user is logged in after submitting the form.
Is this a bug or something at my end?
Previously the login was done through litebox popup. Is it not available anymore? The user login-out plugin options show colorbox enabled.
Cannot answer the login link issue. Is this maybe the same as this?:
https://github.com/zenphoto/zenphoto/issues/908
Couldn't reproduce that so far.
At least the printPasswordForm() function has a parameter for a page redirect. Maybe that is not set on your theme?
options/plugin/colorbox_js on active (zenpage) theme has the required pages checked e.g. index,album,gallery,image etc
but still it doesn't pop up.
Regarding redirect issue are you talking about this parameter of printPasswordForm()in template-functions.php
if (is_null($_password_redirect))
$_password_redirect = getPageRedirect();
how is one supposed to set this on a theme?
I deleted the zenpage theme files and downloaded the files again from zenphoto site (1.4.7 support build) and uploaded them.
Run the setup again. It gives a warning:
"Zenphoto core files [Some files are missing or seem wrong]"
and then it lists all zenpage theme files. Why is that?
Though after setup it gives 5 green ticks for all themes setup.
After upgrading to 1.4.7 the login colorbox is not popping up neither redirecting after submission only in zenpage. In other themes it is working properly.
After upgrading i havent customized anything yet. the files are exactly as they were downloaded from your site.