hi,
on the next version of my theme, I posted the login form in colorbox. You can see the result here:
http://test.vincentbourganel.fr/I would have the same function for displaying the password form (for protected album for example).
to be more precise: when I click on an image with the lock, the password form is displayed in colorbox, and if OK, the user is returned to the album.
is it possible to do that ?
Comments
when the logon button is pressed, colorbox is closed and you are logged.
I wish to do the same thing with password form
http://jacklmoore.com/colorbox/
Anyway, if the colorbox is closed without the page behind reloaded that page will not reflect you are logged in until you do so manually or accessing another page.
it works without reload anything.
in fact, the login form is in the footer : colorbox use inline content.
for password form, maybe, there is another story (maybe use iframe content)
If instead you want to change the link to the album if it is password protected, you could then make a colorbox. Of course, the normal template functions do not do that, so you would have to code your own album link functions. Those functions could test to see if the viewer has access rights to the album, and if not present a colorbox login form like you do for the footer.
The `printUserLogin_out()` function does not have a parameter for the redirect. However it does make use of a global variable `$__redirect` which is an array of query parameters. So you could setup that array before the function call to set the `album=xxx` query parameter. Kind of relying on undocumented behavior, so if you find this useful we really need to formalize the parameter.
so, for my personnal use, I don't need to have a new redirect parameter in the call of `printUserLogin_out()`.
nevertheless it is an interesting idea, especially since printPasswordform use this parameter. It seems to be my need. but I am not competent enough to code this improvement, and it's a pity, because this would bring the same experience on the using of the theme (password and login in colorbox)
I need your help :
when a user access on protected album (for example), `zp_loggedin()` is false.
so is there a variable which indicates this particular state (the user is not logged in, but he has provided a correct login/password to access on protected object) ?
you can tell if a viewer may browse an album with `$album->checkAccess()` But it does not distinguish between Zenphoto users and guest password users. Just tells you that the viewer may access the album. It is true if the viewer has provided the correct guest password or is a zenphoto user with rights to browse the album.
BTW, there is no simple way to tell if a user could access the album.
I did some tests with the theme zenpage:
If you connect with the credentials of a user, you have the link "logout" between tags `
` and `- ` in the sidebar and it's OK.
But, if you connect to a protected album using the login / password of the album, you have the link "Logout" not included in the tags `
` and `- ` in the sidebar.
In fact, if you use the login/password of a protected object, you are considered as not connected ( if (zp_loggedin()) returns false ).
But at the same time, in printUserLogin_out, it seems you are considered as connected and the logout link is displayed.
however, there is a problem : the function js() (the call of colorbox) is not called by other themes : so it works only with zenpage, and not with zpardoise, so I can't benifit of this improvement :-(
a note: I found a trick to force the display of colorbox if there is error message
I will add the modified file to the ticket http://www.zenphoto.org/trac/ticket/2054
Thanks for the modification, a good addition.
I have some tests with new printUserLogin_out and my personnal themes : I use the same undocumented code that Zenpage does use.
I don't undderstand :
the following script, applied in the header with zenpage theme, is not applied with other themes.
`
//
`
so, the colorbox is not displayed (even if colorbox is enabled on the page)
can you explain where the problem is ?
to be more simple, why don't you add this code in
why don't write this script next to the generated HTML (and not in the header), as you did with the search parameters or colorbox slideshow parameters ?
I have another request :
for cross-browser compatibility, could you add in the colorbox parameters `innerWidth: "400px"`.
with actual parameters, it doesn't work well with IE7...
No problem with the innerwidth. I will add that.
`
<?php if (function_exists("printUserLogin_out")) { ?>
<?php printUserLogin_out("","", 2); ?>
<?php } ?>
`
mine is
`
<?php if (function_exists('printUserLogin_out')) { ?>
<?php printUserLogin_out(' | ', '', 2); ?>
<?php } ?>
`
of course, colorbox is enabled on each page of the theme.