PolicyGuard — Flatboard Plugin

Version 1.1.0 | GPL3 | flatboard.org
Download: in resources management

Enforce community guidelines acknowledgement before members can browse your forum.


a12cb8f9-de61-4a23-98e0-2ae01de99742.jpg

What it does

PolicyGuard links to any discussion on your forum (typically your "Community Guidelines" or "Terms of Service" thread). When that discussion's first post is edited, all members are automatically required to re-read and confirm the new terms before continuing.

Reading flow

  1. Any page (except the target discussion) — a full-screen blocking overlay appears. It shows the title of the guidelines, an estimated reading time badge, and a link to the discussion. The confirm button stays locked.

  2. The target discussion — the overlay disappears. A non-blocking toast (bottom-right corner) counts down the estimated reading time while the member reads freely. When the countdown reaches zero, the toast closes and the confirmation overlay reappears on that page only, with the checkbox unlocked.

  3. Confirmation — the member ticks the checkbox and clicks Confirm & Continue. The acknowledgement is saved server-side (JSON file for logged-in users, cookie for guests).

  4. If the member leaves mid-read — the remaining countdown is stored in sessionStorage. When they return to the discussion, the countdown resumes from where it stopped.

Automatic version bump

When a moderator or admin edits the first post of the tracked discussion, PolicyGuard automatically:

  • Updates policy_version to the edited_at timestamp of the post.
  • Recalculates the estimated reading time.
  • Preserves any extra delay the admin had configured on top of the estimate.
  • All previous confirmations become invalid → every member must confirm again.

Installation

  1. Copy the PolicyGuard/ folder into plugins/.
  2. Enable the plugin from Admin → Plugins.
  3. Open Admin → Plugins → PolicyGuard → Settings.
  4. Select the discussion containing your guidelines from the dropdown.
  5. Adjust the optional extra reading time if needed, then save.

Configuration

FieldDescription
Policy DiscussionThe discussion whose first post is monitored.
Exempt administratorsAdmins skip the modal entirely.
Block guestsShow the modal to non-logged-in visitors too (confirmation stored in a 1-year cookie).
Estimated reading timeComputed automatically at ~200 wpm, rounded to 30 s. Read-only.
Extra reading timeAdditional seconds added on top of the estimate. 0=estimate only.
Custom messageOverride the default modal body text for all languages. HTML not allowed.

Force re-confirmation

Click Reset all confirmations in the sidebar. All members will see the modal again on their next visit, regardless of whether the discussion was edited.

Preview

Click Preview modal to see the overlay exactly as a member would, without affecting your admin session.


Data storage

  • Logged-in users — stored in stockage/json/policyguard_confirmations.json as { "users": { "<user_id>": <version_timestamp> } }.
  • Guests — stored in a browser cookie named pg_confirmed (1 year, HttpOnly, SameSite=Lax).
  • Reading progress — stored in sessionStorage (browser tab only, never sent to the server).

Hooks used

HookPurpose
router.plugins.registerRegister /policyguard/confirm and admin routes.
view.footer.contentInject the overlay + toast HTML on every frontend page.
post.updatedDetect first-post edits to auto-bump policy_version.
plugin.view.admin.varsPass data to the admin view.

Languages

English · Français · Deutsch · Português · 中文


Changelog

1.2.0 (2026-02-22)

  • Fixed: Pop-up no longer shows on the target discussion — detection now uses the discussion ID from the URL path (/d/{id}-) which is robust regardless of base URL, trailing slash, or pagination.
  • Fixed: Native Flatboard settings form (Image 2) no longer shows internal fields — plugin section in plugin.json is now empty, all config is handled exclusively via the custom admin view.
  • Improved: Admin tabs renamed to "Configuration" / "Status & Preview" for clarity.

1.1.0 (2026-02-22)

  • New: Smart reading-time estimation from word count (~200 wpm, rounded to 30 s).
  • New: Non-blocking reading toast replaces the blocking countdown overlay.
  • New: Confirmation overlay reappears on the discussion page after the toast expires.
  • New: SessionStorage persists remaining time across page reloads.
  • Fixed: Hook changed from discussion.updated (non-existent) to post.updated + first-post detection.
  • Fixed: "Force re-confirmation" block now uses explicit inline colour for light/dark theme compatibility.
  • Fixed: Removed duplicate form_config entries from plugin.json.
  • Improved: reading_seconds replaces countdown_seconds; admin configures extra time on top of estimate.
  • Improved: Admin view shows estimated time, total time, and a live preview of the reading-total info block.

1.0.0 (2026-02-22)

  • Initial release.

Edited on Feb 23, 2026 By Fred .