Disable ads on cheapest tier

This commit is contained in:
2020-10-27 10:32:28 +01:00
parent bc496c3998
commit e102c55667
4 changed files with 63 additions and 52 deletions

View File

@@ -25,7 +25,7 @@
Supporter level {{.User.Subscription.Name}} Supporter level {{.User.Subscription.Name}}
<ul> <ul>
<li>Ads when viewing files: {{if .User.Subscription.DisableAdDisplay}}No{{else}}Yes{{end}}</li> <li>Ads when viewing files: {{if .User.Subscription.DisableAdDisplay}}No{{else}}Yes{{end}}</li>
<li>Ads on uploaded files: {{if .User.Subscription.DisableAdsOnFiles}}No{{else}}Yes{{end}}</li> <li>Ads on your uploaded files: {{if .User.Subscription.DisableAdsOnFiles}}No{{else}}Yes{{end}}</li>
{{if gt .User.Subscription.FileExpiryDays 0}} {{if gt .User.Subscription.FileExpiryDays 0}}
<li>Files expire after {{.User.Subscription.FileExpiryDays}} days</li> <li>Files expire after {{.User.Subscription.FileExpiryDays}} days</li>
{{else}} {{else}}

View File

@@ -118,49 +118,53 @@
</div> </div>
</div> </div>
{{if .Other.ShowAds}}
<div id="sponsors" class="sponsors"> <div id="sponsors" class="sponsors">
{{if eq .Other.AdType 0}} {{if .Other.ShowAds}}
<!-- scrolling="no" is not allowed by the W3C, but overflow: hidden doesn't work in chrome, so I have no choice --> {{if eq .Other.AdType 0}}
<iframe class="sponsors_banner" <!-- scrolling="no" is not allowed by the W3C, but overflow: hidden doesn't work in chrome, so I have no choice -->
data-aa="73974" <iframe class="sponsors_banner"
src="//ad.a-ads.com/73974?size=728x90&background_color={{.Style.Layer1Color.RGB}}&text_color={{.Style.TextColor.RGB}}&title_color={{.Style.HighlightColor.RGB}}&title_hover_color={{.Style.HighlightColor.RGB}}&link_color={{.Style.HighlightColor.RGB}}&link_hover_color={{.Style.HighlightColor.RGB}}" data-aa="73974"
style="width:728px; height:90px; border:none; padding:0; overflow:hidden;" src="//ad.a-ads.com/73974?size=728x90&background_color={{.Style.Layer1Color.RGB}}&text_color={{.Style.TextColor.RGB}}&title_color={{.Style.HighlightColor.RGB}}&title_hover_color={{.Style.HighlightColor.RGB}}&link_color={{.Style.HighlightColor.RGB}}&link_hover_color={{.Style.HighlightColor.RGB}}"
scrolling="no"> style="width:728px; height:90px; border:none; padding:0; overflow:hidden;"
</iframe> scrolling="no">
{{else if eq .Other.AdType 1}} </iframe>
<a class="sponsors_banner" style="display: inline-block; width: 576px; height: 96px;" href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarula-electronics.com"> {{else if eq .Other.AdType 1}}
<img src="/res/img/misc/banner_as.png" style="width: 100%; height: 100%" /> <a class="sponsors_banner" style="display: inline-block; width: 576px; height: 96px;" href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarula-electronics.com">
</a> <img src="/res/img/misc/banner_as.png" style="width: 100%; height: 100%" />
{{else if eq .Other.AdType 2}} </a>
<div style="text-align: center; line-height: 22px; font-size: 18px;"> {{else if eq .Other.AdType 2}}
<div style="margin: 4px 8px; display: inline-block; vertical-align: middle;"> <div style="text-align: center; line-height: 22px; font-size: 18px;">
Pixeldrain needs money to survive<br/> <div style="margin: 4px 8px; display: inline-block; vertical-align: middle;">
<a href="/click/7wy9gg2J?target=%2Fsubscribe" class="button button_highlight"> Pixeldrain needs money to survive<br/>
Support me on Patreon and get some neat perks <a href="/click/7wy9gg2J?target=%2Fsubscribe" class="button button_highlight">
</a> Support me on Patreon and get some neat perks
</div> </a>
<div style="margin: 4px 8px; display: inline-block; vertical-align: middle; text-align: left;"> </div>
No ads when viewing files<br/> <div style="margin: 4px 8px; display: inline-block; vertical-align: middle; text-align: left;">
No ads on your uploaded files<br/> No ads when viewing files<br/>
Longer file retention<br/> No ads on your uploaded files<br/>
</div> Longer file retention<br/>
<div> </div>
{{else if eq .Other.AdType 3}} <div>
<a class="sponsors_banner" style="display: inline-block; width: 842px; height: 125px;" href="/click/RJRbh7Tn?target=https%3A%2F%2Fsoulstudio.nl%2Fonline-y"> {{else if eq .Other.AdType 3}}
<img src="/res/img/misc/banner_soul_studio.png" style="width: 100%; height: 100%" /> <a class="sponsors_banner" style="display: inline-block; width: 842px; height: 125px;" href="/click/RJRbh7Tn?target=https%3A%2F%2Fsoulstudio.nl%2Fonline-y">
</a> <img src="/res/img/misc/banner_soul_studio.png" style="width: 100%; height: 100%" />
{{else if eq .Other.AdType 4}} </a>
<a class="sponsors_banner" style="display: inline-block; width: 576px; height: 96px;" href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarulasolutions.com"> {{else if eq .Other.AdType 4}}
<img src="/res/img/misc/banner_amarulasolutions.png" style="width: 100%; height: 100%" /> <a class="sponsors_banner" style="display: inline-block; width: 576px; height: 96px;" href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarulasolutions.com">
</a> <img src="/res/img/misc/banner_amarulasolutions.png" style="width: 100%; height: 100%" />
{{ else if eq .Other.AdType 6}} </a>
<div id="348416176"></div> {{ else if eq .Other.AdType 6}}
{{ else if eq .Other.AdType 7}} <div id="348416176"></div>
<iframe class="sponsors_banner" src="/ad/revenuehits" style="width:728px; height:90px; border:none; padding:0; overflow:hidden;" scrolling="no"></iframe> {{ else if eq .Other.AdType 7}}
<iframe class="sponsors_banner" src="/ad/revenuehits" style="width:728px; height:90px; border:none; padding:0; overflow:hidden;" scrolling="no"></iframe>
{{end}}
{{ else }}
<div style="text-align: center; line-height: 1.5em; font-size: 14px;">
The uploader of this file disabled advertisements. You can do the same for <a href="/subscribe">only €2 per month</a>!
</div>
{{end}} {{end}}
</div> </div>
{{end}}
</div> </div>
<template id="tpl_details_popup"> <template id="tpl_details_popup">

