🖼️ Topic Gallery Plugin

Hey there! :blob-wave-reverse:

Having only minimal programming knowledge, I’ve been experimenting with AI coding to compensate and created a plugin that generates image galleries from topics.

Open your eyes wide and witness the alliance between the autonomous machine and the diet soda-powered great ape!
:robot: :right_facing_fist: :collision: :left_facing_fist: :monkey_face:

You can see it live and try it here. This is primarily a test instance so the availability is not guaranteed.

Use cases

Ideal for image-focused communities and/or topics in which users post many pictures.
It allows for a full picture experience without the regular topic interface getting in the way.

Features

  • Infinite scrolling
  • User filter
  • Date filter
  • Can start the gallery from a given post number
  • Uses the Photoswipe viewer
  • Group-specific access
  • Smartphone-compatible
  • Shows which other pictures belong to the same post when moving the cursor over a thumbnail (background effect):
    chrome_RUqBsnIqbJ

There are several buttons to go from a topic to a Gallery :slight_smile:

  • From the timeline
  • At the end of a topic
  • On each post

If we open the gallery from a post, the gallery is filtered and only shows images starting from this post. You can cancel this filter with a single click.

Security & image queries

Galleries are only available for topics that a user has access to.
They don’t display images from soft-deleted posts, hidden flagged posts, whispers (if the current user don’t have access to them), and ignored users.

If a picture is displayed multiple times in the same topic, only the first occurrence appears in the gallery.
It doesn’t show non-regular uploads (avatars, custom emojis, etc).

It doesn’t work with hotlinked images.

The gallery displays images in the same order as in posts, and regardless of their upload date and author (in this regard, it works differently from my other project draft).

Bugs and weaknesses

  • Shows oneboxes’ favicons and thumbnails in the gallery
  • No meta tags on gallery links
  • No work on accessibility features
  • Slugless topic URLs (t/13/gallery) or wrong slug topic URLs (t/not-topic-title/13/gallery) don’t redirect to the topic’s gallery page

To do

  • Try to solve identified bugs and weaknesses
  • Add a setting to enable or disable galleries in specific categories
  • Add a setting to enable or disable galleries in specific topics
  • Put the topic’s title in the header on scroll?

Where can I find it, and why didn’t you publish that on Plugin?

First, a friendly lil’ warning!

:warning: It’s mostly AI-generated, and the technical knowledge involved in this project exceeds my own. Thus, despite having read the code, I can’t guarantee 100% it’s reliable or safe. Don’t install it if you can’t review the code yourself.

Now, I’d be happy if a real developer is enthusiastic enough to look at the code – which is not very complex from what I’ve seen. If that can be done, then the topic can surely be moved to Plugin and maintained, especially since I intend to use it on my community forum.
In the meantime, please consider this project as a mere experiment and not a production-ready plugin.

You can find the code here: https://github.com/Canapin/discourse-topic-gallery

:information_source: By default, the plugin is disabled, and gallery availables for admins only. Visit settings first.


Related Feature topics I created about similar features:

10 Likes