ernestdefoe / glimpse
Glimpse: Stories for Flarum. Short photo, video and text posts that disappear after a day, shown as a bar of avatar rings and played full screen, with reactions, private replies, a seen-by list, highlights and moderation.
Fund package maintenance!
Requires
- php: ^8.3
- flarum/core: ^2.0
- intervention/image: ^3.0
Requires (Dev)
- flarum/phpstan: ^2.0
- flarum/suspend: ^2.0
- flarum/testing: ^2.0
- fof/ignore-users: ^2.0
- ianm/follow-users: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
Suggests
- ernestdefoe/bespoke: The ring bar in any Bespoke zone.
- ernestdefoe/moments: Also post a photo story to Moments.
- ernestdefoe/page-builder: The ring bar as a Page Builder block.
- ernestdefoe/parley: Replies to a story arrive as a Parley message.
- ernestdefoe/trust-levels: Hold stories for approval below a trust level.
- flarum/messages: Replies to a story arrive as a private message.
- flarum/suspend: Suspended members' stories disappear while they are suspended.
- fof/forum-widgets-core: The ring bar as a FoF widget.
- fof/ignore-users: Members you ignore never show in your bar.
- ianm/follow-users: Rings of people you follow come first, and stories can be shared with followers only.
Provides
None
Conflicts
None
Replaces
None
README
Stories for Flarum 2, called Glimpses on your forum: short photo, video and text posts that disappear after a day, shown as a row of avatar rings above the discussion list and played full screen.
- Post a story. A photo, a short video, or a few words on one of eight colors. Add a caption (mention people with @username), one link, and pick who can see it: everyone, signed-in members, or your followers (with Follow Users). It disappears after 24 hours; the admin can pick 6, 12, 48 hours or a week.
- The bar. New stories first, people you follow next, then the newest. Seen rings turn grey. Your own ring comes first, with a plus to add another.
- The viewer. Full screen on phones, a 9:16 card on desktop. Tap the right side to go on, the left to go back, hold to pause, swipe down to close, swipe sideways to move to the next person. Arrow keys, Space and Esc work too. Progress bars run along the top, videos play for their length, and the next story loads while you watch.
- React and reply. Quick reactions (choose up to eight emoji, or just one for a single like button). Replies go to the author privately, through Parley or Flarum's own Messages.
- Seen by. Only the author (and moderators) can see who saw a story and how they reacted.
- Highlights. Keep stories past their time in named collections on your profile.
- The Glimpses page at
/glimpselists every live story you can see, with a Following filter. Each profile has a Glimpses tab. - Moderation. Report a story; moderators see reports and waiting stories at
/glimpse/queue, and can hide or delete any story. Hold new members' stories for approval by post count, days since joining, or a Trust Levels level. Anyone can mute a person's stories. Suspended members' stories disappear while the suspension lasts, and with FoF Ignore Users a member's stories can be hidden from the people they ignore. - Widgets. The story bar in Bespoke's zones, as a Page Builder block and in FoF Widgets.
- Also post to Moments. With Moments, a photo or video story can be posted there too.
Private and safe
- One visibility rule decides every read: the bar, the page, profiles, highlights, notifications and the media files themselves. Photos and videos are served only to people who may see the story, never cached by shared caches, and gone when the story is.
- Uploads are checked by their content, never their name or the type the browser claims. Photos are saved again on the server, which removes location, camera details and anything hidden in the file. Videos keep their picture but lose their metadata, including the location phones record. No SVG, no HTML, nothing a browser would run.
- A flood guard spaces out posts, and the admin sets a daily limit.
Light
The bar is one request, and costs the same few queries for one person or thirty. The viewer, the create sheet and the pages load only when opened. Expired stories and unused uploads are deleted every hour with their files (php flarum glimpse:prune, scheduled; Flarum's scheduler must be running).
API notes
GET /api/glimpse-storiesloads each story's media and author groups in the story query itself (StorySearcher, andscope()for a single story), not through an endpointeagerLoad(). An endpoint eager load runs through the media resource's owner-only scope (which stops a member attaching someone else's upload) and would blank everyone else's media. Query counts stay flat from 1 to 24 stories (QueryCountTest).
Install
composer require ernestdefoe/glimpse
Uploads are stored in storage/glimpse. Make sure your web server allows uploads as large as your largest video (client_max_body_size in nginx, upload_max_filesize and post_max_size in PHP).
Update
composer update ernestdefoe/glimpse php flarum migrate php flarum cache:clear



