News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Group attachment limits

Started by Kays, February 11, 2013, 07:31:36 PM

Previous topic - Next topic

Kays

Link to Mod

This mod will allow you to set attachment posting limits on a per member group basis. Limits covered are: max size of each attachment, total attachment size and attachments per post.


This modification is released under a BSD license, a copy of it with its provisions is included with the package.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

jk3

Not working limits. :(

See screenshots.

Kays

Hi and thanks for that. This is a bit of a quirk in how it works. If a member has no primary member group assigned, then the default limits will apply.

I've removed the limits for ungrouped members and uploaded the revised version. So it should work as you expect it to now.

Just hope this don't mess something else up. :)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

jk3

Thanks!

Now working correctly!

Kolya

When trying to do any search in the administration center I get the message:

An Error Has Occurred!
Unable to load the 'attachment_limits' template.

TRR

Hello,

I installed this and got this error:




// Added by Group Attachment Limits mod $txt['attachment_limits'] = 'Attachment Limits'; $txt['attachment_limit_settings'] = 'Attachment Limit Settings'; $txt['attachment_limit_desc'] = 'Set member group specific attachment limits here. A member will be allowed the highest value given to the member groups they belong to. With 0 being unlimited. The default values from the attachment settings page are shown in italic. To reset to default, clear that field.'; $txt['attachmentPostGroupLimit'] = 'Max attachment
size per post in kb)'; $txt['attachmentSizeGroupLimit'] = 'Max size per
attachment in kb'; $txt['attachmentNumPerPostGroupLimit'] = 'Max number of
attachments per post'; // End Group Attachment Limits mod // Added by Group Attachment Limits mod $txt['attachment_limits'] = 'Attachment Limits'; $txt['attachment_limit_settings'] = 'Attachment Limit Settings'; $txt['attachment_limit_desc'] = 'Set member group specific attachment limits here. A member will be allowed the highest value given to the member groups they belong to. With 0 being unlimited. The default values from the attachment settings page are shown in italic. To reset to default, clear that field.'; $txt['attachmentPostGroupLimit'] = 'Max attachment
size per post in kb)'; $txt['attachmentSizeGroupLimit'] = 'Max size per
attachment in kb'; $txt['attachmentNumPerPostGroupLimit'] = 'Max number of
attachments per post'; // End Group Attachment Limits mod
Fatal error: Cannot redeclare ManageAttachmentLimits() (previously declared in /home/content/80/12433980/html/Sources/ManageAttachments.php:1840) in /home/content/80/12433980/html/Sources/ManageAttachments.php on line 2000



It is also at the top of my admin page. I am a novice at this, can you tell me what needs to be fixed.

Thanks,
Erik

Adrek

Open file ./Themes/default/languages/Admin.english.php, find and move ?> to the end of this file, save changes and it should be good.
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

TRR

Absolutely amazing two characters cause such an issue. Thank you for the quick reply.

-Erik

Kolya

Quote from: Kolya on January 20, 2014, 04:30:44 PM
When trying to do any search in the administration center I get the message:

An Error Has Occurred!
Unable to load the 'attachment_limits' template.

To fix this: In /Sources/Admin.php
Code (find) Select
array('ManageAttachmentLimits', 'area=manageattachments;sa=attachLimits'),
Code (replace) Select
//array('ManageAttachmentLimits', 'area=manageattachments;sa=attachLimits'),

That means this mod cannot be found by the admin area search, but since it breaks the search you can probably live with that.

Advertisement: