Avatar
Posts 428 1580

Legal Notice

Legal Notice

Version1.2.0
TypePlugin
CategoryIntegrations
AuthorFred
LicenseGPL-3.0
Flatboard5.2.0

Overview

LegalNotice adds a legal consent banner to the login and registration forms, along with two fully editable public pages — Terms of Use and Privacy Policy — available in all five forum languages.

The public pages are fully integrated into the Flatboard UX: they display the site banner (title, icon and breadcrumbs) through the native view.banner.data hook, exactly like EasyPages, without any core modification.

Features

  • Consent checkboxes injected into the login and/or registration forms
  • Server-side validation: submission is blocked if the user has not ticked both boxes
  • Public pages at /legal/terms and /legal/privacy with native banner integration (title + breadcrumbs)
  • Per-language content editor in the admin panel (fr, en, de, pt, zh)
  • Default content pre-filled with real forum data (name, URL, contact email) — ready to use out of the box
  • Optional footer links to the legal pages
  • Four dynamic placeholders usable anywhere in the content:
    • %forum_name% — forum name from site configuration
    • %site_url% — public URL of the forum
    • %contact_email% — plugin contact email, falls back to site_email (General Settings), then SMTP sender
    • %last_updated% — date the page was last saved, or the plugin activation date for default content
  • Reset any page to its default content with one click
  • Live placeholder preview in the admin editor (shows actual current values)

Installation

The plugin is loaded automatically by Flatboard. No manual installation step is required.

Configuration

Go to Admin → Plugins → LegalNotice (or Admin → Legal Pages in the sidebar).

SettingDefaultDescription
Show on login formDisplays the consent banner below the login form
Show on registration formDisplays the consent banner below the registration form
Open legal pages in a new tabLegal page links open in a new browser tab
Legal contact email(empty)Used for %contact_email% — falls back to site_email, then SMTP sender if empty
Show links in the footerAdds Terms of Use and Privacy Policy links in the forum footer

Placeholders

PlaceholderReplaced with
%forum_name%Forum name (site_name config key)
%site_url%Public forum URL (site_url config key)
%contact_email%Plugin contact email → site_emailsmtp.from_email (first non-empty value)
%last_updated%Date of last admin save, or plugin activation date for untouched default content

Placeholders are substituted at display time only. The admin editor always shows raw placeholder text so you can reuse or adjust it freely.

Page Editor

The Page Editor tab lets you edit the title and HTML content of each legal page for each language independently. Supported HTML tags: <h2>, <h3>, <p>, <ul>, <ol>, <li>, <strong>, <em>, <a>, <br>.

A live preview at the top of the editor shows the actual values that will replace each placeholder.

Banner Integration

On /legal/terms and /legal/privacy, the plugin injects banner data via the view.banner.data hook (priority 20, after EasyPages). This sets:

  • bannerType = 'page'
  • pageTitle — translated page title
  • pageIconfas fa-file-contract (terms) or fas fa-shield-alt (privacy)
  • breadcrumbs — Home › Page title

No core files are modified. The hook fires after EasyPages (priority 10), so any global EasyPages banner is properly overridden on legal pages.

Public URLs

PageURL
Terms of Use/legal/terms
Privacy Policy/legal/privacy

File Structure


plugins/LegalNotice/
├── LegalNoticePlugin.php       # Boot, hook registration (incl. banner hooks)
├── LegalNoticeController.php   # Public and admin routes
├── LegalNoticeService.php      # Data access, placeholder substitution, getForumVars()
├── plugin.json                 # Plugin manifest and default settings
├── data/
│   └── pages.json              # Saved custom page content + _meta.activated_at
├── langs/
│   ├── en.json
│   ├── fr.json
│   ├── de.json
│   ├── pt.json
│   └── zh.json
└── views/
    ├── admin.php               # Admin editor view
    └── page.php                # Public legal page view (banner via hook)

Changelog

1.2.0 — 2026-03-16

  • Banner integration via view.banner.data / view.banner.content hooks (priority 20)
    — title, icon and breadcrumbs now displayed natively in the Flatboard banner
  • New placeholder %site_url% — forum public URL auto-filled in default content
  • New placeholder %last_updated% — auto-filled with last save date or plugin activation date
  • Email fallback chain: plugin setting → site_email (General Settings) → smtp.from_email
  • Default content pre-filled with real forum data (links with <a href="%site_url%">, mailto links)
  • Live placeholder preview in admin editor
  • URL comparison now uses UrlHelper::to() (base-path aware)
  • Banner hook priority 20 to properly override global EasyPages banners

1.1.0 — 2026-03-16

  • Added %site_url% placeholder support
  • Email fallback: smtp.from_emailsite_email
  • getForumVars() method for admin preview

1.0.0 — 2026-03-12

Edited on  Mar 17, 2026  By  Fred .

  • Plugins gdpr
Avatar
Posts 428 1580

1.2.1 — 2026-03-29

Changed

  • Added update_url and changelog_url fields to plugin.json. Flatboard now detects available updates and displays them in Admin Panel > Tools > Updates. The changelog_url links to the plugin's resource page on flatboard.org.
Visitor, reply to this topic…
Log in to reply
Navigation
2 Posts
post #1
17 Mar 2026
By Utilisateur
Statistics
166
Discussions
911
Replies
21
Flatboarders
4
Contributors
New member : Emmanuel
Online
38 Guests online