PHPackages                             fof/discussion-thumbnail - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. fof/discussion-thumbnail

ActiveFlarum-extension[Image &amp; Media](/categories/media)

fof/discussion-thumbnail
========================

Replace author avatars with the first image in a discussion's starting post

1.2.0(2mo ago)611.7k—9.3%3[1 PRs](https://github.com/FriendsOfFlarum/discussion-thumbnail/pulls)MITPHPCI failing

Since Dec 11Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/FriendsOfFlarum/discussion-thumbnail)[ Packagist](https://packagist.org/packages/fof/discussion-thumbnail)[ Docs](https://friendsofflarum.org)[ Fund](https://opencollective.com/fof/donate)[ RSS](/packages/fof-discussion-thumbnail/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (22)Used By (0)

Discussion Thumbnail by FriendsOfFlarum
=======================================

[](#discussion-thumbnail-by-friendsofflarum)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667) [![Latest Stable Version](https://camo.githubusercontent.com/a582cf7ceeb02830baeb9e212c5ec1f551867f07258661a8980cda65123cd697/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666f662f64697363757373696f6e2d7468756d626e61696c2e737667)](https://packagist.org/packages/fof/discussion-thumbnail) [![OpenCollective](https://camo.githubusercontent.com/1903c197bb0307e60d6328653532b8a6b9890b898fbc92e314ab39d699491e74/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6f70656e636f6c6c6563746976652d666f662d626c75652e737667)](https://opencollective.com/fof/donate)

A [Flarum](http://flarum.org) extension. Replaces the author avatar in the discussion list with the first image found in the discussion's opening post.

How it works
------------

[](#how-it-works)

When the discussion list is rendered, each discussion's author avatar is replaced with a thumbnail of the first `` found in the HTML of the first post. If the first post contains no image, the normal user avatar is shown instead.

**Backend:** `AddDiscussionThumbnail` is registered as an API serializer attribute on `BasicDiscussionSerializer`. For each discussion it:

1. Loads the first post and calls `formatContent()` to render the full HTML
2. Extracts the `src` of the first `` tag via regex
3. Caches the result forever against the post ID, keyed as `fof:discussion-thumbnail:discussion:{id}`
4. Returns the URL as the `customThumbnail` attribute on the discussion

The cache is invalidated when the post's `edited_at` timestamp is newer than the cached date, so editing the first post to change its image is reflected on next load.

**Frontend:** The `customThumbnail` attribute is read in a `contentItems` extension on `DiscussionListItem`. When a thumbnail URL is present, the `authorAvatar` item is replaced with a `DiscussionThumbnail` component wrapped in the same `Tooltip` + `Link` structure as the normal avatar. The thumbnail is styled with the `.Avatar` class so it matches core avatar sizing and alignment at all breakpoints.

Settings
--------

[](#settings)

SettingDefaultDescriptionLink to discussion`false`When enabled, clicking the thumbnail navigates to the discussion instead of the author's profileInstallation
------------

[](#installation)

```
composer require fof/discussion-thumbnail:"*"
```

Enable the extension in your Flarum admin panel.

Updating
--------

[](#updating)

```
composer update fof/discussion-thumbnail
php flarum cache:clear
```

Links
-----

[](#links)

[![OpenCollective](https://camo.githubusercontent.com/8ea53c451470d1a72789d650c77e2b22eee915f7fbf2cbeeeeaa25f47301efe2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f6e6174652d667269656e64736f66666c6172756d2d3434414545353f7374796c653d666f722d7468652d6261646765266c6f676f3d6f70656e2d636f6c6c656374697665)](https://opencollective.com/fof/donate)

- [Packagist](https://packagist.org/packages/fof/discussion-thumbnail)
- [GitHub](https://github.com/FriendsOfFlarum/discussion-thumbnail)
- [Discuss](https://discuss.flarum.org/d/22231)

An extension by [FriendsOfFlarum](https://github.com/FriendsOfFlarum).

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance87

Actively maintained with recent releases

Popularity32

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~162 days

Recently: every ~209 days

Total

15

Last Release

83d ago

Major Versions

0.4.0 → 1.0.02021-05-27

1.x-dev → 2.0.0-beta.12026-02-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16573496?v=4)[IanM](/maintainers/imorland)[@imorland](https://github.com/imorland)

![](https://avatars.githubusercontent.com/u/1630413?v=4)[Gregor Hammerschmidt](/maintainers/GreXXL)[@GreXXL](https://github.com/GreXXL)

![](https://www.gravatar.com/avatar/0538135c1debcef5602dce7ece027909cc832b7a6284ab9189a19aa8de98d60d?d=identicon)[clarkwinkelmann](/maintainers/clarkwinkelmann)

![](https://www.gravatar.com/avatar/1298cdc0b2402a1aa34fb75a254947d655e090d62bd0531311331d369cac934e?d=identicon)[datitisev](/maintainers/datitisev)

---

Top Contributors

[![flarum-bot](https://avatars.githubusercontent.com/u/39334649?v=4)](https://github.com/flarum-bot "flarum-bot (10 commits)")[![imorland](https://avatars.githubusercontent.com/u/16573496?v=4)](https://github.com/imorland "imorland (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![dsevillamartin](https://avatars.githubusercontent.com/u/6401250?v=4)](https://github.com/dsevillamartin "dsevillamartin (6 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (2 commits)")[![davwheat](https://avatars.githubusercontent.com/u/7406822?v=4)](https://github.com/davwheat "davwheat (2 commits)")[![Ralkage](https://avatars.githubusercontent.com/u/2059356?v=4)](https://github.com/Ralkage "Ralkage (2 commits)")[![askvortsov1](https://avatars.githubusercontent.com/u/38059171?v=4)](https://github.com/askvortsov1 "askvortsov1 (1 commits)")[![SKevo18](https://avatars.githubusercontent.com/u/39010496?v=4)](https://github.com/SKevo18 "SKevo18 (1 commits)")[![karaok491](https://avatars.githubusercontent.com/u/72854852?v=4)](https://github.com/karaok491 "karaok491 (1 commits)")

---

Tags

discussion-thumbnailfriendsofflarumflarumfriendsofflarum

### Embed Badge

![Health badge](/badges/fof-discussion-thumbnail/health.svg)

```
[![Health](https://phpackages.com/badges/fof-discussion-thumbnail/health.svg)](https://phpackages.com/packages/fof-discussion-thumbnail)
```

###  Alternatives

[fof/gamification

Upvotes and downvotes for your Flarum community

4157.1k6](/packages/fof-gamification)[fof/formatting

Customize TextFormatter with plugins through the admin interface

26112.3k4](/packages/fof-formatting)[fof/subscribed

Additional user subscriptions for your forum

1327.5k2](/packages/fof-subscribed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
