vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   attachment limit per usergroup (https://vborg.vbsupport.ru/showthread.php?t=68193)

ranger2kxlt 08-10-2004 03:45 PM

attachment limit per usergroup
 
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:
Code:

if ($attachcount >= $vboptions['attachlimit'] AND $vboptions['attachlimit'])
{
        $show['attachoption'] = false;
}

and BEFORE it, add this code:
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

Quote:

Originally Posted by ranger2kxlt
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)


All times are GMT. The time now is 07:36 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01147 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete