PDA

View Full Version : attachment limit per usergroup


ranger2kxlt
08-10-2004, 03:45 PM
just as the title states, is this out or can this be made?

Would like the admins on my site to be able to add more attachments per post then members.

Thanks

CarCdr
08-10-2004, 04:14 PM
The maximum number of attachments per post is a site-wide number, as I am sure you know.

To conditionalize it on usergroups, such that a special usergroup was allowed X attachments while everyone else got the AdminCP site-wide limit, would require you to change the script newattachment.php.

In vb 3 and variants, find this code:if ($attachcount >= $vboptions['attachlimit'] AND $vboptions['attachlimit'])
{
$show['attachoption'] = false;
}
and BEFORE it, add this code:
if (is_member_of($bbuserinfo, '6')) {
$vboptions['attachlimit'] = 8;
}

This checks that the current user's primary or seconday usergroups, includes the privileged group '6'. Change this to whatever usergroup you are trying to give this special access to. If the user is a member, then rather than the AdminCP value, the user is allowed as many as 8 attachments.

ranger2kxlt
08-10-2004, 05:47 PM
just tried it...i tried to up more then 3(thats what my board is set at) and i get this message:

You may only attach up to 3 files per post

:-/

ranger2kxlt
08-10-2004, 08:17 PM
Anyone else have input on this?

ranger2kxlt
08-11-2004, 06:30 PM
Any help?

ranger2kxlt
08-16-2004, 05:09 PM
Still looking for this

ranger2kxlt
08-17-2004, 03:09 PM
still no one huh?

ranger2kxlt
08-18-2004, 03:47 PM
bump still would like this feature!

ranger2kxlt
08-31-2004, 01:14 PM
Anyone have ANY clue?

CarCdr
08-31-2004, 01:34 PM
Actually, I see now that one needs to make the change I suggested at the top of the script. In newattachment.php, around line 50, you'll find this:

if (!$bbuserinfo['userid']) // Guests can not post attachments
{
print_no_permission();
}

AFTER this code, add the code I suggested:

if (is_member_of($bbuserinfo, '6')) {
$vboptions['attachlimit'] = 8;
}

using the usergroup you need (I used '6' here) and the attachment limit you want (I used 8).

ranger2kxlt
08-31-2004, 04:54 PM
CarCdr, YES!!!! thanks so much!!! ok one more thing maybe you can help with....i have my members set to only 3 per post....but i want admins and mods to have more...is there a way we can add more browse boxes for the admins and mods who are allowed to upload then three at a time? catch my drift?

thanks alot for the help!

CarCdr
08-31-2004, 08:55 PM
CarCdr, YES!!!! thanks so much!!! ok one more thing maybe you can help with....i have my members set to only 3 per post....but i want admins and mods to have more...is there a way we can add more browse boxes for the admins and mods who are allowed to upload then three at a time? catch my drift?

thanks alot for the help!
The number of input boxes to show is controlled by an AdminCP option named "Attachment Inputs". Look in AdminCP>vBulletin Options and you should see a group named "Message Attachment Options". You could set "Attachment Inputs" to a high number like 8 for everyone to see. The actual number allowed will still be controlled by the mod previously provided.

This is the easiest thing to do, but it is not that nice. To change the appearance for usergroups 6 and 7 (for example) to, say, 8 input boxes, put this at the top of the file just after or before the previous mod:

if (is_member_of($bbuserinfo, '8') OR is_member_of($bbuserinfo, '9')) {
$vboptions['attachboxcount'] = 8;
}

ranger2kxlt
09-01-2004, 12:33 AM
Perfect CarCdr, thanks alot for the help, thats all i needed :-D

Arrangements
10-07-2007, 03:30 PM
Is this modification compatible with 3.6.x (preferably 3.6.8)