clarkwinkelmann / flarum-ext-featured-discussions
Schedule featured status for discussions
Installs: 586
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Language:TypeScript
Type:flarum-extension
Requires
- dragonmantank/cron-expression: ^3.1
- flarum/core: ^1.0
README
This extension adds a new filterable property to discussions. At the moment it's not displayed in any special way inside Flarum, but it can be used via the REST API for special integrations.
Discussions can be queued with specific dates for start and end of featuring. A schedule can be created from a CRON expression to easily manage the queue.
To retrieve discussions, use the featured
filter.
By default discussions will be sorted by most recently featured, you can customize it using the sort
parameter.
GET https://flarum.tld/api/discussions?filter[featured]=1&sort=featuredFrom
The feature status has an expiration date, this prevents older entries from being retrieved via the API, and allows controlling how many entries will be visible at a given time. The expiration duration can be customized per discussion, or with the global default duration in the settings.
Installation
composer require clarkwinkelmann/flarum-ext-featured-discussions:*
Limitations
As you approach 50 scheduled discussions in the future, the "Next" option and the schedule page might stop working as expected. Discussions can always be manually scheduled past that threshold.
Since the duration is constant but the schedule can be monthly, it's impossible to have the monthly featured status to expire exactly when the next feature starts. This is probably not an issue when retrieving a given number of featured posts from the REST API since there can exist more featured posts than you actually display.
The moderation permission is tag scopable, but if you give different permissions in different tags the schedule page might present some confusing behavior since the user could see discussions they cannot reschedule.
Support
This extension is under minimal maintenance.
It was developed for a client and released as open-source for the benefit of the community. I might publish simple bugfixes or compatibility updates for free.
You can contact me to sponsor additional features or updates.
Support is offered on a "best effort" basis through the Flarum community thread.