Topic Timers v1.0.6
Close the competition, unpin the announcement or move the event topic when it's due.
By BoredSkull (https://boredskull.net/) for SMF 2.1.x
Free • ISC Licence
The competition closes at midnight. The announcement only needs to stay pinned until Friday. Once the weekend event is over, its discussion belongs in the archive. With
Topic Timers, your moderation team can schedule each of those jobs while the topic is already in front of them.
Open a topic, select
Topic Timer, choose an action and enter the time in UTC. The page shows the current server time alongside the scheduling controls. If plans change, authorised staff can review the timer and cancel it before it runs.
What's new in v1.0.6?- Correct Lock and Unlock choices. Topic Timers now recognises both of SMF's native topic lock states when deciding which action to offer.
- Removal is verified. After a scheduled removal, the mod checks the outcome. It also guards against attempting to remove a topic again after it has reached the recycle board.
- Cancellation follows the topic. If a topic moves after a timer is created, the cancellation check uses the moderator's permissions on its current board.
- Conflicting timers are blocked. Database locking prevents simultaneous submissions from creating conflicting timers. Retrying a failed timer also checks for conflicts with active timers.
- Clearer wording and upgrade instructions. Language descriptions now cover topic pinning, and the documentation explains how to retain your records when upgrading.
What can you schedule?- Lock or unlock a topic. Close entries when a competition ends, or reopen a discussion when a consultation begins. The action offered reflects the topic's current lock state.
- Pin or unpin a topic. Give an announcement a prominent place at the top of a board, or schedule the date it should return to the regular topic list.
- Move a topic. Choose a destination board for an expired event or completed project. Topic Timers checks board permissions and verifies that the topic reached its destination.
- Remove a topic. Scheduled removal is disabled by default. If enabled, only forum administrators can schedule it, and removal follows the forum's existing recycle board configuration.
Know whether a timer has runThe timer history shows colour-coded statuses, overdue indicators and retry delays. Administrators can see the scheduled task's last logged execution and next scheduled check, with warnings if the task is missing, disabled or overdue. A direct link opens SMF's scheduled task management page.
Timing matters. Topic Timers uses SMF's native scheduler to check for due actions at one-minute intervals. The actual execution time depends on when SMF runs the task. On a quiet forum with a time-sensitive deadline, use a dedicated cron job to run scheduled tasks regularly.
Moderation permissions and retries- Guests cannot schedule actions. Moderators need the appropriate permission for the action they choose. By default, Topic Timers checks the scheduler's permissions again before execution.
- Timers for the same topic are processed in chronological order. Database locking protects against overlapping task runs and duplicate execution.
- Eligible failures can retry automatically, with increasing delays and a maximum of five attempts. Failed moves and removals require manual review. Administrators can inspect failed timers and retry them where appropriate.
Installation and upgradesCompatibility — SMF 2.1.x with MySQL or MariaDB. PostgreSQL is currently unsupported. PHP syntax was validated with PHP 8.4. Topic Timers has no external dependencies and requires no edits to SMF core files or theme templates.
- Back up your forum database. If you're upgrading, uninstall the previous version first. Uninstalling retains your timer records, history and settings.
- Upload the new package through the SMF Package Manager and select Install Now.
- After installation, you'll be taken to Admin → Configuration → Modification Settings → Topic Timers. Review the available actions and check the scheduled task status.
- Open a topic, select Topic Timer and schedule your first action. For a staging test, pin a topic you can easily unpin, then check its timer history after the task runs.
Test on a staging forum before enabling scheduled removal on a live community.
Integration hooks for other modsTopic Timers works as a standalone modification. Three hooks let companion mods respond when a timer is created, review it before execution or act after it runs.
integrate_btt_created($id_topic, $action, $execute_at)
integrate_btt_before_execute(&$timer, &$permit)
integrate_btt_executed($timer)These hooks are available for future integrations with Scheduled Topics, Event Manager, Activity Stream, Community Insights and Community Digest.
Earlier releases- v1.0.5 — Pinning and scheduled moves. Added scheduled pinning, state-aware Pin/Unpin and Lock/Unlock choices, and server-side action validation. Fixed member context when moderation actions run through cron, added safeguards for removal and verified the destination after a move.
- v1.0.4 — Timing and diagnostics. Added the server UTC clock, last and next task information, scheduler warnings, overdue indicators and retry delays. Updated the history layout with colour-coded statuses and fixed a delay caused by SMF's cached next-task timestamp.
- v1.0.3 — Permissions and execution order. Improved board visibility checks, default membergroup handling and local moderator permission checks. Added locking for scheduled task runs, chronological processing and safeguards for interruptions. Move and removal exceptions now require manual review. Scheduled task labels gained native hook-based language loading and English fallbacks.
- v1.0.2 — Easier administration. Moved Topic Timers into Modification Settings, corrected menu registration and missing labels, added scheduled task language strings and redirected administrators to settings after installation.
- v1.0.1 — Recovery and retries. Added configurable permission rechecks, destination board checks, recovery of abandoned timer claims, automatic retry delays and manual retries. Blocked conflicting actions for the same topic and timestamp, added database migration support for retry times and prevented errors in integration hooks from triggering duplicate retries.
- v1.0.0 — Initial development release.
Support and feedbackIf a timer doesn't run as expected, reply with the action you scheduled, its UTC time, the status shown in timer history and the task's last logged execution. Suggestions for moderation actions and companion mod integrations are welcome too.
Build your forum, your way!
BoredSkull.net (https://boredskull.net/)