View File

@@ -217,10 +217,10 @@
<div class="price">€0 per month</div> <div class="price">€0 per month</div>
<img src="/res/img/benefit_0_small.png" style="width: 100%;"> <img src="/res/img/benefit_0_small.png" style="width: 100%;">
<div class="feature">No account required</div>
<a href="#" onclick="return explainFileExpiry()" class="feature"> <a href="#" onclick="return explainFileExpiry()" class="feature">
Files expire 30 days after last view Files expire 30 days after last view
</a> </a>
<div class="feature">No account required</div>
<div class="feature">Max file size 10 GB</div> <div class="feature">Max file size 10 GB</div>
<div class="feature">Access your files anywhere with a pixeldrain account</div> <div class="feature">Access your files anywhere with a pixeldrain account</div>
<div class="feature">Group multiple files together in a single link with lists</div> <div class="feature">Group multiple files together in a single link with lists</div>
@@ -230,10 +230,12 @@
<div class="price">€2 per month + tax</div> <div class="price">€2 per month + tax</div>
<img src="/res/img/benefit_1_small.png" style="width: 100%;"> <img src="/res/img/benefit_1_small.png" style="width: 100%;">
<div class="feature">No ads when viewing files</div>
<a href="#" onclick="return explainFileExpiry()" class="feature"> <a href="#" onclick="return explainFileExpiry()" class="feature">
Files expire 2 months after last view Files expire 2 months after last view
</a> </a>
<div class="feature">No ads when viewing files</div>
<div class="feature">No ads on files you uploaded</div>
<!--<a href="#" onclick="return explainDirectLinking()" class="feature"> <!--<a href="#" onclick="return explainDirectLinking()" class="feature">
3 TB of direct linking bandwidth 3 TB of direct linking bandwidth
</a>--> </a>-->
@@ -253,14 +255,15 @@
<div class="price">€4 per month + tax</div> <div class="price">€4 per month + tax</div>
<img src="/res/img/benefit_5_small.png" style="width: 100%;"> <img src="/res/img/benefit_5_small.png" style="width: 100%;">
<div class="feature">No ads when viewing files</div>
<a href="#" onclick="return explainFileExpiry()" class="feature"> <a href="#" onclick="return explainFileExpiry()" class="feature">
Files expire 3 months after last view Files expire 3 months after last view
</a> </a>
<div class="feature">No ads when viewing files</div>
<div class="feature">No ads on files you uploaded</div>
<!--<a href="#" onclick="return explainDirectLinking()" class="feature"> <!--<a href="#" onclick="return explainDirectLinking()" class="feature">
6 TB of direct linking bandwidth 6 TB of direct linking bandwidth
</a>--> </a>-->
<div class="feature">No ads on files you uploaded</div>
<div style="text-align: center; padding: 8px;"> <div style="text-align: center; padding: 8px;">
{{if eq .User.Subscription.ID "patreon_5"}} {{if eq .User.Subscription.ID "patreon_5"}}
@@ -277,14 +280,15 @@
<div class="price">€8 per month + tax</div> <div class="price">€8 per month + tax</div>
<img src="/res/img/benefit_2_small.png" style="width: 100%;"> <img src="/res/img/benefit_2_small.png" style="width: 100%;">
<div class="feature">No ads when viewing files</div>
<a href="#" onclick="return explainFileExpiry()" class="feature"> <a href="#" onclick="return explainFileExpiry()" class="feature">
Files expire 4 months after last view Files expire 4 months after last view
</a> </a>
<div class="feature">No ads when viewing files</div>
<div class="feature">No ads on files you uploaded</div>
<!--<a href="#" onclick="return explainDirectLinking()" class="feature"> <!--<a href="#" onclick="return explainDirectLinking()" class="feature">
12 TB of direct linking bandwidth 12 TB of direct linking bandwidth
</a>--> </a>-->
<div class="feature">No ads on files you uploaded</div>
<div style="text-align: center; padding: 8px;"> <div style="text-align: center; padding: 8px;">
{{if eq .User.Subscription.ID "patreon_2"}} {{if eq .User.Subscription.ID "patreon_2"}}
@@ -301,14 +305,15 @@
<div class="price">€16 per month + tax</div> <div class="price">€16 per month + tax</div>
<img src="/res/img/benefit_3_small.png" style="width: 100%;"> <img src="/res/img/benefit_3_small.png" style="width: 100%;">
<div class="feature">No ads when viewing files</div>
<a href="#" onclick="return explainFileExpiry()" class="feature"> <a href="#" onclick="return explainFileExpiry()" class="feature">
Files expire 8 months after last view Files expire 8 months after last view
</a> </a>
<div class="feature">No ads when viewing files</div>
<div class="feature">No ads on files you uploaded</div>
<!--<a href="#" onclick="return explainDirectLinking()" class="feature"> <!--<a href="#" onclick="return explainDirectLinking()" class="feature">
24 TB of direct linking bandwidth 24 TB of direct linking bandwidth
</a>--> </a>-->
<div class="feature">No ads on files you uploaded</div>
<div style="text-align: center; padding: 8px;"> <div style="text-align: center; padding: 8px;">
{{if eq .User.Subscription.ID "patreon_3"}} {{if eq .User.Subscription.ID "patreon_3"}}
@@ -325,14 +330,15 @@
<div class="price">€32 per month + tax</div> <div class="price">€32 per month + tax</div>
<img src="/res/img/benefit_4_small.png" style="width: 100%;"> <img src="/res/img/benefit_4_small.png" style="width: 100%;">
<div class="feature">No ads when viewing files</div>
<a href="#" onclick="return explainFileExpiry()" class="feature"> <a href="#" onclick="return explainFileExpiry()" class="feature">
Files you upload never expire Files you upload never expire
</a> </a>
<div class="feature">No ads when viewing files</div>
<div class="feature">No ads on files you uploaded</div>
<!--<a href="#" onclick="return explainDirectLinking()" class="feature"> <!--<a href="#" onclick="return explainDirectLinking()" class="feature">
48 TB of direct linking bandwidth 48 TB of direct linking bandwidth
</a>--> </a>-->
<div class="feature">No ads on files you uploaded</div>
<div style="text-align: center; padding: 8px;"> <div style="text-align: center; padding: 8px;">
{{if eq .User.Subscription.ID "patreon_4"}} {{if eq .User.Subscription.ID "patreon_4"}}

View File

@@ -107,7 +107,8 @@ func (wc *WebController) serveFileViewer(w http.ResponseWriter, r *http.Request,
} }
showAds := true showAds := true
if (templateData.Authenticated && templateData.User.Subscription.DisableAdDisplay) || finfo[0].ShowAds == false { if finfo[0].ShowAds == false ||
(templateData.Authenticated && templateData.User.Subscription.DisableAdDisplay) {
showAds = false showAds = false
} }