View Attachment Images But Still Disallow .ZIP Downloads
#1
This has annoyed me for as long as I can remember. You upload a new theme or plugin as a .zip package on your forum and you attach some screenshots to give your users or guests an idea of what you've just uploaded. But the MyBB attachment system also blocks access to image attachments if you don't have permission to access attachments.

This small edit will allow you to block access to .ZIP attachments but allow access to all other attachments (Images etc...)

Open "attachment.php" in your forum root.

Find:
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 ||
 ($forumpermissions['candlattachments'] == 0 && !$mybb->input['thumbnail']))
{
	error_no_permission();
}

Replace:
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 ||
 ($forumpermissions['candlattachments'] == 0 && !$mybb->input['thumbnail']
 && $attachment['filetype'] == "application/zip"))
{
	error_no_permission();
}
Reply
#2
Great tip, thank you (repp'd)
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved


Reply
#3
Your welcome !
Reply
#4
This user has been denied support. This user has been denied support.
Thanks so much Big Grin!
<snip>Smile<snip>
<snip - warez>
Reply
#5
how about pdf files, 3gp?
Reply
#6
(2012-11-04, 04:48 PM)harlenjoy Wrote: how about pdf files, 3gp?

Only .zip files are blocked. All other files are accessible. What do you want to do exactly ?
Reply
#7
my forum has a lot of pdf files, 3gp, zip, .docx. ,i would like also to disable the download for that. Smile
Reply
#8
So you want to allow images to be downloaded and everything else to be disallowed ?
Reply
#9
Yhup, Thats It Sir!
Reply
#10
Thats exactly what the edit does.

It allows you to access all file types, apart from .ZIP files. Only people allowed to download attachments can download .ZIP files. You can make other edits to allow or disallow different file types if you like.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)