Customizing SMF > Now Available

Attachment Download Permission

(1/3) > >>

Bounda:
When i allowed guests to view downloads, they were allowed to download them too. When i used to be on 1.0.7 it would only let them view the download, if they clicked it they were redirected to a login page. I want to be able to do this on 1.1RC2, and its really been annoying me. If i knew what file to look in, i could try to do it myself, but i have absolutely no knowledge of php. Just a quick overview.

What i want:

Guests view attachments, but when clicked, redirected to a login page.

What 1.1RC2 Has

Guests view attachments, and can download them if View Attachments is enabled through permissions. I want them to see them, but be redirected to a login page like i said before.

Please Reply Back
~Bounda

EDIT:  This is now a mod
http://mods.simplemachines.org/index.php?mod=406

JayBachatero:
Ok this should work.

In Display.php

--- Code: (find) --- if (!empty($modSettings['attachmentEnable']) && allowedTo('view_attachments'))

--- End code ---
Replace

--- Code: (replace) --- if (!empty($modSettings['attachmentEnable']) && (allowedTo('view_attachments') || allowedTo('view_attachments2')))

--- End code ---

In ManagePermissions.php

--- Code: (find) --- 'attachment' => array(
'view_attachments' => false,
'post_attachment' => false,
)

--- End code ---
Replace

--- Code: (replace) --- 'attachment' => array(
'view_attachments' => false,
'view_attachments2' => false,
'post_attachment' => false,
)

--- End code ---

In ManagePermissions.english.php

--- Code: (find) ---$txt['permissionname_view_attachments'] = 'View attachments';
$txt['permissionhelp_view_attachments'] = 'Attachments are files that are attached to posted messages. This feature can be enabled and configured in \'Edit Features and Options\'. Since attachments are not directly accessed, you can protect them from being downloaded by users that don\'t have this permission.';

--- End code ---
Replace

--- Code: (replace) ---$txt['permissionname_view_attachments'] = 'Download attachments';
$txt['permissionhelp_view_attachments'] = 'Download Attachments';
$txt['permissionname_view_attachments2'] = 'View attachments';
$txt['permissionhelp_view_attachments2'] = 'Attachments are files that are attached to posted messages. This feature can be enabled and configured in \'Edit Features and Options\'. Since attachments are not directly accessed, you can protect them from being downloaded by users that don\'t have this permission.';

--- End code ---

Bounda:
im working on it right now, and if it does then i love u =D ill edit this post when finished
/edit  :'( everything else worked but when i entered the forum, i got this

Parse error: syntax error, unexpected '{' in /home/bnews/public_html/Sources/Display.php on line 716

is it because im using tinyportal?

JayBachatero:
Sorry I missed a ) in the Display.php changes.

Change
(allowedTo('view_attachments') || allowedTo('view_attachments2'))
to
(allowedTo('view_attachments') || allowedTo('view_attachments2')))

Bounda:
I love u monkey  :-* lol =D it works =D

Navigation

[0] Message Index

[#] Next page

Go to full version