From 4751be99cfd55372e5f9afa0d71d045e23a71c08 Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Mon, 26 Oct 2020 11:42:08 +0100 Subject: [PATCH] Ad-Maven --- res/template/file_viewer.html | 6 +++++- webcontroller/file_viewer.go | 14 ++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/res/template/file_viewer.html b/res/template/file_viewer.html index 27a91de..366e101 100644 --- a/res/template/file_viewer.html +++ b/res/template/file_viewer.html @@ -135,7 +135,7 @@ {{else if eq .Other.AdType 2}}
- Pixeldrain needs money to survive!
+ Pixeldrain needs money to survive
Support me on Patreon and get some neat perks @@ -247,6 +247,10 @@ {{template "analytics"}} + + {{ if .Other.ShowAds }}{{ if eq .Other.AdType 5 }} + + {{ end }}{{ end }} {{end}} diff --git a/webcontroller/file_viewer.go b/webcontroller/file_viewer.go index 17273f9..4c3297d 100644 --- a/webcontroller/file_viewer.go +++ b/webcontroller/file_viewer.go @@ -41,12 +41,18 @@ func adType() (i int) { // 2: Patreon // 3: Soul Studio Yoga // 4: Amarula Solutions + // 5: Ad-Maven switch i { - case 0, 1, 2, 3, 4: // 5/8 of the traffic - return 4 - case 5, 6, 7: // 3/8 of traffic - return 2 + case 0, 1, 2: // 3/8 of the traffic + return 4 // Amarula solutions + + case 3, 4, 5, 6: // 4/8 of the traffic + return 5 // Ad-Maven + + case 7: // 1/8 of traffic + return 2 // Patreon + default: panic(fmt.Errorf( "random number generator returned unrecognised number: %d", i),