- Joined
- Jun 22, 2019
- Messages
- 1,167
- Points
- 173
Reputation:
@micke and this your want.
use /admin.php?template-modifications/add&type=public
search:
replace:
use /admin.php?template-modifications/add&type=public
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>
Last edited:
- Joined
- Sep 27, 2020
- Messages
- 93
- Points
- 43
Reputation:
- By micke
@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>
↑View previous replies…
mickeI do not think that this is the correct variable
$resource.download_count
is the number how many times this file has been downloaded.
BattleKingI didn't get it to match the number of downloads.
mickeSorry what did you not get?
You mean to get the downloads left for the download period time?
BattleKingExactly, that’s why I asked how you limit the downloads.
mickeI understood that I don’t think the code will work for this purpose as you described.
If I am not wrong the code is for file download counts not for user-based criteria.
BattleKingthis code not use called [XenGenTr] RM Ekstra.
pic first post that move download counter to here.
BattleKingI'm using [XenGenTr] RM Extra 1.0.2
BattleKing
Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
- Joined
- May 24, 2020
- Messages
- 3,531
- Points
- 523
Reputation:
- By BattleKing
BattleKing
Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
- Joined
- May 24, 2020
- Messages
- 3,531
- Points
- 523
Reputation:
- By BattleKing
In Groups and permissions/User groups/Resource permissions
There is a plugin called [XenGenTr] RM Ekstra, using it you can set assume downloads.
Now thomsa answered before me..![]()
$resource.download_count
is the number how many times this file has been downloaded.
- Joined
- Sep 27, 2020
- Messages
- 93
- Points
- 43
Reputation:
- By micke
I do not think that this is the correct variable
$resource.download_count
is the number how many times this file has been downloaded.
BattleKing
Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
- Joined
- May 24, 2020
- Messages
- 3,531
- Points
- 523
Reputation:
- By BattleKing
I didn't get it to match the number of downloads.![]()
You mean to get the downloads left for the download period time?
- Joined
- Nov 25, 2022
- Messages
- 725
- Points
- 253
Reputation:
- By Zer01ne
I do not think that this is the correct variable
$resource.download_count
is the number how many times this file has been downloaded.
- Joined
- Sep 27, 2020
- Messages
- 93
- Points
- 43
Reputation:
- Joined
- Nov 25, 2022
- Messages
- 725
- Points
- 253
Reputation:
- By Zer01ne
Okay. If a member can download five files per day, the member has downloaded two files then I would like it to show how many downloads are left. If I understand you correctly.
If I am not wrong the code is for file download counts not for user-based criteria.
- Joined
- Sep 27, 2020
- Messages
- 93
- Points
- 43
Reputation:
- Joined
- Jun 22, 2019
- Messages
- 1,167
- Points
- 173
Reputation:
- By thomsa
I do not think that this is the correct variable
$resource.download_count
is the number how many times this file has been downloaded.
pic first post that move download counter to here.
BattleKing
Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
- Joined
- May 24, 2020
- Messages
- 3,531
- Points
- 523
Reputation:
- By BattleKing
- Joined
- Sep 27, 2020
- Messages
- 93
- Points
- 43
Reputation:
- By micke
@micke which limitation addon are you using?
Same question for all the others who has replied in that thread?