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-colorado
After 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.jpg
If 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
Please take a look here if this answers your questions already:
http://www.zenphoto.org/news/an-overview-of-zenphoto-users
I already had a look before posting this query. In my understanding (if correct) the option I am looking for is not addressed there. The link you sent mentions:
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.
We have no such protection on image level. You can guest password protect any album or you can limit top level albums and all sub albums via rights for registered users only. But you will not get to the thumbs.
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.
file: image.php
if (zp_loggedin(user)) {load_CurrentPage;} else {load_LoginPage;}
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.
No, much simpler. Place this check around the acual content of the image.php page:
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
The issue I am getting with this is:
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.
yeah this works however password.php brings up the page that requests for a password only i.e. there is no option for username. http://www.outzeal.com/index.php?album=skiing/photos/usa-colorado
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
If you use the code I noted last like:
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.
I am using the code like:
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.
You can of course choose to not upgrade on your own risk but you miss issue and security fixes and, well, as you know we can only support the current version.
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).
Starting with 1.4.4 all consecutive releases are available on GitHub https://github.com/zenphoto/zenphoto/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.