Page 1 of 2

How to limit number o images per user per category

Posted: 01 Sep 2010, 22:24
by mendesm
I'd like to be able to limit how many images a user can upload to a particular gallery, for example, for each (or a specific) gallery, allow the user to uploade a maximum of 5 pictures. does anyone know how to do that?

Thanks.

Re: How to limit number o images per user per category

Posted: 06 Sep 2010, 21:16
by Jan
Hi, in parameters you can set limits - how much images per user can be upload, the maximum size of uploaded images, the maximum size of all uploaded images per user.

Jan

Re: How to limit number o images per user per category

Posted: 07 Sep 2010, 03:46
by mendesm
Hi,

Can you tell me which setting that is? When I looked in the parameters, in the "Upload Settings" I only found these options:
1. Enable User Upload Image Authorization
2. Maximum Description Characters
3. Maximum Upload Size (in bytes - front, admin upload)
4. Maximum Resolution - Width
5. Maximum Resolution - Height
6. Maximum Size of all User's Images
7. Enable Java Uploader
8. Enable Java Upload in Administration
9. Java Resize Width
10. Java Resize Height
11. Java Box Width
12. Java Box Height

I thought that number 6 might be it, but isn't that the maximum number of bytes that can be used by all of a user's images? What I am looking for is the ability to let a user upload only 1 image (regardless of how small or big that image is).

Thanks.


-Mario

Re: How to limit number o images per user per category

Posted: 11 Sep 2010, 13:59
by Jan
Hi, see:
https://www.phoca.cz/documents/2-phoca-g ... -menu-item

Maximum Count of Subcategories - Set maximum count of subcategories which users can create in frontend
Enable User Upload Image Authorization - If yes, the uploaded image will be set as not authorized and must be authorized by administrator. If no, the upload image will be set as authorized
Maximum Description Characters Set maximum of characters they can be written by users into description form.
Maximum Upload Size (in bytes - front,admin upload) Maximum Upload Size of an image.
Maximum Resolution - Width Set maximum resolution width of uploaded image
Maximum Resolution - Height Set maximum resolution height of uploaded image
Maximum Size of all User's Images Set maximum size of all user's images which can be uploaded

Jan

Re: How to limit number o images per user per category

Posted: 15 Sep 2010, 04:59
by mendesm
Hi Jan. Thanks for your reply. I had already seen the documentation.

I understand that I can set the gallery so that an admin can approve (or not) a user's uploaded images. By doing that the admin can check and make sure that the user has not uploaded the maximum number of images. But what we really need is to be able to set it all up so that all images that a user uploads be approved (no admin intervention) but set the gallery so that once the user has uploaded X number of images that they can't upload anymore images.

Unless I am completely missing something, the only way to do that is by having an admin check to see if a user has already uploaded X images and if so, no approve any other image uploads.

Re: How to limit number o images per user per category

Posted: 15 Sep 2010, 15:14
by Jan
Hi, sorry I don't understand.

The check of uploaded size of image or of all images is independent on administrator's approving. It works with or without approving. If user reach the limit he/she cannot upload more and yet uploaded images can be published and approved in the system - just set if new uploaded images should go through administrator's approving or not.

Jan

Re: How to limit number o images per user per category

Posted: 15 Sep 2010, 19:19
by mendesm
OK, let me try to explain in a different way then.

In my site I installed Phoca Gallery and I created 2 categories called Category1 and Category2. My site has 3 registered users, user1, user2 and user3. All 3 users can upload pictures to Category1. The size of the picture that the users will upload can be of any size.

Here's what I want to be able to do:

1) User1 uploads 1 picture to Category1
2) User1 tries to upload another picture to Category1 but Phoca Gallery says "You cannot upload anymore pictures to Category1."
3) User1 tries to upload another picture but this time to Category2 and he can because he does not have any pictures there yet
4) User2 uploads a picture to Category1
5) User2 uploads a picture to Category2
6) User2 tries to upload another picture to Category2, but gets error "you cannot upload anymore pictures to Category2"
7) User1 deletes HIS picture from Category1
8) User1 uploads a new picture to Category1 (this works because now he less then the maximum of 1 picture for this gallery)
9) User3 uploads a picture to Category1
10) User3 uplodas a picture to Category2
11) User3 uploads a picture to Category2 again, but gets the message "You cannot upload anymore pictures to Category2"
11) User3 uploads a picture to Category1 again, but gets the message "You cannot upload anymore pictures to Category1"

Right now, I can set the maximum size of all pictures that a user can upload. So if I set that to 100K, user1 can upload 1 picture of 100KB or 2 pictures of 50KB or 3 of 30KB and 1 of 10KB and so on. What I need to do is allow user1 to upload only 1 picture but that picture can be of any size.

In other words, I want to configure the maximum number of pictures that a user can upload to a category, not the maximum space that all the pictures that a user can upload.

I hope this helps to explain what I need a little better. If not, let me know and I'll try again :)

-Mario

Re: How to limit number o images per user per category

Posted: 15 Sep 2010, 22:24
by Jan
Hi,

1) Ok
2) Ok, depends on limit of the category - if it is user category and it is an UCP - the global size of all images is checked, if this is category view and user has only access, the global size of all uploaded images is not checked. Only the size of the uploaded image
3) ...

The limit is set to size not to count so this needs to be customized - in fact a lot of code needs to be overwritten - instead of checking the size of all images, you need to save count of uploaded images (this does not need to add specific column in database - sql load count of all images which are set for user - from user's category) but the upload form (model) needs to be changed (in php code) :-(

Jan

Re: How to limit number o images per user per category

Posted: 16 Sep 2010, 18:19
by mendesm
Understood. So it's not a quick or easy change.

That's too bad, it would be extremely useful for our needs right now and I have not found any extensions that allows us to do this.

Thanks for your help.


-Mario

Re: How to limit number o images per user per category

Posted: 16 Feb 2011, 12:06
by p0ggles
How can we make it so the user has unlimited amount of upload space?