Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 06 Feb 2011, 21:39
MultiSync77F MultiSync77F is offline
 
Join Date: Mar 2005
Need help modifying attachment permissions

Hi,

I have limited space on my shared server so I do not want users attaching many images/attachments to a post. So I have "Attachments Per Post" in the ACP limited to 3 attachments.

I figure if they need more then 3 attachments per post, they can put them all in a ZIP file.

However, because of the way vBulletin works. My Admin account is now limited to 3 attachments per article. My articles usually have multiple diagrams included in them.

I'm not sure why Admins are not exempt from the attachment limit, but they aren't. So I need to figure out how to keep this Attachments Per Post setting at 3, and yet allow my admin account to have multiple attachments.

I have an understand of PHP but I'm not an expert. I've been looking and I believe that I need to modify the newattachment.php file to ignore that Attachments Per Post setting if the current user is in the Admin usergroup.

By playing with this it seems that the only enforcement of this rule is in that file, when the person clicks the "upload" button to upload a new attachment.

If I set the Attachments Per Post to 15, and upload 15 attachments to an article, then reset the Attachments Per Post to 3. The article loads fine even though it has more attachments then are currently allowed. So it appears the only enforcement is when you click that upload button.

Does anyone know how to modify this to exempt the admin usergroup?
Reply With Quote
  #2  
Old 05 Sep 2011, 23:02
inphoenix inphoenix is offline
 
Join Date: Sep 2011
I would like to know this as well. There should be way to expempt Admins or moderators from this limit or set a different limit for them.
Reply With Quote
  #3  
Old 05 Sep 2011, 23:46
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
You could create a plugin using hook location global_bootstrap_init_start and this code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #4  
Old 06 Sep 2011, 01:48
inphoenix inphoenix is offline
 
Join Date: Sep 2011
Thanks for your help. I am very new to vBulletin. Would you mind explaining it in more details please?
Reply With Quote
  #5  
Old 08 Sep 2011, 05:10
inphoenix inphoenix is offline
 
Join Date: Sep 2011
Anyone?

Your help would be appreciated.
Reply With Quote
  #6  
Old 08 Sep 2011, 12:47
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Sorry, I missed your reply. To create a plugin:

- In the adminCP, click on "Plugins & Products" then "Add New Plugin".

- From the "Hook Location" drop-down menu, choose global_bootstrap_init_start

- Enter a title (something so that in the future you'll remember what this plugin does)

- For "Plugin PHP Code", copy and paste the code I posted above.

- Click the "Yes" radio button next to "Plugin is Active", and press "Save".


If you later want to disable or delete this plugin, you can use the Plugin Manager. Your plugin will be listed in the "Product: vbulletin" section, and you can edit, disable, or delete it from there.
Reply With Quote
  #7  
Old 08 Sep 2011, 15:10
inphoenix inphoenix is offline
 
Join Date: Sep 2011
Thank you so much for helping me out. Much appreciated.
Reply With Quote
  #8  
Old 03 Oct 2012, 05:52
Warriorwithwood Warriorwithwood is offline
 
Join Date: Feb 2012
Is there any way to adapt this so admins and mods have no file size limitations on attachments?
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 02:20.

Layout Options | Width: Wide Color: