Link brave directly to referral link
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
</script>
|
||||
</div>
|
||||
{{ else if eq .Other.AdBannerType 7 }}
|
||||
<a class="sponsors_banner" style="display: inline-block; width: 728px; height: 90px;" href="/brave">
|
||||
<a class="sponsors_banner" style="display: inline-block; width: 728px; height: 90px;" href="/click/MdUXxSov?target=https%3A%2F%2Fbrave.com%2Fpix009">
|
||||
<img src="/res/img/misc/brave-728x90.png" style="width: 100%; height: 100%" />
|
||||
</a>
|
||||
{{ else if eq .Other.AdBannerType 8 }}
|
||||
|
@@ -78,10 +78,10 @@ func (vd *viewerData) adType(files []pixelapi.ListFile) {
|
||||
// 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
|
||||
// splits like 1/3 1/4, etc
|
||||
switch i := rand.Intn(4); i {
|
||||
case 0: // 25%
|
||||
switch i := rand.Intn(8); i {
|
||||
case 0: // 12.5%
|
||||
vd.AdBannerType = brave
|
||||
case 1, 2, 3: // 75%
|
||||
case 1, 2, 3, 4, 5, 6, 7: // 87.5%
|
||||
vd.AdBannerType = aAds
|
||||
default:
|
||||
panic(fmt.Errorf("random number generator returned unrecognised number: %d", i))
|
||||
|
@@ -174,11 +174,12 @@ func (tm *TemplateManager) ParseTemplates(silent bool) {
|
||||
} else if strings.HasSuffix(path, ".gif") {
|
||||
file = []byte("data:image/gif;base64," + base64.StdEncoding.EncodeToString(file))
|
||||
}
|
||||
|
||||
// Wrap the resources in a template definition
|
||||
if _, err = tpl.Parse(
|
||||
`{{define "` + f.Name() + `"}}` + string(file) + `{{end}}`,
|
||||
); err != nil {
|
||||
return err
|
||||
return fmt.Errorf("failed to parse '%s': %w", path, err)
|
||||
}
|
||||
|
||||
if !silent {
|
||||
|
@@ -74,7 +74,7 @@ func New(
|
||||
wc.templates.ParseTemplates(false)
|
||||
|
||||
if wc.hostname, err = os.Hostname(); err != nil {
|
||||
panic(fmt.Errorf("Could not get hostname: %s", err))
|
||||
panic(fmt.Errorf("could not get hostname: %s", err))
|
||||
}
|
||||
|
||||
// Serve static files
|
||||
|
Reference in New Issue
Block a user