Put revenuehits in container

This commit is contained in:
2020-10-27 08:25:03 +01:00
parent 3734f1bd44
commit bc496c3998
4 changed files with 61 additions and 18 deletions

View File

@@ -154,6 +154,10 @@
<a class="sponsors_banner" style="display: inline-block; width: 576px; height: 96px;" href="/click/DtZ3hHT9?target=https%3A%2F%2Fwww.amarulasolutions.com"> <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%" /> <img src="/res/img/misc/banner_amarulasolutions.png" style="width: 100%; height: 100%" />
</a> </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}} {{end}}
</div> </div>
{{end}} {{end}}
@@ -248,9 +252,25 @@
{{template "analytics"}} {{template "analytics"}}
{{ if .Other.ShowAds }}{{ if eq .Other.AdType 5 }} {{ if .Other.ShowAds }}
{{ if eq .Other.AdType 5 }}
<script data-cfasync="false" defer src="//d227cncaprzd7y.cloudfront.net/?acncd=905608"></script> <script data-cfasync="false" defer src="//d227cncaprzd7y.cloudfront.net/?acncd=905608"></script>
{{ end }}{{ end }} {{ else if eq .Other.AdType 6}}
<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 }}
</body> </body>
</html> </html>
{{end}} {{end}}

View File

@@ -0,0 +1,16 @@
{{ define "revenuehits" }}
<html>
<head>
<title>Ad Banner</title>
<style>
html, body {
margin: 0;
background-color: black;
}
</style>
</head>
<body>
<script data-cfasync='false' type='text/javascript' src='//p416901.clksite.com/adServe/banners?tid=416901_817726_0'></script>
</body>
</html>
{{ end }}

View File

@@ -33,25 +33,31 @@ func adType() (i int) {
// 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 it 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
i = rand.Intn(8) i = rand.Intn(5)
// The return value corresponds to the type of ad shown: const (
// 0: A-ads aAds = 0
// 1: Amarula Electronics amarulaElectronics = 1
// 2: Patreon patreon = 2
// 3: Soul Studio Yoga soulStudio = 3
// 4: Amarula Solutions amarulaSolutions = 4
// 5: Ad-Maven adMaven = 5
mediaNet = 6
revenueHits = 7
)
switch i { switch i {
case 0, 1, 2: // 3/8 of the traffic case 0, 1:
return 4 // Amarula solutions return amarulaSolutions
case 3, 4, 5, 6: // 4/8 of the traffic case 2:
return 5 // Ad-Maven return adMaven
case 7: // 1/8 of traffic case 3:
return 2 // Patreon return mediaNet
case 4:
return revenueHits
default: default:
panic(fmt.Errorf( panic(fmt.Errorf(

View File

@@ -149,8 +149,9 @@ func New(
{PST, "admin/abuse" /* */, wc.serveForm(wc.adminAbuseForm, true)}, {PST, "admin/abuse" /* */, wc.serveForm(wc.adminAbuseForm, true)},
// Advertising related // Advertising related
{GET, "click/:id" /* */, wc.serveAdClick}, {GET, "click/:id" /* */, wc.serveAdClick},
{GET, "campaign/:id" /**/, wc.serveCampaignPartner}, {GET, "campaign/:id" /* */, wc.serveCampaignPartner},
{GET, "ad/revenuehits" /**/, wc.serveTemplate("revenuehits", false)},
} { } {
r.Handle(h.method, prefix+"/"+h.path, h.handler) r.Handle(h.method, prefix+"/"+h.path, h.handler)
} }