Search by

flatrate / flarum-public-counts

mrkcntrmn

Read-only guest-visible discussion and reply counts for one closed UTC week. Flarum 1.8.

Package info

github.com/mrkcntrmn/flatrate-flarum-public-counts

Type:flarum-extension

pkg:composer/flatrate/flarum-public-counts

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 2

v0.1.0 2026-10-20 01:22 UTC

README

Read-only Flarum 1.8.19 count of guest-visible discussions and authored replies for one closed UTC week.

The count uses Discussion::whereVisibleTo(guest) and Post::whereVisibleTo(guest). It does not replace those scopes with hidden_at IS NULL. A reply must be a comment whose Flarum number is greater than 1, so the opening comment and event posts are excluded. Post visibility already requires the parent discussion to be visible.

The result is what a guest can see at the time of the read, grouped by creation time. It is not a reconstruction of visibility at the historical week close.

POST /api/flatrate/public-counts accepts only startUtc and endUtc, exactly seven days apart, and requires FLATRATE_PUBLIC_COUNTS_TOKEN. The response is the two integers and a snapshot receipt.

Disposable coverage is tests/integration/PublicVisibleWeekCountsTest.php against Flarum core, tags, flags, and approval. fof/byobu is not part of the installed disposable package set. Private discussions are Flarum's is_private flag. Approval hides unapproved rows by marking them private.