Disable ads on cheapest tier
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
Supporter level {{.User.Subscription.Name}}
|
||||
<ul>
|
||||
<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}}
|
||||
<li>Files expire after {{.User.Subscription.FileExpiryDays}} days</li>
|
||||
{{else}}
|
||||
|
@@ -118,49 +118,53 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if .Other.ShowAds}}
|
||||
<div id="sponsors" class="sponsors">
|
||||
{{if eq .Other.AdType 0}}
|
||||
<!-- scrolling="no" is not allowed by the W3C, but overflow: hidden doesn't work in chrome, so I have no choice -->
|
||||
<iframe class="sponsors_banner"
|
||||
data-aa="73974"
|
||||
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}}"
|
||||
style="width:728px; height:90px; border:none; padding:0; overflow:hidden;"
|
||||
scrolling="no">
|
||||
</iframe>
|
||||
{{else if eq .Other.AdType 1}}
|
||||
<a class="sponsors_banner" style="display: inline-block; width: 576px; height: 96px;" href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarula-electronics.com">
|
||||
<img src="/res/img/misc/banner_as.png" style="width: 100%; height: 100%" />
|
||||
</a>
|
||||
{{else if eq .Other.AdType 2}}
|
||||
<div style="text-align: center; line-height: 22px; font-size: 18px;">
|
||||
<div style="margin: 4px 8px; display: inline-block; vertical-align: middle;">
|
||||
Pixeldrain needs money to survive<br/>
|
||||
<a href="/click/7wy9gg2J?target=%2Fsubscribe" class="button button_highlight">
|
||||
Support me on Patreon and get some neat perks
|
||||
</a>
|
||||
</div>
|
||||
<div style="margin: 4px 8px; display: inline-block; vertical-align: middle; text-align: left;">
|
||||
No ads when viewing files<br/>
|
||||
No ads on your uploaded files<br/>
|
||||
Longer file retention<br/>
|
||||
</div>
|
||||
<div>
|
||||
{{else if eq .Other.AdType 3}}
|
||||
<a class="sponsors_banner" style="display: inline-block; width: 842px; height: 125px;" href="/click/RJRbh7Tn?target=https%3A%2F%2Fsoulstudio.nl%2Fonline-y">
|
||||
<img src="/res/img/misc/banner_soul_studio.png" style="width: 100%; height: 100%" />
|
||||
</a>
|
||||
{{else if eq .Other.AdType 4}}
|
||||
<a class="sponsors_banner" style="display: inline-block; width: 576px; height: 96px;" href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarulasolutions.com">
|
||||
<img src="/res/img/misc/banner_amarulasolutions.png" style="width: 100%; height: 100%" />
|
||||
</a>
|
||||
{{ else if eq .Other.AdType 6}}
|
||||
<div id="348416176"></div>
|
||||
{{ 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>
|
||||
{{if .Other.ShowAds}}
|
||||
{{if eq .Other.AdType 0}}
|
||||
<!-- scrolling="no" is not allowed by the W3C, but overflow: hidden doesn't work in chrome, so I have no choice -->
|
||||
<iframe class="sponsors_banner"
|
||||
data-aa="73974"
|
||||
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}}"
|
||||
style="width:728px; height:90px; border:none; padding:0; overflow:hidden;"
|
||||
scrolling="no">
|
||||
</iframe>
|
||||
{{else if eq .Other.AdType 1}}
|
||||
<a class="sponsors_banner" style="display: inline-block; width: 576px; height: 96px;" href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarula-electronics.com">
|
||||
<img src="/res/img/misc/banner_as.png" style="width: 100%; height: 100%" />
|
||||
</a>
|
||||
{{else if eq .Other.AdType 2}}
|
||||
<div style="text-align: center; line-height: 22px; font-size: 18px;">
|
||||
<div style="margin: 4px 8px; display: inline-block; vertical-align: middle;">
|
||||
Pixeldrain needs money to survive<br/>
|
||||
<a href="/click/7wy9gg2J?target=%2Fsubscribe" class="button button_highlight">
|
||||
Support me on Patreon and get some neat perks
|
||||
</a>
|
||||
</div>
|
||||
<div style="margin: 4px 8px; display: inline-block; vertical-align: middle; text-align: left;">
|
||||
No ads when viewing files<br/>
|
||||
No ads on your uploaded files<br/>
|
||||
Longer file retention<br/>
|
||||
</div>
|
||||
<div>
|
||||
{{else if eq .Other.AdType 3}}
|
||||
<a class="sponsors_banner" style="display: inline-block; width: 842px; height: 125px;" href="/click/RJRbh7Tn?target=https%3A%2F%2Fsoulstudio.nl%2Fonline-y">
|
||||
<img src="/res/img/misc/banner_soul_studio.png" style="width: 100%; height: 100%" />
|
||||
</a>
|
||||
{{else if eq .Other.AdType 4}}
|
||||
<a class="sponsors_banner" style="display: inline-block; width: 576px; height: 96px;" href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarulasolutions.com">
|
||||
<img src="/res/img/misc/banner_amarulasolutions.png" style="width: 100%; height: 100%" />
|
||||
</a>
|
||||
{{ else if eq .Other.AdType 6}}
|
||||
<div id="348416176"></div>
|
||||
{{ 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}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<template id="tpl_details_popup">
|
||||
|
@@ -217,10 +217,10 @@
|
||||
<div class="price">€0 per month</div>
|
||||
<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">
|
||||
Files expire 30 days after last view
|
||||
</a>
|
||||
<div class="feature">No account required</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">Group multiple files together in a single link with lists</div>
|
||||
@@ -230,10 +230,12 @@
|
||||
<div class="price">€2 per month + tax</div>
|
||||
<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">
|
||||
Files expire 2 months after last view
|
||||
</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">
|
||||
3 TB of direct linking bandwidth
|
||||
</a>-->
|
||||
@@ -253,14 +255,15 @@
|
||||
<div class="price">€4 per month + tax</div>
|
||||
<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">
|
||||
Files expire 3 months after last view
|
||||
</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">
|
||||
6 TB of direct linking bandwidth
|
||||
</a>-->
|
||||
<div class="feature">No ads on files you uploaded</div>
|
||||
|
||||
<div style="text-align: center; padding: 8px;">
|
||||
{{if eq .User.Subscription.ID "patreon_5"}}
|
||||
@@ -277,14 +280,15 @@
|
||||
<div class="price">€8 per month + tax</div>
|
||||
<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">
|
||||
Files expire 4 months after last view
|
||||
</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">
|
||||
12 TB of direct linking bandwidth
|
||||
</a>-->
|
||||
<div class="feature">No ads on files you uploaded</div>
|
||||
|
||||
<div style="text-align: center; padding: 8px;">
|
||||
{{if eq .User.Subscription.ID "patreon_2"}}
|
||||
@@ -301,14 +305,15 @@
|
||||
<div class="price">€16 per month + tax</div>
|
||||
<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">
|
||||
Files expire 8 months after last view
|
||||
</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">
|
||||
24 TB of direct linking bandwidth
|
||||
</a>-->
|
||||
<div class="feature">No ads on files you uploaded</div>
|
||||
|
||||
<div style="text-align: center; padding: 8px;">
|
||||
{{if eq .User.Subscription.ID "patreon_3"}}
|
||||
@@ -325,14 +330,15 @@
|
||||
<div class="price">€32 per month + tax</div>
|
||||
<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">
|
||||
Files you upload never expire
|
||||
</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">
|
||||
48 TB of direct linking bandwidth
|
||||
</a>-->
|
||||
<div class="feature">No ads on files you uploaded</div>
|
||||
|
||||
<div style="text-align: center; padding: 8px;">
|
||||
{{if eq .User.Subscription.ID "patreon_4"}}
|
||||
|
@@ -107,7 +107,8 @@ func (wc *WebController) serveFileViewer(w http.ResponseWriter, r *http.Request,
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user