Reputation:
Does anyone know if there is a plugin for how many files the member has left to download.
See the picture
View attachment 35354
Or if anyone knows what that code is?
Thanks in advance!
Reputation:
you mean for resource manager or for attachments
Reputation:
For resource manager, i forgot to say that.
Reputation:
on which site is it please?
It looks like a small enhancement of an existing addon.
Reputation:
I suspected that. I haven't seen any addon that has that capability.
Reputation:
Which addon you are using to limit the downloads?
If you want I can add the information into the addon and do the modification?
On which site you have taken the screenshot?
Reputation:
Thanks, but I'll try to do it myself.
I asked the admin of that website (https://nullforums.net/home/) and he wrote like this: It's pretty easy to make. Start by dumping the vars from your template to admin-only groups and you can develop many things.
Reputation:
Does anyone know if there is a plugin for how many files the member has left to download.
See the picture
View attachment 35354
Or if anyone knows what that code is?
Thanks in advance!
<xf:button href="{{ link('resources/download', $resource) }}" target="_blank"
class="button--cta"
data-xf-click="{{ $resource.CurrentVersion.file_count > 1 ? 'overlay' : '' }}"
icon="download">{{ phrase('download') }}</xf:button>
<xf:set var="$attachment" value="{{ $resource.CurrentVersion.Attachments|first }}" />
<xf:button href="{{ link('resources/download', $resource) }}" target="_blank"
class="button--cta"
data-xf-click="{{ $resource.CurrentVersion.file_count > 1 ? 'overlay' : '' }}"
icon="download">{{ phrase('download') }} ({{ $attachment.getFileSize()|file_size }} /.{{ $attachment.getExtension() }})</xf:button>
Reputation:
Reputation:
add code
Reputation:
Just add a new template modification and enter the FIND content and the REPLACE content to it.
But this is not what he want, he want to see the number of downloads left.
Reputation:
Reputation:
<xf:button href="{{ link('resources/download', $resource) }}" target="_blank"
class="button--cta"
data-xf-click="{{ $resource.CurrentVersion.file_count > 1 ? 'overlay' : '' }}"
icon="download">{{ phrase('download') }}</xf:button>
<xf:set var="$attachment" value="{{ $resource.CurrentVersion.Attachments|first }}" />
<xf:button href="{{ link('resources/download', $resource) }}" target="_blank"
class="button--cta"
data-xf-click="{{ $resource.CurrentVersion.file_count > 1 ? 'overlay' : '' }}"
icon="download">{{ phrase('download') }} ({{ $attachment.getFileSize()|file_size }} /.{{ $attachment.getExtension() }})</xf:button><br />
<xf:if is="$resource.isDownloadable()">
<center>
downloads left: <font color=red>{$resource.download_count|number}</font>
</center>
</xf:if>
Reputation:
Reputation:
Reputation:
Reputation:
@micke and this your want.
View attachment 35418
use /admin.php?template-modifications/add&type=public
View attachment 35419
search:
HTML:<xf:button href="{{ link('resources/download', $resource) }}" target="_blank" class="button--cta" data-xf-click="{{ $resource.CurrentVersion.file_count > 1 ? 'overlay' : '' }}" icon="download">{{ phrase('download') }}</xf:button>
replace:
HTML:<xf:set var="$attachment" value="{{ $resource.CurrentVersion.Attachments|first }}" /> <xf:button href="{{ link('resources/download', $resource) }}" target="_blank" class="button--cta" data-xf-click="{{ $resource.CurrentVersion.file_count > 1 ? 'overlay' : '' }}" icon="download">{{ phrase('download') }} ({{ $attachment.getFileSize()|file_size }} /.{{ $attachment.getExtension() }})</xf:button><br /> <xf:if is="$resource.isDownloadable()"> <center> downloads left: <font color=red>{$resource.download_count|number}</font> </center> </xf:if>
Reputation:
Reputation:
@micke which limitation addon are you using?
Same question for all the others who has replied in that thread?