• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
[TH] Add Username To Attachment

[TH] Add Username To Attachment 1.0.0

No permission to download

Jon W

Well-known member
#1
Waindigo submitted a new resource:

Add Username To Attachment by Waindigo (version 1.0.0) - Prepend an attachment with the user's name when they download if they are in a specified user group.

Description:

Prepends any attachment downloaded with that user's name. This option can be enabled for specific user groups as selected on the add-on's options screen.

This add-on could be useful for a site where users are encouraged to edit whatever they download (a Word document, for example) and re-upload it, or for a variety of other reasons.

Installation:
  • Upload contents of upload folder to root directory, overwriting any existing files....
Read more about this resource...
 

faeronsayn

Well-known member
#2
This is a great resource, I was wondering how easy it would be to customize this to make it have your site's name appended to the attachment's name.
 

Jon W

Well-known member
#3
This is a great resource, I was wondering how easy it would be to customize this to make it have your site's name appended to the attachment's name.
Very easy.

In the file library/Waindigo/AddUserToAttach/ControllerPublic/Attachment.php, replace line 30:
PHP:
$response->params['attachment']['filename'] = '['.$visitor['username'].']'.$response->params['attachment']['filename'];
with:
PHP:
$response->params['attachment']['filename'] = '['.$xenOptions->boardTitle.']'.$response->params['attachment']['filename'];