Update ads
This commit is contained in:
@@ -81,22 +81,18 @@
|
|||||||
|
|
||||||
{{ if and .Other.FileAdsEnabled .Other.UserAdsEnabled }}
|
{{ if and .Other.FileAdsEnabled .Other.UserAdsEnabled }}
|
||||||
<hr/>
|
<hr/>
|
||||||
<!-- <div id="brave_ref" style="text-align: center; padding: 2px;"> -->
|
<div style="text-align: center; line-height: 1.4em">
|
||||||
{{if ne (isBrave .UserAgent) true}}
|
<!-- scrolling="no" is not allowed by the W3C, but overflow: hidden doesn't work in chrome, so I have no choice -->
|
||||||
Use the Brave web browser for a faster and safer web!<br/>
|
<iframe
|
||||||
<a href="https://brave.com/pix009" id="btnBrave" class="button toolbar_button button_full_width button_highlight">
|
data-aa="73974"
|
||||||
<img src="{{template `brave_lion.png`}}" alt="Brave lion"/>
|
src="//ad.a-ads.com/73974?size=120x600&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}}"
|
||||||
<span>Get Brave</span>
|
style="width:120px; height:600px; border:none; padding:0; overflow:hidden;"
|
||||||
</a>
|
scrolling="no">
|
||||||
|
</iframe>
|
||||||
<br/>
|
<br/>
|
||||||
or <a href="/brave">learn why pixeldrain supports Brave</a>
|
<a href="https://a-ads.com/campaigns/new?selected_ad_unit_id=73974&selected_source_type=ad_unit&partner=73974">Put your own advertisement here</a>
|
||||||
{{else}}
|
</div>
|
||||||
Thank you for using Brave! Please consider supporting pixeldrain with a tip
|
{{ end }}
|
||||||
<img src="{{template `bat_logo_color.png`}}" style="height: 1em; width: 1em;" />
|
|
||||||
{{end}}
|
|
||||||
<!-- </div> -->
|
|
||||||
<br/>
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
<!-- This frame will load the download URL when a download button is pressed -->
|
<!-- This frame will load the download URL when a download button is pressed -->
|
||||||
<iframe id="download_frame" style="display: none; width: 1px; height: 1px;"></iframe>
|
<iframe id="download_frame" style="display: none; width: 1px; height: 1px;"></iframe>
|
||||||
@@ -128,19 +124,13 @@
|
|||||||
|
|
||||||
<div id="sponsors" class="sponsors">
|
<div id="sponsors" class="sponsors">
|
||||||
{{ if and .Other.FileAdsEnabled .Other.UserAdsEnabled }}
|
{{ if and .Other.FileAdsEnabled .Other.UserAdsEnabled }}
|
||||||
{{if eq .Other.AdType 0}}
|
{{if eq .Other.AdType 1}}
|
||||||
<!-- scrolling="no" is not allowed by the W3C, but overflow: hidden doesn't work in chrome, so I have no choice -->
|
<!-- Amarula electronics -->
|
||||||
<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">
|
<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%" />
|
<img src="/res/img/misc/banner_as.png" style="width: 100%; height: 100%" />
|
||||||
</a>
|
</a>
|
||||||
{{else if eq .Other.AdType 2}}
|
{{else if eq .Other.AdType 2}}
|
||||||
|
<!-- Patreon -->
|
||||||
<div style="text-align: center; line-height: 22px; font-size: 18px;">
|
<div style="text-align: center; line-height: 22px; font-size: 18px;">
|
||||||
<div style="margin: 4px 8px; display: inline-block; vertical-align: middle;">
|
<div style="margin: 4px 8px; display: inline-block; vertical-align: middle;">
|
||||||
Pixeldrain needs money to survive<br/>
|
Pixeldrain needs money to survive<br/>
|
||||||
@@ -155,18 +145,20 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{else if eq .Other.AdType 3}}
|
{{else if eq .Other.AdType 3}}
|
||||||
|
<!-- Soul Studio -->
|
||||||
<a class="sponsors_banner" style="display: inline-block; width: 842px; height: 125px;" href="/click/RJRbh7Tn?target=https%3A%2F%2Fsoulstudio.nl%2Fonline-y">
|
<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%" />
|
<img src="/res/img/misc/banner_soul_studio.png" style="width: 100%; height: 100%" />
|
||||||
</a>
|
</a>
|
||||||
{{else if eq .Other.AdType 4}}
|
{{else if eq .Other.AdType 4}}
|
||||||
|
<!-- Amarula Jobs -->
|
||||||
<a class="sponsors_banner" style="display: inline-block; width: 576px; height: 96px;" href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarulasolutions.com/jobs">
|
<a class="sponsors_banner" style="display: inline-block; width: 576px; height: 96px;" href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarulasolutions.com/jobs">
|
||||||
<img src="/res/img/misc/banner_amarula_jobs.png" style="width: 100%; height: 100%" />
|
<img src="/res/img/misc/banner_amarula_jobs.png" style="width: 100%; height: 100%" />
|
||||||
</a>
|
</a>
|
||||||
{{ else if eq .Other.AdType 6}}
|
|
||||||
<div id="348416176"></div>
|
|
||||||
{{ else if eq .Other.AdType 7}}
|
{{ else if eq .Other.AdType 7}}
|
||||||
|
<!-- Revenuehits -->
|
||||||
<iframe class="sponsors_banner" src="/ad/revenuehits" style="width:728px; height:90px; border:none; padding:0; overflow:hidden;" scrolling="no"></iframe>
|
<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 8}}
|
{{ else if eq .Other.AdType 8}}
|
||||||
|
<!-- Brave -->
|
||||||
<a class="sponsors_banner" style="display: inline-block; width: 728px; height: 90px;" href="https://brave.com/pix009">
|
<a class="sponsors_banner" style="display: inline-block; width: 728px; height: 90px;" href="https://brave.com/pix009">
|
||||||
<img src="/res/img/misc/brave-728x90.png" style="width: 100%; height: 100%" />
|
<img src="/res/img/misc/brave-728x90.png" style="width: 100%; height: 100%" />
|
||||||
</a>
|
</a>
|
||||||
@@ -274,21 +266,8 @@
|
|||||||
|
|
||||||
{{ if and .Other.FileAdsEnabled .Other.UserAdsEnabled }}
|
{{ if and .Other.FileAdsEnabled .Other.UserAdsEnabled }}
|
||||||
{{ if eq .Other.AdType 5 }}
|
{{ if eq .Other.AdType 5 }}
|
||||||
<script data-cfasync="false" defer src="//d227cncaprzd7y.cloudfront.net/?acncd=905608"></script>
|
<!-- AdMaven -->
|
||||||
{{ else if eq .Other.AdType 6}}
|
<script data-cfasync="false" async src="//d227cncaprzd7y.cloudfront.net/?acncd=905608"></script>
|
||||||
<script type="text/javascript">
|
|
||||||
window._mNHandle = window._mNHandle || {};
|
|
||||||
window._mNHandle.queue = window._mNHandle.queue || [];
|
|
||||||
medianet_versionId = "3121199";
|
|
||||||
</script>
|
|
||||||
<script src="https://contextual.media.net/dmedianet.js?cid=8CU832SZI" async="async"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
try {
|
|
||||||
window._mNHandle.queue.push(function (){
|
|
||||||
window._mNDetails.loadTag("348416176", "728x90", "348416176");
|
|
||||||
});
|
|
||||||
} catch (error) {}
|
|
||||||
</script>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</body>
|
</body>
|
||||||
|
@@ -31,29 +31,26 @@ func browserCompat(ua string) bool {
|
|||||||
|
|
||||||
func adType() int {
|
func adType() int {
|
||||||
const (
|
const (
|
||||||
aAds = 0
|
aAds = 0 // Always on
|
||||||
amarulaElectronics = 1
|
amarulaElectronics = 1
|
||||||
patreon = 2
|
patreon = 2
|
||||||
soulStudio = 3
|
soulStudio = 3
|
||||||
amarulaSolutions = 4
|
amarulaSolutions = 4
|
||||||
adMaven = 5
|
adMaven = 5
|
||||||
mediaNet = 6
|
|
||||||
revenueHits = 7
|
revenueHits = 7
|
||||||
brave = 8
|
brave = 8
|
||||||
)
|
)
|
||||||
|
|
||||||
// Intn returns a number up to n, but never n itself. So it get a random 0
|
// Intn returns a number up to n, but never n itself. So to get a random 0
|
||||||
// or 1 we need to give it n=2. We can use this function to make other
|
// or 1 we need to give it n=2. We can use this function to make other
|
||||||
// splits like 1/3 1/4, etc
|
// splits like 1/3 1/4, etc
|
||||||
switch i := rand.Intn(12); i {
|
switch i := rand.Intn(8); i {
|
||||||
case 0, 1, 2, 3, 4:
|
case 0, 1, 2, 3:
|
||||||
return amarulaSolutions
|
return amarulaSolutions
|
||||||
case 5, 6, 7, 8:
|
case 4, 5:
|
||||||
return adMaven
|
return adMaven
|
||||||
case 9, 10:
|
case 6, 7:
|
||||||
return brave
|
return patreon
|
||||||
case 11:
|
|
||||||
return aAds
|
|
||||||
default:
|
default:
|
||||||
panic(fmt.Errorf(
|
panic(fmt.Errorf(
|
||||||
"random number generator returned unrecognised number: %d", i),
|
"random number generator returned unrecognised number: %d", i),
|
||||||
|
@@ -73,7 +73,9 @@ func New(
|
|||||||
var fs = http.FileServer(http.Dir(resourceDir + "/static"))
|
var fs = http.FileServer(http.Dir(resourceDir + "/static"))
|
||||||
r.GET(prefix+"/res/*filepath", func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
r.GET(prefix+"/res/*filepath", func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
||||||
// Cache resources for 4 weeks
|
// Cache resources for 4 weeks
|
||||||
w.Header().Set("Cache-Control", "public, max-age=2419200")
|
if !debugMode {
|
||||||
|
w.Header().Set("Cache-Control", "public, max-age=2419200")
|
||||||
|
}
|
||||||
r.URL.Path = p.ByName("filepath")
|
r.URL.Path = p.ByName("filepath")
|
||||||
fs.ServeHTTP(w, r)
|
fs.ServeHTTP(w, r)
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user