Hello there,
please bear with me if this has been discussed widely (I hope not), I was not able to find anything too close related to my case.
I am currently setting up a website for a photographer who wants to have a login area where customers of her can view an album of photographs they had ordered, so they can re-order them. No need for getting any web shop or data transmission to a contact form, it's just that those customers should be able to see a specific album after they logged on, and nobody else.
Setting up the basics is simple - we have some open albums visible to anyone, and one that is connected to a user, i.e. it has not been published, but is tied to a specific user with limited rights (viewing etc.) so that he is able to see them when he is on while nobody else sees the albums.
My question is: is it possible to have this very album/the pictures for the customer on a separate page and not in the main gallery, and make the login form redirect to that page? The photographer will have more than one customer, so sending them to a straight URI of a specific album will not work well

. Can anybody help me out with some hints on this?
Thanks in advance

.
Comments
Create a toplevel album where you put all open viewable albums in and link directly to that via a main navigation for example. That will look like the index page.
Then you create a page that displays all future password albums except that one. We have some functions for that like isMyAlbum.
thank you for helping me out a second time today. Not sure whether you nailed it or not, but it sounds helpful in the first place. What I want to achieve is a) an area where each and every visitor of the site can see some public albums and b) an area where a registered user can see his or her own album(s).
Suggestion 1 - acrylian - wouldn't that mean I have maybe a big album for all client sub-albums, and everyone, each client, can at least see that other clients also have albums up there, only that they cannot access it without the password?
Suggestion 2 - sbillard - I may be a complete stupid person, but I had already tried that out, resulting in a redirect to an upgrade for zenphoto - each time I try it out. No upgrade preinstalled for zenPhoto, so I wonder what that means...
Thank you again for your help!
`if (!file_exists(dirname(__FILE__) . '/' . ZENFOLDER . "/zp-config.php")) {`
to be:
`if (!file_exists(dirname(__FILE__) . '/zp-data/zp-config.php")) {`
alo change:
`require_once(SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER . 'user_logout.php');`
to be:
`require_once(SERVERPATH . "/" . ZENFOLDER . "/" . PLUGIN_FOLDER . '/user_login-out.php');`
Since the client albums would also be top level albums (as only those can be password protected) no one visiting would see them. If you use the helper function isMyAlbum() to test the clients will only see their own albums if they are loggedin and nothing if not.
Rough code for a client page (a custom theme page like clientlogin.php):
`
<?php if(!zp_loggedin()) printPasswordForm(); (( to display the password form if not loggedin
while (next_album()):
if(isMyAlbum($_zp_current_album->name,ALBUM_RIGHTS)) { // you might add here additional checks to prevent display of other albums.
endwhile; ?>
`
I did this for a client's site myself (sadly not online yet so I can't show)
I will try out both later to see what helps me most. So far acrylian's approach seems closer to what I need, but my tests will tell
Thanks again for so much help!
I checked with the single_login approach and am having trouble to get any further. Once the login is processed, it leads to an 'object not found' page created by zenphoto. In my lay interpretation of the PHP code I'd think that
if (!is_null($_zp_current_admin)) {
if ($_zp_loggedin & ADMIN_RIGHTS) {
header("Location: " . WEBPATH . "/");
} else {
$albums = getManagedAlbumList();
$album = array_shift($albums);
header("Location: " . WEBPATH . "/".$album.'/');
}
is not leading to the page it should. I tried with a super admin and a normal user who is able to see an album exclusively. No avail so far....
Can somebody point me in the right direction?
Thanks as usual
EDIT: No, just my wrong interpretation of PHP code
If I put up a
if (!defined('WEBPATH')) { define('WEBPATH', ''); }
for the
if (!is_null($_zp_current_admin)) {
if ($_zp_loggedin & ADMIN_RIGHTS) {
header("Location: " . WEBPATH . "/");
} else {
$albums = getManagedAlbumList();
$album = array_shift($albums);
header("Location: " . WEBPATH . "/".$album.'/');
}
stuff I get a successful redirect, but each time to the home page of my site, not the portfolio url (home: www.address.com, portfolio at www.address.com/portfolio) or the specific albums or or the user manages....
If I leave out my !define WEBPATH, I get the 'Object not found' error, if I include it, I get redirected to the frontpage of my website (not the portfolio), be it an admin or the user form I described above... sorry if I start sounding lame
If I define webpath this way:
if (!defined('WEBPATH')) { define('WEBPATH', ''); }
the script leads me to the homepage of the site (not the portfolio), no matter what kind of user I am. If I leave it out like in the original script, I get these 'object not found' errors.
I have tried also using the single user login extension and have followed the instructions to the T but when I navigate to where the index.php page included to use this I receive the error:
Fatal error: Call to undefined function printuserlogout() in /home/mysite/public_html/sitetest/single_login.php on line 41
any clues?
Jake
that worked, thank you - but it doesn't show the albums... no matter - I will bash on a little more...