Pages (3):    1 2 3   
Member
Member
sbillard   20-12-2010, 18:43
#21

User accounts require the user_groups plugin.

There are not really two user/password systems. Only one. There is also password protection for items, but that is not really user based. One password for anyone who wishes to view. No management of the password. Someone either knows it or not.

Likewise there is a discussion of the permutations of publish and protected states for you to review.

From your questions you really want to be using the "protected gallery" capability of the development release along with the appropriate user rights and "managed" albums.

There is a discussion of User rights in the user guide. You should probably review that.

You have probably by now realized that what you wish to accomplish is a complicated set of conditions. You really should not expect a simple solution to a complex problem.

Member
Member
vincent3569   21-12-2010, 10:45
#22

Hello,

I have exactly the same need: to have 2 galleries in one :

  • 'portfolio' gallery with 4 albums (for example)
  • 'family' gallery with 10 albums (for example too

visitors only see the 'porfolio' part, and do not see the private albums (no thumbs with a lock)

registred users can see the private party (in addition to the public part).

I am very interested in the solution, and maybe, it should be part of a FAQ

Member
Member
gwmbox   21-12-2010, 14:06
#23

Hi Vincent, I am still trying to figure it out, the last part is trying to work out how I can check the user of the sub-album, acrylian has given me a hint but so far I am not able to work it out. Unless Acrlian is willing to help further with a solution it will be a slow trial and error process until I work it out

sbillard, why do user accounts 'require' the user_groups plugin, I tried it and from my own testing it adds little value for what I am trying to achieve other than being able to group people in 'groups' ... which is not what I want in this case.

re the difficult or complicated solution to get my desired result, I am not sure how complicated it needs to be, at this stage it is quite simple to identify if the user is logged in and who that user is, I guess the complicated part must be to check the sub-albums username as so far I have been unable to work it out... hence why t must be more complicated than what I have been trying.... but I will keep trying

Cheers

GW

Administrator
Administrator
acrylian   21-12-2010, 14:16
#24

Well, checking those fields comes done to the basics of our object model. You can always get the subalbum names if there are any by using the getAlbums() method on an album object, the current one in the global. Then you can set up further album objects of these and use the methods to get the field you need and perform your check.

I think sbillard was refering to general user groups.

Member
Member
gwmbox   21-12-2010, 14:49
#25

Thanks acrylian, yes I have been playing with the getAlbums, but it is the getUser I am trying to work out for the sub album, as I said, still trying different things and it is a case of trial and error

Cheers

GW

Member
Member
sbillard   21-12-2010, 22:06
#26

My mistake. I thought that you did want to group users of similar capabilities. If that is not the case, no need for the plugin.

Member
Member
gwmbox   22-12-2010, 02:43
#27

This ended up being easier than I thought

[b]NOTES:[/b]

  1. This solution has been tested on nightly build 6370 (12/20), I have NOT tested it on the stable 1.3.1.2

  2. This solution below is based on using the base 'zenpage' theme, mine is a different theme so I have applied it to the [b]zenpage[/b] theme so you can see what I have done. This way you can see what the differences between the old base template to my replacement solution, you can then apply the same principle and modify it to your theme output.

  3. This assumes you are using the zenphoto USERS function by adding login accounts AND also the albums Protected user/password feature as it will check one against the other

  4. I have ONLY tested this with only 1 user per album, not multiple... from looking at it however it will only work with a like to like user to user, so if you want a group maybe assign a user to a group username and apply a user account as a group username and then they can login with that username (I hope that makes sense).

  5. This does NOT use the group login plugin. Only the login-out plugin for the password form is used.

[b]Ok the steps.[/b]

STEP 1 - password form

For my login function I have inserted the login form code in a codeblock for the top protected album (you may wish to add it to all private albums to enable the login-out links and forms if direct access)

Codeblock 1 (you can use any of them) or just add it to your album.php directly - but we have some that need the login and some that do not so I decided to only add it to the private albums.

If adding password form to codeblock use;

`

`
STEP 2 - call the code block

under

`

'

add
`
'

(change the number to the codeblock number you use.)

STEP 3 - Add the check for protected album and print if not secure or is allowed.

locate and replace

`

   ">


   ">

`
with

`

   ">


   ">










   ">


   ">

`
STEP 4

Make sure you have assigned a username/password to your private album and have created a user with the same username password

That is really it, try it on the front end, when not logged in you should not see the sub albums of your private albums, instead a login form should show, Login using the USER (not admin) account and you should be able to now see that users sub-album.

I hope it works for you as it does for me.

The next thing I am to work on is how to apply the same to the menu, so that the sub album menu items only show for those they are allowed to see, should be the same but I will report back once I have tested that.

Any questions then please reply and I will try and help where I can

Cheers

GW

Member
Member
gwmbox   22-12-2010, 03:04
#28

Where is the check for 'if allowed access' print list of album menu items? I might be just overlooking it

Cheers

GW

Member
Member
sbillard   22-12-2010, 04:26
#29

There really is not such a check. Instead, when the list of albums is genereated only those that are allowed are provided in the list. Generallyl this makes things much simpler, but of course, not in your case.

You would have to check each album individually. The function that does the check is $albumobj->isMyItem($action) Where action, in your case, should be LIST_RIGHTS. The print_album_menu plugin has "helper" functions that are passed the album list, so you could create a customized list then pass it.

I wonder, though. If the protected albums are also not published, they will not show up in the menu unless the loggedin user has manage rights on them. wouldn't that be a simpler solution?

Member
Member
gwmbox   22-12-2010, 05:57
#30

Hi sbillard, yes they are already un-published but when 'any' user is logged in they can see 'all' of the albums under the menu item, what I need is for the sub-albums to only list their items.

Alternatively is there a way I can tell the album menu list to not list the sub albums for just that album, or even is there a way I can set an individual menu for each top level album and then I can set the depth to show for each one. I don't mind the private-albums one having no sub-albums shown that will do just fine.

Cheers

GW

Member
Member
gwmbox   22-12-2010, 06:45
#31

What is and how does $menuset (the menu tree desired) work? What is the menu tree? The album, a custom menu?

Also what about printAlbumMenuListAlbum, does this enable me to limit the menu item to a single album (and its sub-items)? Is that what the folder variable is for?

I am trying to stay away from manually having to create and add to a custom menu, I am trying to use the built in functions as much as possible.

Thanks

GW

Administrator
Administrator
acrylian   22-12-2010, 11:07
#32

Be sure not to confuse the menu_manager plugin and the print_album_menu. $menuset refers to the menu set you want to use with the menu manager as you can have multiples. You could for example manually create one that only shows your top level album but not the sub albums you don't want to show. If you name it like the album you could even call it by using hte current album name.

printAlbummenuListAlbum belongs to the print_album_menu plugin. The menus are quite complicated stuff (sbillard did thankfully rework those parts to be more effective when I did them more straitght forward once) because of the rather complicated html list nesting they need to put out correctly.

Member
Member
sbillard   22-12-2010, 18:25
#33

As far as album visibility. If you have not given the user View All rights he can see only published albums and albums which are in his managed album list. Seems that is what you are looking for, isn't it?

If so then the approach would be:

  1. Make the root album published and password protected. (It does not matter what the password is.)

  2. Make the "private" subalbums unpublished and password protected. (Again, the password does not matter.)

  3. Assign Place the albums into the managed albums list of the users that are supposed to be able to see them (and, of course, not in the users who are not supposed to see them.) Set the other priviledges as desired, but DO NOT assign View all rights as that overrides what you desire.

Then when a visitor not logged in visits the root album he will be required to log in. (Be sure the option is set so that the usercode field is presented in the logon form.) Only the logon form is presented at this time.

(Alternatively, you can make this album public and use the user login-out plugin to present the login form. In this case any public subalbums in the album will be shown.)

The user logs in with his credentials. He will be able to see any public subalbums and any subalbums assigned to him.

Member
Member
gwmbox   22-12-2010, 23:48
#34

sbillard, not sure what your post is about? My solution on p[age 1 of this thread works brilliant for me. The albums are 'unpublished' and my solution allows the 'user' to login and then they are able to view their album, and only heir album.

acrylian, thanks for the info. Is there a way to call only 1 album using one of the printalbummenu functions? Otherwise I might have to use the menu manager, prefer not to but if that is my only option then well.... that is my only option.

Thanks

GW

Member
Member
sbillard   23-12-2010, 01:00
#35

Well, the above suggestion accomplishes your initial statement of desire with NO theme changes at all. Your solution seems overly complex and unnecessary.

Also, from the discussion it did not sound like it was working. (Why the question on the menus then?) But if it does what you want, then fine.

Member
Member
gwmbox   23-12-2010, 01:42
#36

Sorry I might have misunderstood you.

My solution that I came up with provides for me the ability to have the user account only see 'their' albums. I did not try your solution as I do not want the root album password protected, only the sub-albums. Again my solution enables me to do that.

My question on the menus was because at this stage when the user is logged in the sub-album is only shown if they are the correct user, if not then it is not shown. However this does not affect the menu, the menu list still shows all the albums as there is no check to see what menu item should be shown per user.

Instead of trying to work out a way to check for user etc on the menu, just having a link to the private-album without any sub-albums would be sufficient, BUT I need the drop down lists for all our other albums.... I hope that is clear enough to understand.

So the result (for the menu) desired is that all albums are listed on the menu with their sub-albums 3 deep BUT the private album shows no sub-albums, only the top album in the menu is shown.

To accomplish this I might have to use the custom menu, but I was hoping I could just use something like printAlbummenuListAlbum() to create the menu item for each album in the menu, but I have not quite figured out how that works or if that will be the solution.

The docs say use

printAlbumMenuListAlbum( array $albums, string $path, string $folder, string $option, string $showcount, int $showsubs, string $css_class, string $css_class_topactive, string $css_class_active, bool $firstimagelink, bool $keeptopactive )

but I have not been able to get it to work, what should array $albums be?

Thanks

GW

P.S. The reason I don't like the custom menu is that in previous usage I have found it to at times forget or lose the menu order. Maybe I was using it wrong and should just give it another try.

Member
Member
sbillard   23-12-2010, 02:06
#37

The $albums parameter would be something like
array('album1/subalbum1/sub-subalbum', 'album1/subalbum2/sub-subalbum,...)` Basically a list of the albums to show.

Member
Member
gwmbox   23-12-2010, 02:57
#38

Brilliant, all done and working as I wanted it to - thanks a heap for all your help and assistance sbillard and acylian.

As I have said before once it is live and we start making sales we will pay you guys 1% of every sale each month as a donation... it might not sound like much but I am sure over time it will add up . Just imagine if every zenphoto site owner that was commercial did that - the mind boggles

Cheers again

GW

Administrator
Administrator
acrylian   23-12-2010, 21:48
#39

We are looking forward getting rich...;-)

Developer
Developer
trisweb   23-12-2010, 21:52
#40

Thanks for your support GW - much appreciated. Could help us upgrade the server finally!

Pages (3):    1 2 3   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.