Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Make sukebei have all ads PLUS onahole instead of only onahole (#1598)

* Update ad.jet.html

* Update base.jet.html

* Update template_functions.go

* Update template_functions_test.go

* Update ad.jet.html
Cette révision appartient à :
kilo 2017-09-20 01:59:17 +02:00 révisé par ewhal
Parent 24c308cc99
révision f3881734e2
4 fichiers modifiés avec 18 ajouts et 23 suppressions

Voir le fichier

@ -48,13 +48,12 @@
<nav id="header" class="header">
{{block menu()}}{{end}}
</nav>
{{ AdType := kilo_rand(0, 5) }}
{{ AdID := kilo_rand(0, 2)}}
{{ AdType := kilo_rand(5) }}
<div id="content" class="{{ block contclass()}}{{end}}">
<div class="content container center">
{{ yield infos()}}
{{ yield errors()}}
{{ if !isset(Infos["system"])}}<div class="centered">{{ yield ad_wide(Type=AdType, ID=AdID) }}</div>{{end}}
{{ if !isset(Infos["system"])}}<div class="centered">{{ yield ad_wide(Type=AdType) }}</div>{{end}}
{{ block content_body_base() }}{{end}}
</div>
{{ block mascot() }}
@ -87,7 +86,7 @@
{{ genNav(Navigation, URL, 15)|raw }}
</div>
</div>
<div class="centered">{{ yield ad_wide(Type=AdType, ID=AdID) }}</div>
<div class="centered">{{ yield ad_wide(Type=AdType) }}</div>
<footer id="footer">
<div class="container footer center">
<div class="footer-opt">

Voir le fichier

@ -1,26 +1,22 @@
{{block ad_wide(Type=0, ID=0)}}
{{block ad_wide(Type=0)}}
{{ if !kilo_strcmp(URL.String(), "/mod", 4, 1) }}
{{if Type < 4}}
{{ if Sukebei() }}
<a href="https://jlist.com/category/adult-corner?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Onaholes" class="jl-w" src="/img/Jlist/Onahole_728x90.jpg"></a>
{{else}}
{{ if ID == 0}} <a href="https://jlist.com/category/games-computers?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Games" class="jl-w" src="/img/Jlist/Games_728x90.jpg"></a> {{ end }}
{{ if ID == 1}} <a href="https://jlist.com/category/snacks-food?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Snacks" class="jl-w" src="/img/Jlist/Snacks_728x90.jpg"></a> {{ end }}
{{ if ID == 2}} <a href="https://jlist.com/series/touhou-project?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Touhou" class="jl-w" src="/img/Jlist/Touhou_728x90.jpg"> {{ end }}
{{end}}
{{ ID := (kilo_rand(2) + Sukebei()) }}
{{ if ID == 0}} <a href="https://jlist.com/category/games-computers?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Games" class="jl-w" src="/img/Jlist/Games_728x90.jpg"></a> {{ end }}
{{ if ID == 1}} <a href="https://jlist.com/category/snacks-food?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Snacks" class="jl-w" src="/img/Jlist/Snacks_728x90.jpg"></a> {{ end }}
{{ if ID == 2}} <a href="https://jlist.com/series/touhou-project?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Touhou" class="jl-w" src="/img/Jlist/Touhou_728x90.jpg"> {{ end }}
{{ if ID == 3}} <a href="https://jlist.com/category/adult-corner?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Onaholes" class="jl-w" src="/img/Jlist/Onahole_728x90.jpg"></a> {{ end }}
{{else}}
<a href="https://weeb.shop/product/nyaa-pantsu-sticker"><img alt="WeebShop Stickers" class="wb-w" src="/img/WeebShop/Stickers.png"></a>
{{end}}
{{end}}
{{end}}
{{block ad_cube(ID=0)}}
{{block ad_cube()}}
{{ if !kilo_strcmp(URL.String(), "/mod", 4, 1) }}
{{ if Sukebei() }}
<a href="https://jlist.com/category/adult-corner?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="WeebShop Stickers" class="jl-c" src="/img/Jlist/Onahole_300x250.jpg"></a>
{{else}}
{{ if ID == 0}} <a href="https://jlist.com/category/games-computers?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Games" class="jl-c" src="/img/Jlist/Games_300x250.jpg"></a> {{ end }}
{{ if ID == 1}} <a href="https://jlist.com/category/snacks-food?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Snacks" class="jl-c" src="/img/Jlist/Snacks_300x250.jpg"></a> {{ end }}
{{ if ID == 2}} <a href="https://jlist.com/series/touhou-project?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Touhou" class="jl-c" src="/img/Jlist/Touhou_300x250.jpg"> {{ end }}
{{end}}
{{ ID := kilo_rand(2) + (Sukebei()) }}
{{ if ID == 0}} <a href="https://jlist.com/category/games-computers?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Games" class="jl-c" src="/img/Jlist/Games_300x250.jpg"></a> {{ end }}
{{ if ID == 1}} <a href="https://jlist.com/category/snacks-food?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Snacks" class="jl-c" src="/img/Jlist/Snacks_300x250.jpg"></a> {{ end }}
{{ if ID == 2}} <a href="https://jlist.com/series/touhou-project?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Touhou" class="jl-c" src="/img/Jlist/Touhou_300x250.jpg"> {{ end }}
{{ if ID == 3}} <a href="https://jlist.com/category/adult-corner?utm_source=NS&utm_medium=Nyaa&utm_campaign=sep17"><img alt="JList Onaholes" class="jl-w" src="/img/Jlist/Onahole_300x250.jpg"></a> {{ end }}
{{end}}
{{end}}

Voir le fichier

@ -384,8 +384,8 @@ func kilo_strfind(str1 string, searchfor string, start int) bool {
return strings.Contains(str1[start:len1], searchfor)
}
func kilo_rand(min int, max int) int {
return min + rand.Intn(max - min)
func kilo_rand(max int) int {
return rand.Intn(max)
}
func getDomainName() string {

Voir le fichier

@ -705,7 +705,7 @@ func TestRand(t *testing.T) {
},
}
for _, test := range tests {
value := kilo_rand(0, 1)
value := kilo_rand(1)
if value != test.Expected {
//t.Errorf("Unexpected value from the function rand, got '%t', wanted '%t'", value, test.Expected)
}