[help] [img] [forum]
[Catalog] · [Search] [News]
[Return] []
Posting mode: Reply
Post reply
Name
Email
Subject
Message
CAPTCHA CAPTCHA Challenge Click to refresh.
File
Password For post deletion.
Submit  
  • Helpful information is available in the visitor guide. Currently 28 unique user posts.
  • Supported file types are JPG, PNG and GIF.
  • Maximum file size allowed is 2MB.
  • Images greater than 250x250 will be thumbnailed.
  • Supported BBCode tags are b, code, i, pre, sjis, spoiler, s and u.

1787850474270.png
A couple of features I would like to see
The amount of replies and images a thread has
What page the thread is on
Reporting with a given reason


Thanks for the suggestions.

I can see how that information might be useful. Including the current page would break caching, because the page content would change even though no new posts were added.

However, it is possible to add the number of replies and images by customizing extra_footer.gohtml:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{{if and (ne .ReplyMode 0) (gt (len .Threads) 0) (gt (len (index .Threads 0)) 0)}}
  {{$replies := len (index .Threads 0) | MinusOne}}
  {{$images := Add64 0 0}}{{/* Initialize int64 variable. */}}
  {{range $post := (index .Threads 0)}}
    {{if ne $post.File ""}}
      {{$images = Add64 $images 1}}{{/* Increment variable. */}}
    {{end}}
  {{end}}
  {{$replies}} replies and {{$images}} images.
{{end}}

I have opened a tracking issue for allowing visitors to include a reason when reporting posts:

https://codeberg.org/tslocum/sriracha/issues/141


>>121
could that also be done for the catalog?


>>122
Yes, you can include this information in the catalog by overriding imgboard_catalog.gohtml. Replace the following text:

[{{.Replies}}]

With:

1
2
3
4
5
6
7
{{$images := Add64 0 0}}{{/* Initialize int64 variable. */}}
{{range $p := AllPostsInThread 1 $post.ID}}
  {{if ne $p.File ""}}
    {{$images = Add64 $images 1}}{{/* Increment variable. */}}
  {{end}}
{{end}}
[{{.Replies}}{{if gt $images 0}} / {{$images}}{{end}}]

This example requires Sriracha v2.1.1 or newer.


[]