fof / best-answer
Mark a post as the best answer in a discussion
Package info
github.com/FriendsOfFlarum/best-answer
Type:flarum-extension
pkg:composer/fof/best-answer
Fund package maintenance!
Requires
- flarum/core: ^2.0.0
- flarum/tags: ^2.0.0
Requires (Dev)
- flarum/audit: ^2.0.0
- flarum/phpstan: ^2.0.0
- flarum/testing: ^2.0.0
- fof/user-directory: ^2.0.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- 2.x-dev
- 2.0.0-beta.8
- 2.0.0-beta.7
- 2.0.0-beta.6
- 2.0.0-beta.5
- 2.0.0-beta.4
- 2.0.0-beta.3
- 2.0.0-beta.2
- 2.0.0-beta.1
- 1.x-dev
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.5
- 1.6.4
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.9
- 1.5.8
- 1.5.7
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- 0.4.0
- 0.3.6
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.12
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-im/reminder-test-gaps
- dev-im/reminder-selectable-replies
- dev-im/deck-support
- dev-im/solutions-search
- dev-im/question-gambit
- dev-im/realtime-best-answer
- dev-im/solution-post-filter
- dev-im/remove-dead-code
- dev-im/frontend-typings
- dev-im/preview-answer-link
- dev-im/best-answer-label-span
- dev-im/unset-best-answer-on-model-delete
- dev-im/best-answer-notification-recipients
- dev-im/stop-overnight-utc
- dev-im/js-package-hygiene
- dev-im/preview-answerer-hover-card
- dev-im/admin-only-qna-reminders
- dev-im/unset-best-answer-on-delete
- dev-im/test-namespaces
- dev-im/fixed-test-usernames
- dev-im/keep-reminder-until-saved
- dev-im/remove-branch-alias
- dev-im/no-first-or-hidden-best-answer
- dev-im/best-answer-user-link
- dev-im/remind-only-in-qna-tags
- dev-im/ask-question-aria-label
- dev-im/validate-tag-settings
- dev-im/best-answer-email-templates
- dev-im/keep-composer-title-focus
- dev-im/export-ignore-dev-files
- dev-im/readme-usage
- dev-im/withdraw-best-answer-notifications
- dev-im/bump-webpack-config
- dev-im/filter-setting-insert-or-ignore
- dev-im/composer-branch-alias
- dev-im/remove-follow-tags-optional-dependency
- dev-im/preview-refresh-on-answer-change
- dev-im/notified-down-migration-nulls
- dev-im/alternative-ui-call-to-action
- dev-im/solved-tags-metadata
- dev-im/include-best-answer-author
- dev-im/best-answer-column-indexes
- dev-im/update-counts-per-chunk
- dev-im/notify-command-queries
- dev-im/no-push-attributes-in-render
- dev-im/post-list-eager-load
- dev-im/has-best-answer-no-query
- dev-im/only-comments-as-best-answer
- dev-im/best-answer-count-atomic
- dev-im/solved-filter-qna-only
- dev-im/solved-filter-search-text
- dev-im/notify-skip-deleted-authors
- dev-im/fix-unselect-redraw-error
- dev-im/best-answer-post-must-belong
- dev-im/coverage-gaps
- dev-im/fix-vacuous-tests
- dev-im/phpunit-flarum2-config
- dev-im/always-on-one-server
- dev-im/tidy-extend-php
- dev-im/fix-best-answer-preview-redraw
- dev-im/docs-recalculate-best-answer-counts
- dev-im/fix-null-best-answer-notified
- dev-im/admin-settings-extender
- dev-im/audit-best-answer-replaced
- dev-cw/fix-ban-ip-incompatibility
- dev-im/qna
- dev-beta13
This package is auto-updated.
Last update: 2026-10-12 10:09:18 UTC
README
A Flarum extension. Mark a post as the best answer in a discussion. Original by @wiwatsrt.
Features
- Allow Best Answers to be set and highlighted within a discussion
- Set which tags support Best Answer/Q&A format
- Filter answered/unanswered/all discussions within available tags
- Send reminders to the OP to select a Best Answer after a configurable number of days
- Optionally allow the OP to select one of their own follow-up posts as the Best Answer
- Provides two layouts for the Best Answer controls
- Option to prevent reminders from being sent overnight
Requirements
- Flarum 2.x
- flarum/tags
These extensions are optional. When one is enabled, Best Answer adds:
- flarum/audit: an audit log entry when a best answer is set or unset.
- flarum/deck: Unsolved questions and Best answers columns. With flarum/realtime they follow best answers being set and removed as it happens.
- flarum/realtime: a live
bestAnswerEventbroadcast when a best answer is set or unset. - fof/user-directory: "Most best answers" and "Least best answers" sort options in the user directory.
- ianm/level-ranks: extra spacing beside the best answer label in post headers.
Installation
Install with composer:
composer require fof/best-answer:"*"
Usage
The settings are on the FoF Best Answer page in the admin panel.
Q&A tags
Best answers can only be set in discussions that have at least one Q&A tag. Choose these tags in Enabled Tags.
In a Q&A tag, the start discussion button reads Ask a Question. When a Q&A tag is selected in the composer, the title placeholder reads Question title.
Best answers can't be set in private discussions.
Permissions
The permissions are in the Participate section of the Permissions page. Grant them globally, or per tag for restricted tags.
| Permission | Allows the user to |
|---|---|
| Select Best Answer (own Discussion) | Set or remove the best answer in discussions they started. |
| Select Best Answer (not own Discussion) | Set or remove the best answer in discussions started by others. |
| Select own post as Best Answer | Select one of their own posts. They also need one of the two permissions above. |
The select control isn't shown on hidden posts or on the first post of a discussion.
Solved/unsolved filter
Turn on Display Best Answer filter dropdown to add a filter to the discussion list of each Q&A tag. It offers All questions, Solved questions and Unsolved questions.
In discussion search, is:solved finds discussions with a best answer and -is:solved finds discussions without one. is:question finds discussions in Q&A tags, so is:question -is:solved finds unsolved questions.
In post search, is:solution finds posts selected as a best answer.
Reminders
A reminder is a notification that asks a discussion's author to select a best answer.
To send reminders:
- Set Days before reminding to the number of days to wait after a discussion is started.
0, the default, turns reminders off. - Choose the tags in Reminder Tags.
- Run the Flarum scheduler. Add a cron entry that calls
php flarum schedule:runevery minute, as described in the Flarum documentation.
The extension schedules the fof:best-answer:notify command to run hourly. php flarum schedule:list shows it. Each run reminds the author of every discussion that:
- has a reminder tag, and a tag from Enabled Tags
- was started between N and N + 7 days ago, where N is Days before reminding
- has at least one reply
- has no best answer, isn't hidden or private, and its author's account still exists
- hasn't been reminded before
The author must have the Select Best Answer (own Discussion) permission. If no one else has posted a reply the author could select, the author also needs Select own post as Best Answer. Hidden replies, replies awaiting approval and event posts, such as a tag change, don't count. A reply from a deleted account does.
Each discussion gets one reminder at most. Setting a best answer deletes the reminder.
With Don't send reminders overnight turned on, the command only runs between 08:00 and 21:00 UTC. With Log reminder runs turned on, the command's output is added to storage/logs/fof-best-answer.log.
Other settings
| Setting | Effect |
|---|---|
| Alternative layout | Shows the select button in the post footer instead of the post's controls menu. |
| Max lines to show in post preview | The best answer is previewed under the first post. Longer answers are cut to this many lines. 0 shows the whole answer. |
| Tags for discussions with Best Answers | Secondary tags added to a discussion when a best answer is set, and removed when it is unset. |
| Display jump to Best Answer button in discussion sidebar | Adds a View Best Answer button to the discussion sidebar. |
Notifications
Users choose how they receive these in their notification settings.
| Notification | Sent to | On by default |
|---|---|---|
| Someone sets my post as a best answer | The author of the selected post, unless they selected it | Alert |
| A best answer is set in a discussion I participated in | Other users who posted in the discussion | None |
| An automated reminder to select a best answer in a discussion I started | The discussion's author | Alert and email |
Updating
composer update fof/best-answer
Upgrading from 2.0.0-beta.8 or earlier
Before this release, choosing a different best answer in a discussion left the previous answer's author with one best answer too many. After updating, recalculate every user's best answer count:
php flarum fof:best-answer:update-counts
The command goes through every user, so it can take a while on large forums.
Links
An extension by FriendsOfFlarum.