[TH] Add Username To Attachment [Deleted]

Jon W

Well-known member
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...
 
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.
 
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'];
 
Top Bottom