DragonByte Tech
Well-known member
Currently, the
I do understand that changing the signature could introduce backwards compatibility breaking, so perhaps an appropriate change would be to change the relevant block of
It would be an empty method in the base version, but it would be immensely helpful.
Use case: Our Credits add-on wants to be able to use the file size as a multiplier for the event that triggers on resource download. For instance, you could set up an event that paid the resource author 1 credits for every download, and an additional 0.001 credits for every byte in their attachment.
Fillip
XFRM:ResourceVersion
:: logDownload
does not pass the $attachment
parameter, making it very difficult to determine exactly which attachment is being downloaded.I do understand that changing the signature could introduce backwards compatibility breaking, so perhaps an appropriate change would be to change the relevant block of
/src/addons/XFRM/Pub/Controller/ResourceVersion.php
to this:
PHP:
if ($version->download_url)
{
return $this->redirectPermanently($version->download_url);
}
else
{
$this->repository('XFRM:ResourceVersion')->logAttachmentDownload($version, $attachment);
/** @var \XF\ControllerPlugin\Attachment $attachPlugin */
$attachPlugin = $this->plugin('XF:Attachment');
return $attachPlugin->displayAttachment($attachment);
}
Use case: Our Credits add-on wants to be able to use the file size as a multiplier for the event that triggers on resource download. For instance, you could set up an event that paid the resource author 1 credits for every download, and an additional 0.001 credits for every byte in their attachment.
Fillip
Upvote
0