MyBB Community Forums

Full Version: Permit display of uploaded images for selected users
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
It is a common request. The point - was that by making the simple code edits you could allow guests to view images. I must admit I am a bit baffled by what the issue is. Do you have guests allowed to view attachments?
Lee, my apologies for being a bit dense about this, BUT;

under each forum's permissions there is no permission setting I see to allow/disallow guests from viewing attachments. But there IS a 'can download attachments' setting.

Checking that permits viewing (*downloading*) of the uploaded images by guests.

I suppose that by accessing the image to view it, a guest is downloading it...Rolleyes

Thanks again for your patience.
Right, I think that the idea was that you allow guests to "download attachments" - images are attachments - but nothing else.

This code edit from OMar would do that

if(!$forumpermissions['canview'] || !$forumpermissions['canviewthreads'] || (!$forumpermissions['candlattachments'] && !$mybb->input['thumbnail'] && !in_array($attachment['filetype'], array('image/gif', 'image/bmp', 'image/png', 'image/jpeg', 'image/unknown'))))
{
    error_no_permission();
} 

What that does is it allows all guest users to download IMAGE attachments. No others. You have to edit the core file like Frank says in his first post.

http://community.mybb.com/thread-128763-...#pid933116
I understand, Lee.
As I mentioned a couple posts ago:
"yes, those code mods do permit access to the link in the post for an uploaded image: a user not logged-in can click on the link to see the image in a new browser tab. (one version EXCLUDES specified filetypes from access to unregistered users; the other excludes all filetypes NOT specified)"

In other words, I had tested and applied those mods, and found they worked...but only to permit viewing in a SEPARATE tab, not as embedded images in the post.
What did not click with my li'l brain was that the term "downloading" (in the Admin Forum Permissions) = "viewing".

I'll mark this one "solved", thanks again!
Pages: 1 2