Module: Quotas
rWatcher
Joined: 2005-09-06
Posts: 722 |
Posted: Tue, 2011-09-13 00:31 | |||||||||
Quotas is a module for Gallery 3 that will track how much total space is being used to store each users photos and movies and will allow admins to place upload limits on user groups. Once activated, this module will keep a running total (in bytes) of the file sizes for photos and movies as each user uploads and deletes files (albums are ignored). If a file would push a user over their limit, it will be automatically rejected on upload, with the user seeing a message that Gallery was unable to process their file. Be aware that any module that can reassign a users photos to another user (other then deleting a user) or modify a file (other then rotating) will mess up this total file size number as the change in file size will not be logged. This module contains a maintenance script to calculate the current disc space usage for all existing files and users. It can be found at Admin -> Maintenance -> Rebuild user quotas table. This module will also display a message at the bottom of album/photo/movie pages for logged in users to tell them how much space they're using, and what their limit is (if they have one). Admin users may log in and see a current user's usage from the Admin -> Content -> User quotas screen. Admin users may assign upload limits (in megabytes) from the Admin -> Content -> User quotas screen. Admin's may also specify if resizes and thumbnails should be counted towards a users limit from this page. Once a limit is set, all users in that group will be unable to upload more then their limit, with the exception that if a full sized image does not put the user over their limit, but the resize+thumb does, the photo will still be accepted (as resizes and thumbs are not generated until after the photo is stored in Gallery and after the quota check is run). A value of 0 can be used to specify "no limit" for a group. If a user is assigned to more then one group, the largest non-zero value will be used as their limit. ---
|
||||||||||
Posts: 424
wow, this is great. thanks rwatcher! now I just need to get someone to extend the permissions on gallery so that I can use it as a bridge with mybb.
Posts: 722
I've updated the quotas module. This version will display space usage and limits for users with an "appropriate" file size prefix instead of using "MB" for everything (Groups will continue to display everything in MB). It also displays an infinity symbol instead of "0.00 MB" for users without a limit.
[img]http://gallery.menalto.com/files/quotasupdate.png[/img]
Tested with Gallery 3.0.3.
Posts: 18
How can I edit your module so that the info will show in a specific area of the site, lets say, the footer?
thank you.
________________________________
API:
- Gallery 3.0.3
Server:
- Apache 2.2.22
- PHP 5.2.17
- MySQL 5.1.61-community-log
- OS linux x86_64
Posts: 722
If you're referring to the code that inserts text into the bottom of the pages to let the user know what percentage of their quota is currently being used, it's generated in this file:
http://github.com/rWatcher/gallery3-contrib/blob/master/3.0/modules/quotas/helpers/quotas_theme.php
You could change page_bottom to a different page function to insert it somewhere else, or use that code as part of a custom theme.
Posts: 18
Where/how can I find the page functions available for use? I'm using theme Wind.
Thanks
________________________________
API:
- Gallery 3.0.3
Server:
- Apache 2.2.22
- PHP 5.2.17
- MySQL 5.1.61-community-log
- OS linux x86_64
Posts: 722
http://codex.gallery2.org/Gallery3:Developer_Handbook:Gallery3_Modules#Theme
Posts: 18
Thank you!
________________________________
API:
- Gallery 3.0.3
Server:
- Apache 2.2.22
- PHP 5.2.17
- MySQL 5.1.61-community-log
- OS linux x86_64
Posts: 722
Update --
This module now generates a "User stats" section on the user profile pages.
[img]http://gallery.menalto.com/files/quotas_stats.png[/img]