Documentation - Flatboard Guide complet sur l'utilisation de votre forum préféré https://docs.flatboard.org/ fr-FR Tue, 17 Mar 2026 09:53:14 +0100 sansCMS 1.0.3-stable 60 Flatboard 5 Help Center Welcome to the Flatboard 5 help center. Discover all resources to install, configure, and use your forum. https://docs.flatboard.org/home https://docs.flatboard.org/home Thu, 25 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team documentation help guide forum Flatboard 5 Help Center

Flatboard 5 — Forum preview

Current Version: 5.2.1 — License: GPL3 (Community & Pro)

Quick Start

  1. Getting Started — Prerequisites and server preparation
  2. Installation — Step-by-step installation guide
  3. Configuration — Forum settings
  4. Admin Panel — Administration interface overview

About Flatboard 5

Flatboard 5 is a complete rewrite of the forum software with a modern MVC architecture.

Editions:

Edition Price Storage Extras
Community Free JSON Core features
Pro €49 one-time JSON + SQLite Premium plugins & themes

System Requirements

  • Web Server: Apache 2.4 (mod_rewrite) or Nginx
  • PHP: 8.0 or higher
  • Required extensions: json, mbstring, openssl
  • Recommended: fileinfo, zip, pdo_sqlite (Pro), gd or imagick

Technology Stack

Layer Technology
Backend PHP 8.0+
Storage JSON flat-file / SQLite
Frontend HTML5, CSS3, JavaScript
Text formatting Markdown Extra (Parsedown)

Key Dependencies

Library Version License
PHPMailer 7.0.2 LGPL-2.1
Parsedown 1.8.0 MIT
Bootstrap 5.3.8 MIT
Font Awesome 7.2.0 Free (CC BY 4.0 / SIL OFL 1.1 / MIT)
SortableJS 1.15.7 MIT

Contributors

Translations

  • JPRuehmann — German translation (de)
  • Thalles — Portuguese translation (pt)
  • magu — Simplified Chinese translation (zh)

Active Bug Reporters

Thanks

Special thanks to all community members who have contributed feedback, ideas, and support — your involvement makes Flatboard better for everyone.

Support

]]>
Getting Started A comprehensive guide to get started with Flatboard 5 - installation, configuration, and first steps https://docs.flatboard.org/getting-started https://docs.flatboard.org/getting-started Wed, 24 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team guide installation setup getting-started

Sommaire

Getting Started with Flatboard 5

What is Flatboard 5?

Flatboard 5 is a modern, lightweight forum platform built with PHP 8.0+. It combines simplicity with powerful features, making it perfect for communities of all sizes.

Flatboard Home Screenshot

Key Features

Flatboard 5 is a next-generation forum software that offers:

  • Lightweight Architecture - JSON or SQLite storage, no heavy database required
  • Modern PHP 8.0+ - Built with the latest PHP features and best practices
  • MVC Pattern - Clean, maintainable code structure
  • Plugin System - Extensible through a powerful plugin architecture
  • Theme Support - Fully customizable themes
  • Security First - Built-in CSRF protection, rate limiting, and input validation
  • Multi-language - Support for multiple languages out of the box
  • SEO Optimized - Complete SEO features with meta tags, structured data, and sitemaps
  • Markdown Extra - Rich text formatting with Markdown Extra support
  • Performance Optimized - Denormalized counters, Markdown caching, atomic file operations
  • Dual Edition - Available in both Community (free) and Pro (paid) editions, both licensed under GPL3

System Requirements

Server Requirements

  • Web Server: Apache 2.4+ (with mod_rewrite) or Nginx
  • PHP Version: 8.0 or higher (8.1+ recommended)
  • Disk Space: At least 100MB free space (more for uploads and content)

Required PHP Extensions

These extensions are mandatory for Flatboard 5 to function:

  • json - JSON manipulation (usually included by default)
  • mbstring - Full UTF-8 support for international characters
  • openssl - Security features (encryption, HTTPS support)

These extensions enhance functionality but are not strictly required:

  • fileinfo - Secure MIME type validation of uploaded files
  • zip - ZIP archive content analysis
  • pdo_sqlite - For SQLite storage (Pro edition only)
  • gd or imagick - Avatar generation and image processing
  • curl - For external API calls and updates

Checking Your PHP Configuration

You can check your PHP version and extensions using:

# Check PHP version
php -v

# List all loaded extensions
php -m

# Check specific extension
php -m | grep json
php -m | grep mbstring
php -m | grep openssl

Or create a temporary phpinfo.php file:

<?php
phpinfo();

Community vs Pro Edition

Flatboard 5 is available in two distinct editions:

Community Edition

Free (Forever) - Licensed under GPL3

Features:

  • Complete Forum System - Full forum functionality
  • User Management - Comprehensive user account system
  • Discussion & Post System - Create and manage discussions and posts
  • Core Plugins & Themes - Essential plugins and themes included
  • REST API - API access for integration
  • JSON Storage - File-based storage system (default)
  • Complete Documentation - Full documentation access
  • Open Source (GPL3) - Full source code access
  • Community Support - Community-driven support
  • Regular Updates - Free updates and improvements

Over 10 years of continuous development. Free and regularly updated for the community.

Pro Edition

€49 (One-time payment, no subscription) - Licensed under GPL3

Includes everything in Community Edition, plus:

  • SQLite Storage - Database storage option for enhanced performance (Pro exclusive)
  • Premium Plugin Pack - Private Messaging, Forum Monitoring, EasyPage, and more
  • Premium Themes - Additional professional themes
  • Advanced Analytics - Enhanced statistics and reporting features
  • Extended API Features - Additional API endpoints and capabilities
  • Priority Support - Direct support access
  • 3 Years of Feature Updates - Guaranteed feature updates for 3 years
  • No Subscription Required - One-time payment, no recurring fees

Installation Overview

The installation process is straightforward and typically takes 10-15 minutes:

  1. Download - Get the latest Flatboard 5 release
  2. Upload - Extract files to your web server
  3. Set Permissions - Configure file and directory permissions
  4. Run Installer - Follow the web-based installation wizard
  5. Configure - Set up your site settings and admin account

Pre-Installation Checklist

Before starting the installation, verify:

  • [ ] PHP 8.0+ is installed and active
  • [ ] Required PHP extensions are enabled (json, mbstring, openssl)
  • [ ] Web server is configured (Apache with mod_rewrite or Nginx)
  • [ ] Write permissions are available for installation directory
  • [ ] At least 100MB free disk space
  • [ ] You have FTP/SFTP or shell access to your server
  • [ ] You know your domain name and server paths

Next Steps

Once you've verified the requirements:

  1. Read the Installation Guide - Detailed step-by-step instructions
  2. Prepare Your Server - Ensure all prerequisites are met
  3. Download Flatboard 5 - Get the latest release from flatboard.org

Common Questions

What is the difference between Community and Pro editions?

The main differences are:

  • Storage: Community uses JSON storage, Pro includes SQLite storage option
  • Plugins: Pro includes premium plugins (Private Messaging, Forum Monitoring, EasyPage)
  • Themes: Pro includes additional premium themes
  • Support: Pro includes priority support
  • Price: Community is free, Pro costs €49 (one-time payment)

Both editions are open source under GPL3.

Can I run both versions side by side?

Yes, you can run Flatboard 4 and Flatboard 5 on different directories or subdomains. They are completely independent installations.

Resources

Last updated: February 23, 2026

]]>
Installation Guide Detailed step-by-step installation guide for Flatboard 5 with all configuration options https://docs.flatboard.org/installation https://docs.flatboard.org/installation Tue, 23 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team installation setup guide server

Sommaire

Installation Guide

Pre-Installation Checklist

Installation Methods

The web installer is the easiest way to install Flatboard 5.

Step 1: Download and Extract

Download the latest Flatboard 5 release from flatboard.org and extract it to your web server directory:

# Download and extract ZIP file
unzip flatboard-5-latest.zip

# Or using wget
wget https://flatboard.org/download/flatboard-5-latest.zip
unzip flatboard-5-latest.zip

Step 2: Set Permissions

Set the correct permissions for directories and files:

# Directories (readable and executable)
chmod 755 app/ themes/ plugins/ languages/ vendor/

# Storage and uploads (readable, writable, executable)
chmod 750 stockage/ uploads/

# Files (readable)
chmod 644 *.php
chmod 644 public/*.php

# Configuration file (readable and writable by owner only)
chmod 600 stockage/json/config.json 2>/dev/null || true

# CLI executable
chmod 755 app/Cli/console.php

Step 3: Access Installer

Open your browser and navigate to:

https://yourdomain.com

or

https://yourdomain.com/install.php

The installer will automatically detect if Flatboard 5 is not yet installed and redirect you to the installation wizard.

Step 4: Follow Installation Wizard

The installer will guide you through:

  1. System Check

    • PHP version verification
    • Extension availability check
    • Directory permissions check
    • Storage type selection (JSON or SQLite for Pro)
  2. Site Configuration

    • Site name
    • Site URL
    • Base URL (if installed in subdirectory)
    • Default language
    • Timezone
  3. Admin Account Creation

    • Username
    • Email address
    • Password (with strength indicator)
  4. SMTP Configuration (Optional)

    • Email server settings
    • Authentication credentials
    • Test email sending
  5. Finalization

    • Review all settings
    • Complete installation
    • Access admin panel

Method 2: Manual Installation

For advanced users who prefer manual setup:

Step 1: Extract Files

Extract the Flatboard 5 archive to your web root:

cd /var/www/html  # or your web root
unzip flatboard-5-latest.zip

Step 2: Create Configuration

Create the configuration directory and file:

mkdir -p stockage/json
touch stockage/json/config.json
chmod 600 stockage/json/config.json

Step 3: Set Permissions

chmod 755 app/ themes/ plugins/ languages/
chmod 750 stockage/ uploads/
chmod 644 *.php

Step 4: Configure Web Server

Apache Configuration:

Ensure mod_rewrite is enabled and create/update .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ public/index.php [QSA,L]
</IfModule>

Nginx Configuration:

server {
    listen 80;
    server_name yourdomain.com;
    root /var/www/html/public;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

Step 5: Run Installation

Access install.php in your browser to complete the setup.

Storage Type Selection

During installation, you'll choose a storage type:

JSON Storage (Default)

  • Available in: Community and Pro editions
  • Best for: Small to medium communities
  • Pros: Simple, no database required, easy backups
  • Cons: Slower for very large datasets

SQLite Storage (Pro Only)

  • Available in: Pro edition only
  • Best for: Medium to large communities
  • Pros: Better performance, SQL queries, transactions
  • Cons: Requires pdo_sqlite extension

Post-Installation

Verify Installation

  1. Check Admin Panel Access

    • Navigate to /admin
    • Log in with your admin credentials
  2. Test Forum Functionality

    • Create a test category
    • Create a test discussion
    • Verify file uploads work
  3. Check File Permissions

    • Verify stockage/ is writable
    • Verify uploads/ is writable

Security Hardening

After installation, perform these security steps:

  1. Remove Installer

    rm install.php
  2. Protect Configuration

    chmod 600 stockage/json/config.json
  3. Review .htaccess Files

    • Ensure stockage/ has .htaccess protection
    • Verify uploads/ has proper restrictions
  4. Set Debug Mode to False

    • In admin panel: Settings > General > Debug Mode = Off

Troubleshooting Installation

Common Issues

Issue: "PHP version too old"

Solution: Upgrade to PHP 8.0 or higher.

# Check current version
php -v

# Update PHP (Ubuntu/Debian)
sudo apt update
sudo apt install php8.1 php8.1-cli php8.1-fpm

Issue: "Extension missing"

Solution: Install missing PHP extensions.

# Ubuntu/Debian
sudo apt install php8.1-json php8.1-mbstring php8.1-openssl php8.1-fileinfo

# CentOS/RHEL
sudo yum install php-json php-mbstring php-openssl php-fileinfo

Issue: "Permission denied"

Solution: Fix directory permissions.

# Set ownership (replace www-data with your web server user)
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 755 /var/www/html
sudo chmod -R 750 /var/www/html/stockage
sudo chmod -R 750 /var/www/html/uploads

Issue: "Cannot write to stockage/"

Solution: Ensure the directory is writable.

chmod 750 stockage/
chmod 750 stockage/json/
touch stockage/json/.htaccess

Issue: "Installation wizard not loading"

Solution: Check web server configuration and file paths.

  • Verify public/index.php exists
  • Check Apache mod_rewrite is enabled
  • Verify Nginx configuration is correct
  • Check PHP error logs: tail -f /var/log/php-errors.log

Next Steps

After successful installation:

  1. Configure Your Forum - Set up site settings
  2. Explore Admin Panel - Learn the administration interface
  3. Create Categories - Organize your forum
  4. Install Plugins - Extend functionality
  5. Customize Theme - Personalize appearance

Resources

Last updated: February 23, 2026

]]>
Forum Configuration Complete guide to configure Flatboard 5 settings including site parameters, storage, email, and advanced options https://docs.flatboard.org/configuration https://docs.flatboard.org/configuration Mon, 22 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team configuration settings smtp storage timezone

Sommaire

Forum Configuration

Configuration File

Flatboard 5 stores its main configuration in /stockage/json/config.json.

Configuration Structure

{
  "site_name": "My Forum",
  "site_url": "https://example.com",
  "base_url": "",
  "default_language": "fr",
  "timezone": "Europe/Paris",
  "storage_type": "json",
  "debug": false,
  "maintenance_mode": false,
  "registration_enabled": true,
  "email_verification": false,
  "pagination_type": "classic",
  "smtp": {
    "enabled": false,
    "host": "",
    "port": 587,
    "username": "",
    "password": "",
    "from_email": "",
    "from_name": ""
  },
  "assets": {
    "minify_css": true,
    "minify_js": false,
    "cache_enabled": true
  }
}

General Settings

Site Information

Access: Admin Panel > Settings > General

  1. Site Name - Your forum's display name

    • Appears in page titles, headers, and emails
    • Maximum 100 characters
  2. Site URL - Full URL including protocol

    • Format: https://example.com or http://example.com
    • Used for email links and redirects
  3. Site Description - Brief description for SEO

    • Appears in meta tags
    • Recommended: 150-160 characters
  4. Base URL - Subdirectory path if installed in subfolder

    • Leave empty if installed in root
    • Example: /forum if installed at https://example.com/forum

Language and Timezone

Configure localization settings:

  • Default Language - Choose from available languages

    • Available: English (en), French (fr), and more
    • Users can override in their profile
  • Timezone - Set your server's timezone for correct timestamps

Storage Configuration

Storage Type:

  • JSON - File-based storage (default, all editions)
  • SQLite - Database storage (Pro Edition only)

User Settings

Registration

  • Enable Registration - Allow new users to register

    • When disabled, only admins can create accounts
  • Email Verification - Require email verification

    • Users must verify email before account activation
    • Requires SMTP to be configured
  • Default User Group - Group assigned to new users

    • Typically: "Member" or "Guest"

Profile Settings

  • Allow Avatar Upload - Enable user avatar uploads
  • Avatar Max Size - Maximum file size (e.g., 2MB)
  • Avatar Dimensions - Maximum width/height (e.g., 200x200)
  • Allow Signature - Enable user signatures in posts
  • Signature Max Length - Maximum characters (e.g., 500)

Email Configuration

SMTP Settings

Access: Admin Panel > Settings > Email

Configure SMTP for reliable email delivery:

  1. Enable SMTP - Turn on SMTP sending
  2. SMTP Host - Your mail server (e.g., smtp.gmail.com)
  3. SMTP Port - Usually 587 (TLS) or 465 (SSL)
  4. Username - SMTP authentication username
  5. Password - SMTP authentication password
  6. From Email - Sender email address
  7. From Name - Sender display name

Common SMTP Providers

Gmail:

Host: smtp.gmail.com
Port: 587
Encryption: tls
Username: [email protected]
Password: (App Password, not regular password)

Outlook/Office 365:

Host: smtp.office365.com
Port: 587
Encryption: tls

SendGrid:

Host: smtp.sendgrid.net
Port: 587
Encryption: tls
Username: apikey
Password: (Your SendGrid API key)

Test Email

Use the "Send Test Email" button to verify your SMTP configuration.

Security Settings

CSRF Protection

  • Enabled by default - Protects against Cross-Site Request Forgery
  • No configuration needed - automatically handled

Rate Limiting

Configure request rate limits:

  • Login Attempts - Max attempts per IP (default: 5)
  • Registration Attempts - Max registrations per IP (default: 3)
  • Password Reset - Max requests per hour (default: 3)

Password Requirements

  • Minimum Length - Minimum password characters (default: 8)
  • Require Uppercase - Require uppercase letters
  • Require Numbers - Require numeric characters
  • Require Special Characters - Require special chars (!@#$% etc.)

Performance Settings

Caching

  • Enable Cache - Enable Markdown and template caching
  • Cache Duration - Cache lifetime in seconds (default: 3600)

Asset Optimization

  • Minify CSS - Automatically minify CSS files
  • Minify JavaScript - Automatically minify JS files
  • Combine Assets - Combine multiple files into one

Maintenance Mode

Access: Admin Panel > Settings > Maintenance

Enable maintenance mode to perform updates or maintenance:

  • Maintenance Mode - Enable/disable
  • Maintenance Message - Message shown to visitors
  • Allow Admin Access - Admins can still access during maintenance

Advanced Settings

Debug Mode

  • Debug Mode - Enable detailed error messages
    • Never enable in production - Security risk
    • Use only for development/troubleshooting
    • When enabled, HTML assets (CSS/JS) are not minified - Assets are served in their original, readable format for easier debugging
    • When enabled, the Maintenance Tools section becomes visible in the Admin Dashboard — All rebuild, cleanup, and file-permission actions (Admin → Dashboard → Maintenance) are hidden in production and only appear when debug is true. A warning notice is displayed inside the section to remind administrators that these tools are exposed because debug mode is active.

Logging

  • Enable Logging - Log errors and events
  • Log Level - error, warning, info, debug
  • Log File - Location: /stockage/logs/

SEO Settings

  • Meta Title - Default page title
  • Meta Description - Default meta description
  • Meta Keywords - Default keywords (comma-separated)
  • Enable Sitemap - Generate sitemap.xml
  • Enable Robots.txt - Generate robots.txt

Configuration via Admin Panel

Most settings can be configured through the admin panel:

  1. Navigate to Admin Panel - /admin
  2. Go to Settings - Click "Settings" in the menu
  3. Select Category - General, Users, Email, Security, etc.
  4. Modify Settings - Change values as needed
  5. Save Changes - Click "Save" button

Configuration via CLI

Some settings can be configured via command line:

# Set a configuration value
php app/Cli/console.php config:set site_name "My Forum"

# Get a configuration value
php app/Cli/console.php config:get site_name

# List all configuration
php app/Cli/console.php config:list

# Reload config from disk (discards in-memory cache — useful after manual edits)
php app/Cli/console.php config:reload

Backup Configuration

Always backup your configuration before making changes:

# Backup config.json
cp stockage/json/config.json stockage/json/config.json.backup

# Restore from backup
cp stockage/json/config.json.backup stockage/json/config.json

Troubleshooting Configuration

Settings Not Saving

Possible causes:

  • Insufficient file permissions
  • Configuration file locked
  • Disk space full

Solution:

chmod 600 stockage/json/config.json
chown www-data:www-data stockage/json/config.json

Email Not Sending

Check:

  1. SMTP settings are correct
  2. Firewall allows outbound connections on SMTP port
  3. Credentials are valid
  4. Test email function works

Timezone Issues

Solution: Use proper timezone identifier:

  • Correct: Europe/Paris
  • Incorrect: Paris, GMT+1, UTC+1

Resources

Last updated: February 26, 2026

]]>
Admin Panel Guide Complete guide to the Flatboard 5 administration panel - navigation, features, and management tools https://docs.flatboard.org/admin-panel https://docs.flatboard.org/admin-panel Sun, 21 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team admin administration panel management

Sommaire

Admin Panel Guide

Accessing the Admin Panel

Login

  1. Navigate to /admin on your forum
  2. Enter your admin credentials
  3. Click "Login"

Dashboard Overview

After logging in, you'll see the admin dashboard with:

  • Statistics - Forum activity, user counts, discussion counts
  • Recent Activity - Latest discussions, registrations, reports
  • Quick Actions - Common administrative tasks
  • System Status - Server information, PHP version, storage type

The admin panel is organized into sections:

Dashboard

  • Overview of forum statistics and activity
  • Quick access to common tasks

Discussions

  • Manage categories
  • Moderate discussions and posts
  • Handle reports

Users

  • User management
  • Group management
  • Permission configuration
  • Ban management

Settings

  • General settings
  • Email configuration
  • Security settings
  • Performance options

Plugins

  • Install and activate plugins
  • Configure plugin settings
  • Manage plugin dependencies

Themes

  • Activate themes
  • Customize theme settings
  • Manage theme assets

Tools

  • Backup and restore
  • Cache management
  • Log viewer
  • System information

Managing Categories

Access: Admin Panel > Discussions > Categories

Creating Categories

  1. Click "New Category"
  2. Fill in category details:
    • Name - Category display name
    • Slug - URL-friendly identifier
    • Description - Category description (supports Markdown)
    • Parent Category - For subcategories
    • Icon - Category icon (optional)
    • Color - Category color (optional)
    • Order - Display order
  3. Set permissions (who can view/post)
  4. Click "Create Category"

Editing Categories

  1. Find category in list
  2. Click "Edit"
  3. Modify settings
  4. Click "Save"

Deleting Categories

  1. Click "Delete" on category
  2. Confirm deletion
  3. Choose to delete or move discussions

User Management

Access: Admin Panel > Users

Viewing Users

  • List View - All users with search and filters
  • User Details - Click username to view profile
  • User Activity - Discussions, posts, reputation

Editing Users

  1. Find user in list
  2. Click "Edit"
  3. Modify:
    • Username, email, password
    • User group
    • Profile information
    • Permissions
  4. Click "Save"

Banning Users

  1. Find user in list
  2. Click "Ban"
  3. Set ban details:
    • Reason - Why user is banned
    • Duration - Temporary or permanent
    • IP Ban - Ban by IP address
  4. Click "Ban User"

User Groups

Access: Admin Panel > Users > Groups

Manage user groups and permissions:

  • Default Groups - Guest, Member, Moderator, Admin
  • Custom Groups - Create custom groups
  • Permissions - Configure per-group permissions

Moderation Tools

Reports

Access: Admin Panel > Discussions > Reports

Handle user reports:

  1. View reported content
  2. Review report details
  3. Take action:
    • Dismiss - Report is invalid
    • Warn User - Send warning
    • Delete Content - Remove content
    • Ban User - Ban the user

Discussion Moderation

  • Pin Discussions - Keep at top of category
  • Lock Discussions - Prevent new replies
  • Move Discussions - Move to different category
  • Delete Discussions - Remove permanently

Post Moderation

  • Edit Posts - Modify content
  • Delete Posts - Remove posts
  • Split Posts - Move to new discussion
  • Merge Posts - Combine posts

Settings Management

General Settings

Access: Admin Panel > Settings > General

  • Site name, URL, description
  • Language and timezone
  • Registration settings
  • Storage configuration

Email Settings

Access: Admin Panel > Settings > Email

  • SMTP configuration
  • Email templates
  • Test email sending

Security Settings

Access: Admin Panel > Settings > Security

  • CSRF protection
  • Rate limiting
  • Password requirements
  • Two-factor authentication

Performance Settings

Access: Admin Panel > Settings > Performance

  • Caching options
  • Asset optimization
  • Database optimization (Pro)

Plugin Management

Access: Admin Panel > Plugins

Installing Plugins

  1. Download plugin
  2. Extract to plugins/ directory
  3. Refresh plugin list
  4. Click "Activate"

Configuring Plugins

  1. Find plugin in list
  2. Click "Settings"
  3. Configure options
  4. Click "Save"

Updating Plugins

  1. Download new version
  2. Replace plugin files
  3. Refresh plugin list
  4. Check for compatibility

Theme Management

Access: Admin Panel > Themes

Activating Themes

  1. Find theme in list
  2. Click "Activate"
  3. Theme is immediately active

Customizing Themes

  1. Select active theme
  2. Click "Customize"
  3. Modify:
    • Colors and fonts
    • Layout options
    • CSS variables
  4. Preview changes
  5. Click "Save"

Tools and Utilities

Backup

Access: Admin Panel > Tools > Backup

  • Create Backup - Full forum backup
  • Download Backup - Download backup file
  • Restore Backup - Restore from backup

Cache Management

Access: Admin Panel > Tools > Cache

  • Clear Cache - Remove cached files
  • Rebuild Cache - Regenerate cache
  • Cache Statistics - View cache usage

Log Viewer

Access: Admin Panel > Tools > Logs

  • View error logs
  • View access logs
  • Filter by date/type
  • Download logs

System Information

Access: Admin Panel > Tools > System

  • PHP version and extensions
  • Server information
  • Storage statistics
  • Performance metrics

Best Practices

Regular Maintenance

  • Review reports daily
  • Monitor user activity
  • Check error logs weekly
  • Update plugins regularly
  • Create backups regularly

Security

  • Use strong admin passwords
  • Enable two-factor authentication
  • Review user permissions regularly
  • Monitor for suspicious activity
  • Keep Flatboard 5 updated

Performance

  • Clear cache when needed
  • Optimize images before upload
  • Monitor storage usage
  • Review slow queries (Pro)

Keyboard Shortcuts

  • Ctrl+K - Quick search
  • Ctrl+/ - Show shortcuts
  • Esc - Close modals

Troubleshooting

Can't Access Admin Panel

Check:

  1. You have admin permissions
  2. Session is valid
  3. No maintenance mode active
  4. Check error logs

Settings Not Saving

Solution:

  1. Check file permissions
  2. Verify disk space
  3. Check error logs
  4. Try browser cache clear

Plugin Issues

Solution:

  1. Deactivate problematic plugin
  2. Check plugin compatibility
  3. Review error logs
  4. Contact plugin developer

Resources

Last updated: February 23, 2026

]]>
Users and Groups Management Complete guide to managing users, groups, and permissions in Flatboard 5 https://docs.flatboard.org/users-groups https://docs.flatboard.org/users-groups Sat, 20 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team users groups permissions management moderation

Sommaire

Users and Groups Management

User Management

Viewing Users

Access: Admin Panel > Users

The user list displays:

  • Username and email
  • User group
  • Registration date
  • Last activity
  • Post count
  • Reputation

Filters:

  • Search by username or email
  • Filter by group
  • Filter by status (active, banned, pending)

User Profiles

Click on a username to view:

  • Profile information
  • Activity statistics
  • Recent posts and discussions
  • Reputation history
  • Badges and achievements

Creating Users

  1. Click "Add User"
  2. Fill in details:
    • Username - Unique identifier
    • Email - Valid email address
    • Password - Strong password
    • User Group - Assign initial group
  3. Click "Create User"

Editing Users

  1. Find user in list
  2. Click "Edit"
  3. Modify:
    • Account Info - Username, email, password
    • Profile - Bio, location, website, avatar
    • Preferences - Language, timezone, notifications
    • Group - Change user group
    • Permissions - Override group permissions
  4. Click "Save"

Deleting Users

  1. Find user in list
  2. Click "Delete"
  3. Choose deletion options:
    • Delete Posts - Remove all user posts
    • Anonymize Posts - Keep posts but remove author
    • Transfer Content - Move to another user
  4. Confirm deletion

User Groups

Default Groups

Flatboard 5 includes these default groups:

Guest

  • Permissions: View discussions and posts
  • Cannot: Post, reply, or access member features
  • Use Case: Unregistered visitors

Member

  • Permissions: Full posting and interaction
  • Can: Create discussions, reply, upload files
  • Use Case: Regular registered users

Moderator

  • Permissions: All member permissions plus moderation
  • Can: Edit/delete posts, manage discussions, handle reports
  • Use Case: Community moderators

Admin

  • Permissions: Full system access
  • Can: Everything, including system settings
  • Use Case: Forum administrators

Creating Custom Groups

  1. Go to Admin Panel > Users > Groups
  2. Click "New Group"
  3. Configure:
    • Name - Group display name
    • Color - Group color (for badges)
    • Icon - Group icon
    • Description - Group description
  4. Set permissions (see Permission System below)
  5. Click "Create Group"

Editing Groups

  1. Find group in list
  2. Click "Edit"
  3. Modify settings and permissions
  4. Click "Save"

Deleting Groups

  1. Reassign all users to another group
  2. Click "Delete" on group
  3. Confirm deletion

Permission System

Permission Types

Flatboard 5 uses a hierarchical permission system:

View Permissions

  • View Forum - Access the forum
  • View Categories - See category listings
  • View Discussions - Read discussions
  • View Posts - Read posts

Post Permissions

  • Create Discussions - Start new discussions
  • Reply to Discussions - Post replies
  • Edit Own Posts - Edit own content
  • Delete Own Posts - Remove own content

Moderation Permissions

  • Edit Any Post - Edit all posts
  • Delete Any Post - Delete all posts
  • Pin Discussions - Pin to top
  • Lock Discussions - Lock discussions
  • Move Discussions - Move between categories
  • Manage Reports - Handle user reports

Administrative Permissions

  • Manage Users - User administration
  • Manage Groups - Group management
  • Manage Categories - Category management
  • Manage Settings - System settings
  • Manage Plugins - Plugin administration
  • Manage Themes - Theme management

Setting Permissions

Group Permissions

  1. Go to Admin Panel > Users > Groups
  2. Select group
  3. Click "Permissions"
  4. Enable/disable permissions
  5. Click "Save"

User-Specific Permissions

  1. Edit user
  2. Go to "Permissions" tab
  3. Override group permissions
  4. Click "Save"

Permission Inheritance

Permissions follow this hierarchy:

  1. User-specific - Highest priority
  2. Group permissions - Default for group members
  3. Category permissions - Category-specific overrides
  4. Default permissions - System defaults

User Bans

Banning Users

  1. Find user in list
  2. Click "Ban"
  3. Configure ban:
    • Reason - Why user is banned
    • Duration - Temporary (with end date) or permanent
    • IP Ban - Ban by IP address
    • Email Ban - Ban by email domain
  4. Click "Ban User"

Ban Types

Temporary Ban

  • Set end date
  • User can return after ban expires
  • Automatic unban on expiration

Permanent Ban

  • No end date
  • Requires manual unban
  • Use for serious violations

IP Ban

  • Bans by IP address
  • Affects all users from that IP
  • Use carefully (may affect legitimate users)

Managing Bans

Access: Admin Panel > Users > Bans

  • View all active bans
  • Edit ban details
  • Unban users
  • View ban history

Unbanning Users

  1. Go to Admin Panel > Users > Bans
  2. Find banned user
  3. Click "Unban"
  4. Confirm unban

User Statistics

Viewing Statistics

Access user profile to see:

  • Posts Count - Total posts made
  • Discussions Count - Discussions created
  • Reputation - Reputation points
  • Registration Date - When user joined
  • Last Activity - Last login/activity
  • Online Status - Currently online/offline

User Activity

View detailed activity:

  • Recent posts
  • Recent discussions
  • Reactions given/received
  • Mentions
  • Subscriptions

Best Practices

User Management

  • Regular Review - Review user list periodically
  • Monitor Activity - Watch for inactive accounts
  • Handle Reports - Respond to user reports promptly
  • Clear Communication - Explain bans and actions

Group Management

  • Minimal Groups - Create only necessary groups
  • Clear Permissions - Set explicit permissions
  • Document Groups - Document group purposes
  • Regular Review - Review group permissions regularly

Permission Management

  • Principle of Least Privilege - Grant minimum necessary permissions
  • Test Permissions - Test after changes
  • Document Changes - Keep permission change log
  • Regular Audit - Review permissions periodically

Troubleshooting

User Can't Post

Check:

  1. User group has post permissions
  2. Category allows posting
  3. User is not banned
  4. No rate limiting blocking

Permission Not Working

Solution:

  1. Check group permissions
  2. Check user-specific overrides
  3. Check category permissions
  4. Clear cache and test

Ban Not Working

Check:

  1. Ban is active (not expired)
  2. IP ban matches user IP
  3. User hasn't changed IP
  4. Check ban logs

Resources

Last updated: February 23, 2026

]]>
Categories and Discussions Learn how to create, manage, and organize categories and discussions with advanced sorting and filtering options https://docs.flatboard.org/categories-discussions https://docs.flatboard.org/categories-discussions Fri, 19 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team categories discussions posts organization moderation

Sommaire

Categories and Discussions

Categories

Understanding Categories

Categories are the top-level organizational structure of your forum. They group related discussions together and help users find content easily.

Best Practices:

  • Keep category count manageable (5-15 categories)
  • Use clear, descriptive names
  • Add helpful descriptions
  • Organize hierarchically when needed

Creating Categories

Access: Admin Panel > Discussions > Categories

  1. Click "New Category"
  2. Fill in details:
    • Name - Category display name (e.g., "General Discussion")
    • Slug - URL-friendly identifier (auto-generated from name)
    • Description - Category description (supports Markdown)
    • Parent Category - For subcategories (optional)
    • Icon - Category icon (Font Awesome class)
    • Color - Category color (hex code)
    • Order - Display order (lower numbers appear first)
  3. Set permissions:
    • View - Who can view this category
    • Post - Who can create discussions
    • Reply - Who can reply to discussions
  4. Click "Create Category"

Category Structure Example

General
├── Announcements (subcategory)
├── Introductions (subcategory)
└── Off-Topic (subcategory)

Support
├── Installation Help
├── Configuration
└── Troubleshooting

Development
├── Feature Requests
├── Bug Reports
└── Code Sharing

Editing Categories

  1. Find category in list
  2. Click "Edit"
  3. Modify settings
  4. Click "Save"

Deleting Categories

  1. Click "Delete" on category
  2. Choose action:
    • Delete All Content - Remove category and all content
    • Move Discussions - Move discussions to another category
  3. Confirm deletion

Category Permissions

Set category-specific permissions:

  • View Category - Who can see the category
  • Create Discussions - Who can start discussions
  • Reply to Discussions - Who can post replies
  • Moderate - Who can moderate this category

Discussions

Creating Discussions

As a User:

  1. Navigate to a category
  2. Click "New Discussion"
  3. Fill in:
    • Title - Clear, descriptive title
    • Content - Discussion content (Markdown supported)
    • Tags - Relevant tags (optional)
    • Attachments - Upload files (if enabled)
  4. Click "Create Discussion"

Best Practices for Titles:

  • Be specific and descriptive
  • Use proper capitalization
  • Avoid all caps or excessive punctuation
  • Search before posting to avoid duplicates

Discussion Features

Pinning Discussions

Pin important discussions to the top:

  1. Open discussion
  2. Click "Pin" (admin/moderator only)
  3. Discussion appears at top of category

Locking Discussions

Lock discussions to prevent new replies:

  1. Open discussion
  2. Click "Lock" (admin/moderator only)
  3. Users can view but not reply

Moving Discussions

Move discussions between categories:

  1. Open discussion
  2. Click "Move" (admin/moderator only)
  3. Select target category
  4. Confirm move

Deleting Discussions

  1. Open discussion
  2. Click "Delete" (admin/moderator only)
  3. Confirm deletion

Discussion Sorting

Users can sort discussions by:

  • Latest - Most recently active
  • Oldest - Oldest first
  • Most Replies - Highest reply count
  • Most Views - Highest view count
  • Title - Alphabetical

Discussion Filtering

Filter discussions by:

  • Tags - Filter by specific tags
  • Author - Filter by discussion creator
  • Date Range - Filter by creation date
  • Status - Pinned, locked, normal

Posts

Creating Posts

Posts are replies within discussions:

  1. Open a discussion
  2. Scroll to reply box
  3. Write your reply (Markdown supported)
  4. Add attachments if needed
  5. Click "Post Reply"

Post Features

Editing Posts

  • Own Posts - Users can edit their own posts (if enabled)
  • Time Limit - Edit window may be limited (e.g., 15 minutes)
  • Edit History - Previous versions are saved

Deleting Posts

  • Own Posts - Users can delete their own posts (if enabled)
  • Moderator Delete - Moderators can delete any post
  • Soft Delete - Posts may be soft-deleted (hidden but recoverable)

Post Reactions

Users can react to posts:

  • Like, Love, Laugh, etc.
  • Reactions appear below post
  • View who reacted

Post Mentions

Mention users in posts:

  • Use @username syntax
  • Mentioned users receive notifications
  • Mentions are clickable links

Post Moderation

Moderators can:

  • Edit Posts - Modify content
  • Delete Posts - Remove posts
  • Split Posts - Move to new discussion
  • Merge Posts - Combine multiple posts
  • Warn User - Send warning about post

Tags

Using Tags

Tags help organize and find content:

  1. When creating a discussion, add tags
  2. Separate multiple tags with commas
  3. Use existing tags or create new ones
  4. Tags are clickable for filtering

Tag Management

Access: Admin Panel > Discussions > Tags

  • View all tags
  • Edit tag names
  • Merge duplicate tags
  • Delete unused tags

Tag Best Practices

  • Use consistent naming
  • Keep tag count reasonable (3-5 per discussion)
  • Use descriptive, specific tags
  • Review and clean up tags regularly

Search and Discovery

Search Functionality

Users can search for:

  • Discussions by title
  • Posts by content
  • Users by username
  • Tags

Search Options:

  • Search in specific categories
  • Filter by date range
  • Filter by author
  • Advanced search operators

Discovery Features

  • Recent Discussions - Latest activity
  • Popular Discussions - Most viewed/replied
  • Trending Tags - Popular tags
  • User Activity - Recent posts by users

Moderation Tools

Reports

Handle user reports:

  1. Access reports in admin panel
  2. Review reported content
  3. Take appropriate action:
    • Dismiss invalid reports
    • Warn users
    • Delete content
    • Ban users

Bulk Actions

Perform actions on multiple items:

  • Bulk delete discussions
  • Bulk move discussions
  • Bulk lock/unlock
  • Bulk pin/unpin

Best Practices

Category Organization

  • Logical Structure - Organize by topic or purpose
  • Clear Names - Use descriptive category names
  • Helpful Descriptions - Explain category purpose
  • Reasonable Count - Don't create too many categories

Discussion Management

  • Clear Titles - Descriptive discussion titles
  • Proper Categorization - Place in correct category
  • Use Tags - Tag appropriately
  • Moderate Actively - Handle reports and issues

Content Quality

  • Encourage Quality - Guide users to post well
  • Set Guidelines - Create posting guidelines
  • Moderate Fairly - Consistent moderation
  • Engage Community - Participate in discussions

Troubleshooting

Discussion Not Appearing

Check:

  1. Category permissions
  2. User permissions
  3. Discussion is not deleted
  4. Cache issues

Can't Create Discussion

Check:

  1. User has create permission
  2. Category allows new discussions
  3. Rate limiting not blocking
  4. User is not banned

Search Not Working

Solution:

  1. Clear search cache
  2. Rebuild search index
  3. Check search permissions
  4. Verify search configuration

Resources

Last updated: February 23, 2026

]]>
Plugin System Complete guide to Flatboard 5 plugin system - creating, installing, and managing plugins https://docs.flatboard.org/plugins https://docs.flatboard.org/plugins Thu, 18 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team plugins development extensions hooks

Sommaire

Plugin System

Understanding Plugins

What are Plugins?

Plugins are self-contained extensions that:

  • Extend Functionality - Add new features to your forum
  • Modify Behavior - Change how things work
  • Integrate Services - Connect with external APIs
  • Customize Experience - Tailor forum to your needs

Plugin Architecture

Plugins follow a structured architecture:

plugins/
└── my-plugin/
    ├── plugin.json          # Plugin metadata
    ├── MyPlugin.php         # Main plugin class
    ├── assets/              # CSS, JS, images
    │   ├── css/
    │   ├── js/
    │   └── img/
    ├── views/               # Template files
    │   └── admin.php
    └── README.md            # Documentation

Installing Plugins

  1. Download the plugin .zip from the Flatboard Resource Center or from the plugin author
  2. Go to Admin → Plugins
  3. Click "Install a plugin"
  4. Select the .zip archive and confirm — the archive is validated, extracted, and the plugin appears in the list automatically

The server validates the archive integrity, MIME type, size, and the presence of a valid plugin.json before extracting.

Method 2: Manual Installation (FTP / SSH)

Plugin packages are distributed as .zip archives. The manual workflow is: download → extract locally → upload the folder → activate.

Step 1: Download and Extract

  1. Download the plugin .zip from the Flatboard Resource Center or from the plugin author
  2. Verify that the plugin is compatible with your Flatboard 5 version
  3. Extract the archive on your local machine — you should get a folder (e.g. my-plugin/) with plugin.json at its root

Step 2: Upload the Plugin Folder

Via FTP

Connect to your server with an FTP client (FileZilla, Cyberduck, etc.) and upload the extracted plugin folder into the plugins/ directory of your Flatboard installation:

your-flatboard/
└── plugins/
    └── my-plugin/        ← upload this folder (not the .zip)
        ├── plugin.json
        └── ...
Via SSH

If you have shell access, you can extract the archive directly on the server:

cd /path/to/your-flatboard/plugins/
unzip my-plugin.zip          # extracts to my-plugin/
chmod 755 my-plugin/ -R      # adjust permissions if needed

Step 3: Activate the Plugin

Once the plugin folder is in place:

  1. Go to Admin → Plugins
  2. Find the plugin in the list — it will appear as inactive
  3. Click Activate

Step 4: Configure (if applicable)

If the plugin has settings, click the settings icon next to the plugin name, fill in the options, and save.

Creating a Plugin

Step 1: Create Plugin Structure

mkdir -p plugins/my-plugin/{assets/{css,js,img},views}

Step 2: Create plugin.json

{
  "id": "my-plugin",
  "name": "My Plugin",
  "version": "1.0.0",
  "description": "A custom plugin for Flatboard 5",
  "author": "Your Name",
  "license": "GPL3",
  "requires": {
    "flatboard": ">=5.0.0"
  },
  "class": "App\\Plugins\\MyPlugin\\MyPluginPlugin"
}

Step 3: Create Plugin Class

plugins/my-plugin/MyPluginPlugin.php:

<?php
namespace App\Plugins\MyPlugin;

use App\Core\Plugin;

class MyPluginPlugin
{
    public function boot()
    {
        // Register hooks
        Plugin::hook('view.header.content', [$this, 'addHeaderContent']);
        Plugin::hook('app.routes.register', [$this, 'registerRoutes']);
    }

    public function addHeaderContent(&$content)
    {
        $content .= '<link rel="stylesheet" href="proxy.php?url=/plugins/my-plugin/assets/css/style.css">';
    }

    public function registerRoutes($router)
    {
        $router->get('/my-plugin', function() {
            return 'Hello from my plugin!';
        });
    }
}

Step 4: Register Hooks

Flatboard 5 provides many hooks:

  • app.routes.register - Register custom routes
  • view.header.styles - Add CSS styles to header
  • view.footer.content - Add content to footer
  • view.post.avatar - Override post avatar rendering
  • view.user.avatar - Override user avatar rendering anywhere on the forum
  • discussion.created - When discussion is created
  • post.created - When post is created
  • user.registered - When user registers
  • user.updated - When user is updated
  • notification.types.register - Register custom notification types
  • visitor.page_info - Provide page metadata for presence indicator

See the complete hook list below for all available hooks.

Plugin Hooks

Available Hooks

Complete reference of all 74 hooks available in Flatboard 5. All data arguments marked by ref are passed by PHP reference — modifying them changes the actual value used by the framework.

Application

Hook Trigger point Data
app.routes.register Application bootstrap Router instance
router.plugins.register Router dispatch Router instance
security.csp.directives CSP header generation CSP directives array by ref

View — Layout

Hook Trigger point Data
view.header.styles <head> (frontend + backend) Styles array by ref
view.footer.scripts </body> (frontend + backend) Scripts array by ref
view.footer.content Footer (frontend) HTML content array by ref
view.footer.links Footer links (frontend) Links array by ref
view.navbar.items Main navigation bar Nav items array by ref
view.main.before Before main content (frontend) HTML string by ref
view.main.after After main content (frontend) HTML string by ref
view.admin.sidebar.items Admin sidebar Sidebar items array by ref
view.admin.main.before Before admin main content HTML string by ref
view.admin.main.after After admin main content HTML string by ref

View — Banner

Hook Trigger point Data
view.banner.data Banner component render Banner data array by ref
view.banner.content Banner component render HTML string by ref, banner data

View — SEO

Hook Trigger point Data
seo.meta.before <head> meta tags SEO data array by ref
seo.meta.after After default meta tags Additional meta HTML string by ref

View — Auth Forms

Hook Trigger point Data
view.login.form Login page + login modal Form fields array by ref
view.login.validation Login form submission Validation error by ref
view.user.register.form Registration page + modal Form fields array by ref
view.user.register.validation Registration form submission Validation error by ref

View — Discussions & Replies

Hook Trigger point Data
view.discussion.create.form New discussion form Form fields array by ref
view.discussion.create.validation Discussion creation submission Validation error by ref
view.discussion.show.before_content Discussion view (before first post) Event data array by ref
view.discussion.show.after_content Discussion view (after first post) Event data array by ref
view.reply.create.form Reply form Form fields array by ref
view.reply.create.validation Reply submission Validation error by ref
view.sidebar.navigation Discussion list sidebar Sidebar items array by ref
view.post.avatar Post thread component — avatar render ['user_id', 'username', 'avatar', 'size', 'html'] by ref — set html to override the default <img> output
view.user.avatar components/avatar.php and discussion-item list (author + last-post author) ['user_id', 'username', 'avatar', 'size', 'html'] by ref — set html to override the rendered avatar for any user across the forum

Content Events

Hook Trigger point Data
discussion.created After discussion saved Enriched event data array
discussion.created.legacy After discussion saved Created discussion (legacy format)
discussion.deleted After discussion deleted Discussion data
best_answer.set Best answer selected ['discussion_id', 'post_id', 'user_id']
post.created After reply saved Created post data
post.updated After reply edited Updated post data
post.deleted After reply deleted Post data
category.created After category saved Created category data
category.updated After category updated Updated category data
category.deleted After category deleted Category data
tag.created After tag saved Tag data

User Events

Hook Trigger point Data
user.registered After registration Created user data
user.updated After user profile saved Updated user data
user.deleted After user account deleted User data
ban.created After ban applied Updated user data
ban.removed After ban lifted Updated user data
user.profile.tabs Profile page render Tabs array by ref, user array, isOwnProfile bool
user.profile.tab.contents Profile page render Tab contents array by ref, user array, isOwnProfile bool
user.settings.notifications Notifications settings form Options array by ref, preferences array
user.settings.notifications.save Notifications settings save Preferences array by ref, request data, user
user.settings.preferences.save General preferences save Preferences array by ref, request data, user

Moderation

Hook Trigger point Data
report.created After content report saved Created report data
Hook Trigger point Data
search.results Search service (all types) Results array by ref, query, type, keywords, filters
search.before.display Before HTML search results Results array by ref, query, type, filters
search.ajax.results Before AJAX search results Results array by ref, query, type, filters

Notifications

Hook Trigger point Data
notification.types.register NotificationService::validateNotificationType() — called at boot time $allowedTypes array by ref — append custom type strings to extend the core whitelist
notification.before.create Before notification written Notification data array by ref, type string
notification.after.create After notification written Notification ID, notification data
notification.email.body Before notification email sent Email body string by ref, notification data

Markdown & Editor

Hook Trigger point Data
markdown.parse Markdown rendering (all contexts) Result array by ref, raw markdown string
markdown.editor.config Editor component init Config array by ref, $editorId
component.markdown-editor.before Before editor textarea HTML string by ref, $editorId
component.markdown-editor.attributes Editor textarea tag Attributes array by ref, $editorId, config
markdown.editor.init Editor JS init script Script string by ref, $editorId, config
markdown.editor.getValue Editor getValue script Script string by ref, $editorId
markdown.editor.setValue Editor setValue script Script string by ref, $editorId, value path
component.markdown-editor.after After editor textarea HTML string by ref, $editorId

Presence & Visitor Tracking

Hook Trigger point Data
visitor.page_info Visitor::getPageInfo() — unknown URLs only ['page' => string, 'info' => array] by ref — set info['type'], info['title'], info['url']
visitor.before_track VisitorTrackingMiddleware before write ['ip_address', 'user_agent', 'page', 'user_id'] by ref
presence.anonymous_visitors PresenceService::getActiveAnonymousVisitorsDetailed() Visitors array by ref
presence.bots PresenceService::getActiveBotsDetailed() Bots array by ref
presence.users PresenceService::getActiveUsersDetailed() Users array by ref

Admin

Hook Trigger point Data
admin.dashboard.widgets Admin dashboard render Widgets array by ref

Plugin Views

Hook Trigger point Data
plugin.view.index Plugin index view rendered ['pluginId', 'viewName', 'viewVars'] by ref
plugin.view.{viewName} Named plugin view rendered ['pluginId', 'viewName', 'viewVars'] by ref
plugin.view.index.permissions Before plugin index view Permissions array by ref, pluginId, 'index'
plugin.view.{viewName}.permissions Before named plugin view Permissions array by ref, pluginId, viewName
plugin.view.{viewName}.vars Before named plugin view ViewVars array by ref, pluginId, viewName
plugin.view.admin.vars Before plugin admin view ViewVars array by ref, pluginId, 'admin'
plugin.view.privacy.vars Before plugin privacy view ViewVars array by ref, pluginId, 'privacy'
plugin.view.cookies.vars Before plugin cookies view ViewVars array by ref, pluginId, 'cookies'

Webhooks

Hook Trigger point Data
webhook.received Inbound webhook payload Webhook data array

Using Hooks

// Register a hook
Plugin::hook('discussion.created', function($discussion) {
    // Do something when discussion is created
    Logger::info("New discussion: " . $discussion['title']);
});

// Register with priority
Plugin::hook('post.created', [$this, 'handlePostCreated'], 10);

// Extend the notification type whitelist (by reference)
Plugin::hook('notification.types.register', function(array &$types): void {
    $types[] = 'my_custom_type';
    $types[] = 'reputation_badge';
});

// Override avatar rendering for a virtual user (by reference)
Plugin::hook('view.user.avatar', function(array &$data): void {
    if ($data['user_id'] === 'my-bot') {
        $data['html'] = '<span class="avatar-bot"><i class="fas fa-robot"></i></span>';
    }
});

Plugin Configuration

Settings Storage

Plugin settings are stored in the "plugin" section of plugin.json and accessed via Plugin::getData(). Do not use Config::get/set for plugin-specific settings.

use App\Core\Plugin;

// Read a setting (with optional default)
$value = Plugin::getData('my-plugin', 'setting', 'default');

// Dot-notation is supported for nested keys
$host = Plugin::getData('my-plugin', 'smtp.host', '');

// Write a setting (in-memory only)
Plugin::setData('my-plugin', 'setting', 'value');

// Persist all settings to plugin.json
Plugin::saveData('my-plugin', ['setting' => 'value', 'another' => 'data']);

Admin Interface

Create admin settings page:

  1. Create view file: views/admin.php
  2. Register admin route
  3. Handle form submission
  4. Save settings to config

Best Practices

Plugin Development

  • Follow Structure - Use standard plugin structure
  • Namespace Properly - Use proper namespaces
  • Document Code - Add comments and documentation
  • Handle Errors - Implement error handling
  • Test Thoroughly - Test before release

Security

  • Validate Input - Always validate user input
  • Sanitize Output - Sanitize all output
  • Check Permissions - Verify user permissions
  • Use CSRF Protection - Protect forms with CSRF tokens

Performance

  • Lazy Load - Load assets only when needed
  • Cache When Possible - Cache expensive operations
  • Minimize Queries - Optimize database/file access
  • Use Hooks Efficiently - Don't overload hooks

Managing Plugins

Activating/Deactivating

  • Activate - Enable plugin functionality
  • Deactivate - Disable without uninstalling

Uninstalling a Plugin

Uninstalling permanently removes a plugin and all its data from your forum.

Using the Admin Panel

  1. Navigate to Admin → Plugins
  2. Deactivate the plugin first — the Uninstall button is blocked for active plugins
  3. Click the Uninstall button (trash icon, red/danger style) next to the plugin
  4. Confirm in the confirmation dialog that appears
  5. The server will:
    • Run the plugin's uninstall() hook (if defined), then deactivate() hook
    • Remove all plugin permissions
    • Clear asset and translation caches
    • Remove the plugin's entry from plugins.enabled
    • Recursively delete the plugin directory from plugins/

Restrictions

  • Core plugins (marked cantDisable = "1" in plugin.json) cannot be uninstalled — the button is hidden
  • Active plugins cannot be uninstalled — deactivate the plugin first

Implementing the Uninstall Hook

Plugins can run cleanup logic when uninstalled:

public function uninstall(): void
{
    // Clean up plugin-specific data in stockage/, custom tables, etc.
    // Called before the plugin directory is deleted
}

public function deactivate(): void
{
    // Called when plugin is deactivated (also called during uninstall)
}

Updating Plugins

  1. Backup - Backup your forum first
  2. Download - Get new plugin version
  3. Replace Files - Replace plugin files
  4. Clear Cache - Clear forum cache
  5. Test - Test plugin functionality

Plugin Dependencies

Some plugins require other plugins:

{
  "requires": {
    "flatboard": ">=5.0.0",
    "plugins": {
      "another-plugin": ">=1.0.0"
    }
  }
}

Troubleshooting

Plugin Not Loading

Check:

  1. Plugin structure is correct
  2. plugin.json is valid
  3. Plugin class exists and is correct
  4. Check error logs

Plugin Conflicts

Solution:

  1. Deactivate conflicting plugins
  2. Check hook priorities
  3. Review plugin code
  4. Contact plugin developers

Plugin Errors

Solution:

  1. Check error logs
  2. Enable debug mode (temporarily)
  3. Review plugin code
  4. Check Flatboard 5 compatibility

Resources

Last updated: March 10, 2026

]]>
Theme System Complete guide to creating and customizing themes for Flatboard 5 https://docs.flatboard.org/themes-guide https://docs.flatboard.org/themes-guide Wed, 17 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team themes customization design css templates

Sommaire

Theme System

Theme Overview

What are Themes?

Themes control the visual appearance and layout of your forum:

  • Colors and Styles - Visual design
  • Layout Structure - Page organization
  • Typography - Fonts and text styling
  • Components - UI elements styling

Theme Structure

themes/
└── my-theme/
    ├── theme.json           # Theme metadata
    ├── assets/              # CSS, JS, images
    │   ├── css/
    │   │   ├── frontend.css
    │   │   └── admin.css
    │   ├── js/
    │   │   └── main.js
    │   └── img/
    │       └── logo.png
    └── views/               # Template overrides (optional)
        └── layouts/

Theme Configuration

theme.json

Every theme requires a theme.json file:

{
  "name": "My Theme",
  "id": "my-theme",
  "version": "1.0.0",
  "description": "A custom theme for Flatboard 5",
  "author": "Your Name",
  "author_url": "https://example.com",
  "author_email": "[email protected]",
  "screenshot": "screenshot.png",
  "requires": {
    "flatboard": ">=5.0.0"
  },
  "styles": [
    "assets/css/frontend.css"
  ],
  "scripts": [
    "assets/js/main.js"
  ],
  "variables": {
    "primary_color": "#007bff",
    "secondary_color": "#6c757d"
  },
  "hide_color_settings": false,
  "theme_settings": {},
  "form_config": {}
}

Advanced Configuration Options

Hide Color Settings

If your theme manages colors differently (e.g., using CSS variables or external frameworks), you can hide the color customization panel:

{
  "hide_color_settings": true
}

When set to true, the color settings section will not appear in the admin panel. This is useful for themes like Bootswatch that manage colors through their own system.

Advanced Theme Settings

Add custom configuration options that appear in the admin panel:

{
  "theme_settings": {
    "layout_style": "default",
    "enable_animations": true,
    "custom_option": "value"
  }
}

Form Configuration (form_config)

Create advanced configuration forms with multiple field types:

{
  "form_config": {
    "form_id": "my_theme_config",
    "form_title": "Theme Configuration",
    "submit_text": "Save Settings",
    "fields": {
      "layout_style": {
        "type": "select",
        "label": "Layout Style",
        "description": "Choose the layout style",
        "default": "default",
        "category": "general",
        "options": {
          "default": "Default",
          "wide": "Wide",
          "compact": "Compact"
        }
      },
      "enable_animations": {
        "type": "checkbox",
        "label": "Enable Animations",
        "description": "Enable smooth animations",
        "default": true,
        "category": "general"
      },
      "custom_html": {
        "type": "textarea",
        "label": "Custom HTML",
        "description": "Add custom HTML content",
        "default": "",
        "category": "advanced"
      }
    },
    "categories": {
      "general": "General",
      "advanced": "Advanced"
    }
  }
}

Supported field types:

  • select - Dropdown menu with options
  • checkbox - Boolean checkbox
  • textarea - Multi-line text input (supports HTML)
  • text - Single-line text input

Creating a Theme

Step 1: Create Directory

mkdir -p themes/my-theme/assets/{css,js,img}

Step 2: Create theme.json

Create the theme configuration file with metadata.

Step 3: Create Stylesheet

assets/css/frontend.css:

/* Theme Variables */
:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --background-color: #ffffff;
  --text-color: #212529;
  --border-color: #dee2e6;
}

/* Global Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
}

/* Header */
.header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem;
}

/* Navigation */
.nav {
  display: flex;
  gap: 1rem;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.25rem;
  background-color: var(--primary-color);
  color: white;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.9;
}

Step 4: Create JavaScript (Optional)

assets/js/main.js:

// Theme JavaScript
document.addEventListener('DOMContentLoaded', function() {
  // Your theme-specific JavaScript
  console.log('Theme loaded!');
});

Theme Customization

CSS Variables

Use CSS variables for easy customization:

:root {
  --theme-primary: #007bff;
  --theme-secondary: #6c757d;
  --theme-background: #ffffff;
  --theme-text: #212529;
}

Color Schemes

Support light/dark modes:

/* Light mode */
:root {
  --bg-color: #ffffff;
  --text-color: #000000;
}

/* Dark mode */
[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #ffffff;
}

Responsive Design

Use media queries for mobile support:

/* Desktop */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Tablet */
@media (max-width: 768px) {
  .container {
    max-width: 100%;
    padding: 0 1rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .container {
    padding: 0 0.5rem;
  }
}

Installing a Theme

  1. Download the theme .zip from the Flatboard Resource Center or from the theme author
  2. Go to Admin → Themes
  3. Click "Install a theme"
  4. Select the .zip archive and confirm — the archive is validated, extracted, and the theme appears in the list automatically

The server validates the archive integrity, MIME type, size, and the presence of a valid theme.json before extracting.

Method 2: Manual Installation (FTP / SSH)

The manual workflow is: download → extract locally → upload the folder → activate.

Step 1: Download and Extract

  1. Download the theme .zip from the Flatboard Resource Center or from the theme author
  2. Extract the archive on your local machine — you should get a folder (e.g. my-theme/) with theme.json at its root

Step 2: Upload the Theme Folder

Via FTP

Connect to your server with an FTP client (FileZilla, Cyberduck, etc.) and upload the extracted theme folder into the themes/ directory of your Flatboard installation:

your-flatboard/
└── themes/
    └── my-theme/         ← upload this folder (not the .zip)
        ├── theme.json
        └── assets/
Via SSH

If you have shell access, extract directly on the server:

cd /path/to/your-flatboard/themes/
unzip my-theme.zip     # extracts to my-theme/

Step 3: Activate the Theme

Once the folder is uploaded, go to Admin → Themes, find your theme in the list, and click Activate. The theme is applied immediately.

Activating an Installed Theme

From Admin Panel

  1. Go to Admin → Themes
  2. Find your theme in the list
  3. Click Activate
  4. Theme is immediately active

Manual Activation

If needed, you can manually set the active theme by editing config.json:

{
  "theme": {
    "active": "my-theme"
  }
}

Template Overrides

Override Views

Create custom templates:

themes/my-theme/views/
├── layouts/
│   └── main.php
├── discussions/
│   └── list.php
└── posts/
    └── view.php

Template Hierarchy

Flatboard 5 checks in this order:

  1. Theme views (if exists)
  2. Default views

Theme Best Practices

Design Principles

  • Consistency - Maintain consistent styling
  • Accessibility - Ensure WCAG compliance
  • Performance - Optimize CSS and JS
  • Responsiveness - Support all screen sizes

Code Quality

  • Organize CSS - Use logical structure
  • Comment Code - Add helpful comments
  • Minimize CSS - Remove unused styles
  • Validate - Validate CSS/HTML

Testing

  • Multiple Browsers - Test in Chrome, Firefox, Safari, Edge
  • Mobile Devices - Test on phones and tablets
  • Different Resolutions - Test various screen sizes
  • Accessibility - Test with screen readers

Default Themes

Flatboard 5 includes several default themes:

Default Theme

  • Name: Default
  • Description: Thème par défaut de Flatboard 5 avec un design moderne et épuré, supportant les modes clair et sombre
  • Version: 5.0.0
  • Edition: Available in both Community and Pro editions
  • Clean, modern design
  • Responsive layout
  • Light and dark mode support
  • Customizable color variables
  • Standard theme settings

Premium Theme

  • Name: Premium
  • Description: Thème premium sophistiqué démontrant toutes les possibilités avancées de personnalisation de Flatboard 5
  • Version: 5.0.0
  • Edition: Available in Pro edition only
  • Advanced customization options
  • Multiple layout options (default, centered, wide, compact)
  • Animation support (none, subtle, normal, high)
  • Parallax effects
  • Customizable hero sections
  • Advanced form configuration (form_config)
  • Multiple navbar styles (default, glass, solid, transparent)
  • Card styles (elevated, bordered, minimal)
  • Extensive theme settings

Bootswatch Theme

  • Name: Bootswatch
  • Description: Thème intégrant tous les thèmes Bootswatch pour Bootstrap 5. Sélectionnez parmi 26 thèmes Bootswatch disponibles
  • Version: 1.0.0
  • Edition: Available in both Community and Pro editions
  • Based on Bootstrap 5
  • 26 color schemes available (Brite, Cerulean, Cosmo, Cyborg, Darkly, Flatly, Journal, Litera, Lumen, Lux, Materia, Minty, Morph, Pulse, Quartz, Sandstone, Simplex, Sketchy, Slate, Solar, Spacelab, Superhero, United, Vapor, Yeti, Zephyr)
  • Professional appearance
  • Theme selector in admin panel
  • Color settings hidden (hide_color_settings: true) - colors managed by Bootswatch system

Futurist CyberNeon Theme

  • Name: Futurist CyberNeon
  • Description: Thème futuriste ultra-moderne avec des néons cyberpunk, des effets lumineux dynamiques et un design immersif
  • Version: 5.1.0
  • Cyberpunk aesthetic
  • Neon glow effects
  • Holographic effects
  • Animated gradients
  • Perfect for tech and gaming communities

Nord Theme

  • Name: Nord
  • Description: Thème arctique inspiré de Nord Theme avec une palette de couleurs polaire harmonieuse
  • Version: 1.0.0
  • Arctic color palette
  • Polar-inspired design
  • Clean and minimal

Christmas Theme

  • Name: Christmas 2025
  • Description: Thème festif de Noël avec animations de flocons de neige, couleurs chaleureuses et effets visuels magiques
  • Version: 1.0.0
  • Festive holiday design
  • Snowflake animations
  • Garland effects
  • Warm color scheme

Theme Customization via Admin

Most themes support admin customization through the admin panel:

  1. Go to Admin → Themes
  2. Select active theme
  3. Click "Customize" or "Configure"
  4. Modify settings:
    • Color Variables - Customize primary, secondary, background, and text colors (unless hide_color_settings is enabled)
    • Theme Settings - Configure theme-specific options defined in theme_settings
    • Advanced Configuration - Use form_config for complex settings with multiple field types
    • Logo Configuration - Upload and configure theme logo
  5. Preview changes
  6. Save

Color Customization

By default, themes expose color variables that can be customized in the admin panel:

  • Primary and secondary colors
  • Success, danger, warning, info colors
  • Background colors (light and dark modes)
  • Text colors (light and dark modes)

Advanced Configuration

Themes can define advanced configuration forms using form_config:

  • Select Fields - Dropdown menus with predefined options
  • Checkboxes - Boolean toggles for features
  • Text Areas - Multi-line inputs (supports HTML for custom content)
  • Text Fields - Single-line inputs
  • Categories - Organize settings into groups

These settings are automatically saved and can be accessed in your theme's PHP templates via the theme configuration system.

Troubleshooting

Theme Not Loading

Check:

  1. Theme directory structure is correct
  2. theme.json is valid
  3. CSS/JS files exist
  4. Check error logs

Styles Not Applying

Solution:

  1. Clear browser cache
  2. Clear Flatboard cache
  3. Check CSS file paths
  4. Verify file permissions

Theme Conflicts

Solution:

  1. Deactivate other themes
  2. Check for CSS conflicts
  3. Review theme code
  4. Test in isolation

Migration from Flatboard 4

Migration Steps

  1. Analyze Old Theme - Review structure and styles
  2. Create New Structure - Set up Flatboard 5 theme structure
  3. Port Styles - Adapt CSS to new HTML
  4. Update Templates - Recreate template overrides
  5. Test - Test all pages and features

Publishing Your Theme

Once you've created your theme, you can share it with the Flatboard community by publishing it in the Flatboard Resource Center.

Publishing Requirements

Before submitting your theme, ensure:

  • ✅ Theme follows Flatboard 5 structure
  • theme.json is complete and valid
  • ✅ Screenshot included (screenshot.png)
  • ✅ Theme is tested and working
  • ✅ Documentation included (README.md)
  • ✅ No security vulnerabilities
  • ✅ Compatible with latest Flatboard 5 version

Submit Your Theme

  1. Visit the Flatboard Resource Center
  2. Log in to your account
  3. Select "Theme" as resource type
  4. Fill in theme information:
    • Theme name and description
    • Version number
    • Compatibility (Community/Pro/Both)
    • Screenshot
    • Download link or file
  5. Submit for review

Theme Distribution

After approval, your theme will be:

  • Listed in the Resource Center
  • Searchable by users
  • Available for download
  • Rated and reviewed by users
  • Potentially featured if exceptional

Resources

Last updated: March 12, 2026

]]>
Security Best Practices Comprehensive security guide covering CSRF protection, rate limiting, permissions, and hardening techniques https://docs.flatboard.org/security https://docs.flatboard.org/security Tue, 16 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team security csrf permissions hardening protection

Sommaire

Security Best Practices

Security Overview

Flatboard 5 includes multiple security layers:

  • CSRF Protection - Prevents cross-site request forgery
  • Rate Limiting - Prevents abuse and brute force attacks
  • Input Validation - Sanitizes all user input
  • Permission System - Granular access control
  • Secure Sessions - Encrypted session management
  • File Upload Security - Validates and restricts uploads

CSRF Protection

What is CSRF?

Cross-Site Request Forgery (CSRF) attacks trick users into performing actions they didn't intend.

How Flatboard 5 Protects

  • CSRF Tokens - All forms include CSRF tokens
  • Token Validation - Tokens are validated on submission
  • Automatic Handling - Protection is automatic, no configuration needed

Best Practices

  • Never Disable CSRF - Always keep CSRF protection enabled
  • Use HTTPS - Encrypt connections to protect tokens
  • Validate Tokens - Always validate in custom code

Rate Limiting

Purpose

Rate limiting prevents:

  • Brute force attacks
  • Spam and abuse
  • Resource exhaustion
  • DDoS attacks

Configuration

Access: Admin Panel > Settings > Security

Configure limits for:

  • Login Attempts - Max attempts per IP (default: 5)
  • Registration Attempts - Max registrations per IP (default: 3)
  • Password Reset - Max requests per hour (default: 3)
  • Post Creation - Max posts per time period
  • API Requests - Max API calls per key

Rate Limit Headers

Flatboard 5 sends rate limit headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640995200

Input Validation

Sanitization

All user input is sanitized:

  • HTML Sanitization - Removes dangerous HTML
  • SQL Injection Prevention - Parameterized queries (SQLite)
  • XSS Prevention - Escapes output
  • Path Traversal Prevention - Validates file paths

Validation Rules

  • Email - Valid email format
  • URL - Valid URL format
  • Username - Alphanumeric and allowed characters
  • Password - Meets strength requirements
  • File Uploads - Valid file types and sizes

Permission System

Principle of Least Privilege

Grant minimum necessary permissions:

  1. Default Deny - Deny by default
  2. Explicit Allow - Explicitly grant permissions
  3. Regular Review - Review permissions regularly
  4. Document Changes - Keep permission change log

Permission Levels

  • Guest - View only
  • Member - Post and interact
  • Moderator - Moderate content
  • Admin - Full system access

Best Practices

  • Separate Roles - Use different accounts for admin/moderator
  • Limit Admin Count - Keep admin accounts minimal
  • Review Regularly - Audit permissions periodically
  • Use Groups - Manage via groups, not individual users

Password Security

Requirements

Configure strong password requirements:

  • Minimum Length - At least 8 characters (recommended: 12+)
  • Complexity - Require uppercase, numbers, special characters
  • No Common Passwords - Block common passwords
  • Password History - Prevent password reuse

Password Hashing

Flatboard 5 uses:

  • bcrypt - Secure password hashing
  • Salt - Unique salt per password
  • Cost Factor - Configurable bcrypt cost

Two-Factor Authentication (2FA)

Enable 2FA for additional security:

  1. Enable in Settings - Admin Panel > Settings > Security
  2. User Setup - Users configure in profile
  3. Backup Codes - Generate backup codes
  4. Recovery - Account recovery options

File Upload Security

Restrictions

  • File Types - Only allowed MIME types
  • File Size - Maximum file size limits
  • File Validation - Validates actual file content
  • Virus Scanning - Optional virus scanning

Configuration

// Allowed file types
$allowedTypes = ['image/jpeg', 'image/png', 'application/pdf'];

// Maximum file size (2MB)
$maxSize = 2 * 1024 * 1024;

// Upload directory
$uploadDir = 'uploads/attachments/';

Best Practices

  • Whitelist Types - Only allow necessary file types
  • Scan Uploads - Scan for malware
  • Isolate Uploads - Store outside web root when possible
  • Validate Content - Check actual file content, not just extension

Session Security

Configuration

  • Secure Cookies - Use HTTPS-only cookies
  • HttpOnly - Prevent JavaScript access
  • SameSite - CSRF protection
  • Session Timeout - Automatic logout after inactivity

Session Timeouts & Fingerprinting

Flatboard 5 enforces layered session protection via App\Core\Session:

Constant Value Effect
REGENERATE_INTERVAL 1800 s Session ID is automatically regenerated every 30 minutes
IDLE_TIMEOUT 3600 s Session expires after 1 hour of inactivity
MAX_LIFETIME 86400 s Absolute session maximum regardless of activity (24 hours)
REMEMBER_ME_LIFETIME 2592000 s Cookie and session lifetime when "Remember Me" is checked (30 days)

Session fingerprinting — on each request, a fingerprint is computed as SHA-256(User-Agent + Accept-Language). If the fingerprint changes mid-session, the session is immediately invalidated to prevent hijacking. IP validation is also performed by default and can be toggled for CDN/mobile environments:

Session::disableIpValidation();   // e.g., for users behind a CDN or mobile network
Session::enableIpValidation();    // default — re-enable IP binding

Advanced Session Methods

Available for plugin developers:

// Get and immediately remove a value (useful for one-time tokens)
$value = Session::pull('key', $default);

// Atomically increment/decrement a session counter
Session::increment('login_attempts', 1);
Session::decrement('credits', 1);

// Set a flash value visible only on the NEXT request
Session::flashNext('success', 'Saved!');
$message = Session::getFlash('success');

// Get only user-scoped session data (excludes internal _security, _remember_me, etc.)
$userData = Session::allUser();

// Session metadata for debugging
$meta = Session::metadata();
// Returns: id, started_at, last_activity, fingerprint, age, idle_time

// Migrate session data to a new ID without destroying the old one
Session::migrate();

Best Practices

  • Use HTTPS - Always use HTTPS in production
  • Regenerate IDs - Regenerate session ID on login
  • Short Timeout - Set reasonable session timeout
  • Secure Storage - Store sessions securely

Server Hardening

File Permissions

Set correct permissions:

# Directories
chmod 755 app/ themes/ plugins/ languages/
chmod 750 stockage/ uploads/

# Files
chmod 644 *.php
chmod 600 stockage/json/config.json

Directory Protection

Protect sensitive directories:

# .htaccess in stockage/
<FilesMatch "\.(json|log)$">
    Deny from all
</FilesMatch>

PHP Configuration

Secure PHP settings:

; Disable dangerous functions
disable_functions = exec,passthru,shell_exec,system

; Hide PHP version
expose_php = Off

; Error reporting (production)
display_errors = Off
log_errors = On

Security Headers

Add security headers:

# Apache .htaccess
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-XSS-Protection "1; mode=block"
Header set Referrer-Policy "strict-origin-when-cross-origin"
# Nginx configuration
add_header X-Content-Type-Options "nosniff";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy "strict-origin-when-cross-origin";

Regular Security Maintenance

Checklist

  • [ ] Update Regularly - Keep Flatboard 5 updated
  • [ ] Update Plugins - Update plugins regularly
  • [ ] Review Logs - Check error and access logs
  • [ ] Monitor Activity - Watch for suspicious activity
  • [ ] Backup Regularly - Maintain regular backups
  • [ ] Review Permissions - Audit user permissions
  • [ ] Test Security - Perform security audits

Security Audits

Regular security audits:

  1. Review Users - Check for suspicious accounts
  2. Check Permissions - Verify permission settings
  3. Review Logs - Analyze error and access logs
  4. Test Updates - Test updates in staging
  5. Monitor Performance - Watch for unusual activity

Incident Response

If Compromised

  1. Isolate - Take site offline if necessary
  2. Assess - Determine extent of compromise
  3. Contain - Prevent further damage
  4. Remediate - Fix vulnerabilities
  5. Notify - Inform users if data exposed
  6. Document - Document incident and response

Prevention

  • Regular Backups - Maintain backups
  • Monitor Logs - Watch for anomalies
  • Update Promptly - Apply security updates
  • Limit Access - Minimize admin access
  • Use HTTPS - Encrypt all connections

Resources

Last updated: February 23, 2026

]]>
Performance Optimization Guide to optimizing Flatboard 5 performance including caching, asset optimization, and database tuning https://docs.flatboard.org/performance https://docs.flatboard.org/performance Mon, 15 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team performance optimization caching speed

Sommaire

Performance Optimization

Performance Overview

Flatboard 5 is designed for performance:

  • Denormalized Counters - Fast statistics without complex queries
  • Markdown Caching - Pre-rendered Markdown content
  • Atomic File Operations - Safe concurrent file access
  • Asset Optimization - Minified and combined assets
  • Efficient Storage - Optimized JSON/SQLite access

Caching

Markdown Cache

Flatboard 5 caches rendered Markdown:

  • Automatic Caching - Markdown is cached after first render
  • Cache Invalidation - Cache cleared when content updated
  • Performance Gain - Up to 70% faster page loads

Enable/Disable:

  • Admin Panel > Settings > Performance > Enable Cache

Template Cache

Cache compiled templates:

  • Faster Rendering - Templates compiled once
  • Reduced CPU - Less processing per request
  • Automatic Updates - Cache cleared on template changes

Cache Management

Clear Cache:

  • Admin Panel > Tools > Cache > Clear Cache

Rebuild Cache:

  • Admin Panel > Tools > Cache > Rebuild Cache
# Clear cache via CLI
php app/Cli/console.php cache:clear

# Rebuild cache
php app/Cli/console.php cache:rebuild

Asset Optimization

CSS/JavaScript Minification

Flatboard 5 automatically minifies assets:

  • Automatic - Minification happens automatically
  • Cache Busting - Versioned filenames for cache invalidation
  • Combined Files - Multiple files combined when possible
  • Debug Mode Override - When debug mode is enabled, assets are not minified (served in original format for easier debugging)

Configuration:

  • Admin Panel > Settings > Performance > Asset Optimization

Image Optimization

Optimize images before upload:

  • Compress Images - Use tools like TinyPNG
  • Correct Formats - Use WebP when possible
  • Appropriate Sizes - Resize to needed dimensions
  • Lazy Loading - Load images on demand

CDN Integration

Use a CDN for static assets:

  1. Configure CDN - Set CDN URL in settings
  2. Upload Assets - Upload to CDN
  3. Update Paths - Update asset paths
  4. Test - Verify CDN delivery

Storage Optimization

JSON Storage

Optimize JSON storage:

  • Regular Cleanup - Remove old/unused data
  • Archive Old Content - Move old discussions to archive
  • Optimize Structure - Keep JSON files organized

SQLite Optimization (Pro Edition)

Optimize SQLite database:

-- Vacuum database
VACUUM;

-- Analyze tables
ANALYZE;

-- Reindex
REINDEX;

Via Admin Panel:

  • Admin Panel > Tools > Database > Optimize

Storage Cleanup

Regular cleanup tasks:

# Clean old cache files
php app/Cli/console.php cleanup:cache

# Clean empty discussions
php app/Cli/console.php cleanup:empty-discussions

# Clean old storage
php app/Cli/console.php cleanup:storage

Server Optimization

PHP Configuration

Optimize PHP settings:

; Increase memory limit
memory_limit = 256M

; Optimize opcache
opcache.enable = 1
opcache.memory_consumption = 128
opcache.max_accelerated_files = 10000

; Increase execution time if needed
max_execution_time = 60

Web Server Configuration

Apache:

# Enable compression
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule>

# Enable caching
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
</IfModule>

Nginx:

# Enable compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;

# Enable caching
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
    expires 1y;
    add_header Cache-Control "public, immutable";
}

Database Optimization (Pro Edition)

Indexes

Ensure proper indexes:

-- Check indexes
.schema

-- Create indexes if needed
CREATE INDEX idx_discussion_category ON discussions(category_id);
CREATE INDEX idx_post_discussion ON posts(discussion_id);
CREATE INDEX idx_user_email ON users(email);

Query Optimization

Optimize queries:

  • Use Indexes - Ensure indexes on frequently queried columns
  • Limit Results - Use LIMIT for large result sets
  • Avoid N+1 - Batch queries when possible
  • Use Transactions - Group related operations

Monitoring Performance

Performance Metrics

Monitor key metrics:

  • Page Load Time - Target: < 2 seconds
  • Database Queries - Minimize query count
  • Memory Usage - Monitor PHP memory
  • CPU Usage - Watch server CPU

Tools

Browser DevTools:

  • Network tab - Check load times
  • Performance tab - Profile page rendering

Server Monitoring:

  • PHP-FPM status
  • Server resource usage
  • Database query logs

Performance Testing

Test performance:

  1. Load Testing - Use tools like Apache Bench
  2. Profile Code - Use Xdebug profiler
  3. Monitor Logs - Check error and access logs
  4. User Feedback - Gather user experience feedback

Best Practices

General

  • Enable Caching - Always enable caching in production
  • Optimize Assets - Minify and compress assets
  • Use CDN - Serve static assets from CDN
  • Monitor Performance - Regular performance monitoring

Content

  • Limit Post Length - Encourage concise posts
  • Optimize Images - Compress images before upload
  • Archive Old Content - Move old discussions to archive
  • Regular Cleanup - Clean up old/unused data

Server

  • Use PHP 8.1+ - Latest PHP versions are faster
  • Enable OPcache - Enable PHP OPcache
  • Use SSD Storage - Faster disk I/O
  • Adequate Resources - Ensure sufficient RAM/CPU

Troubleshooting

Slow Page Loads

Check:

  1. Cache is enabled
  2. Assets are optimized
  3. Server resources adequate
  4. Database queries optimized
  5. Network latency

High Memory Usage

Solution:

  1. Increase PHP memory limit
  2. Optimize queries
  3. Reduce cache size
  4. Review plugins

Database Slow

Solution:

  1. Add indexes
  2. Optimize queries
  3. Vacuum database (SQLite)
  4. Consider JSON storage for small sites

Resources

Last updated: February 23, 2026

]]>
Email and SMTP Configuration Complete guide to configuring email and SMTP settings in Flatboard 5 for reliable email delivery https://docs.flatboard.org/email-smtp https://docs.flatboard.org/email-smtp Sun, 14 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team email smtp configuration notifications

Sommaire

Email and SMTP Configuration

Email Overview

Flatboard 5 uses email for:

  • User Registration - Email verification
  • Password Reset - Password recovery links
  • Notifications - Discussion and post notifications
  • Administrative - System notifications
  • User Communication - Private messages (if enabled)

SMTP Configuration

Why SMTP?

SMTP (Simple Mail Transfer Protocol) provides:

  • Reliable Delivery - Better delivery rates than PHP mail()
  • Authentication - Secure email sending
  • Tracking - Delivery and bounce tracking
  • Professional - Proper email headers and formatting

Basic SMTP Setup

Access: Admin Panel > Settings > Email

  1. Enable SMTP - Turn on SMTP sending
  2. SMTP Host - Your mail server address
  3. SMTP Port - Usually 587 (TLS) or 465 (SSL)
  4. Encryption - Choose TLS or SSL
  5. Username - SMTP authentication username
  6. Password - SMTP authentication password
  7. From Email - Sender email address
  8. From Name - Sender display name

Common SMTP Providers

Gmail

Host: smtp.gmail.com
Port: 587
Encryption: tls
Username: [email protected]
Password: (App Password - see below)

Outlook/Office 365

Host: smtp.office365.com
Port: 587
Encryption: tls
Username: [email protected]
Password: (Your account password)

SendGrid

Host: smtp.sendgrid.net
Port: 587
Encryption: tls
Username: apikey
Password: (Your SendGrid API key)

Mailgun

Host: smtp.mailgun.org
Port: 587
Encryption: tls
Username: (Your Mailgun SMTP username)
Password: (Your Mailgun SMTP password)

Amazon SES

Host: email-smtp.region.amazonaws.com
Port: 587
Encryption: tls
Username: (Your SES SMTP username)
Password: (Your SES SMTP password)

Testing Email Configuration

Test Email Function

Use the built-in test email:

  1. Go to Admin Panel > Settings > Email
  2. Enter test email address
  3. Click "Send Test Email"
  4. Check inbox for test email

Manual Testing

Test via CLI:

php app/Cli/console.php email:test [email protected]

Troubleshooting Test Emails

If test email fails:

  1. Check SMTP Settings - Verify all settings correct
  2. Check Credentials - Ensure username/password correct
  3. Check Firewall - Ensure SMTP port not blocked
  4. Check Logs - Review error logs for details
  5. Test Connection - Use telnet to test SMTP connection
# Test SMTP connection
telnet smtp.gmail.com 587

Email Templates

Customizing Templates

Email templates can be customized:

  • Registration Email - Welcome message
  • Password Reset - Reset instructions
  • Notification Email - Discussion/post notifications
  • Admin Notifications - System notifications

Template Variables

Use variables in templates:

  • {site_name} - Forum name
  • {site_url} - Forum URL
  • {user_name} - User's name
  • {reset_link} - Password reset link
  • {verification_link} - Email verification link

Email Verification

Enabling Email Verification

  1. Go to Admin Panel > Settings > Users
  2. Enable "Email Verification"
  3. Configure verification email template
  4. Save settings

Verification Process

  1. User registers account
  2. Verification email sent
  3. User clicks verification link
  4. Account activated
  5. User can log in

Resending Verification

Users can request new verification email:

  • Login page > "Resend Verification Email"
  • Enter email address
  • New email sent

Password Reset

Password Reset Flow

  1. User clicks "Forgot Password"
  2. Enters email address
  3. Reset email sent with link
  4. User clicks link
  5. User sets new password
  6. User can log in

Reset Email Configuration

Configure reset email:

  • Reset Link Expiry - How long link is valid (default: 1 hour)
  • Reset Email Template - Customize email content
  • Rate Limiting - Limit reset requests per hour

Email Notifications

User Notifications

Users receive emails for:

  • New Replies - Replies to subscribed discussions
  • Mentions - When mentioned in posts
  • Private Messages - New private messages (if enabled)
  • Quotes - When quoted in posts

Notification Preferences

Users can configure:

  • Email Frequency - Immediate, daily digest, weekly
  • Notification Types - Which notifications to receive
  • Unsubscribe - Unsubscribe from specific notifications

Access: User Profile > Settings > Notifications

Email Best Practices

Deliverability

Improve email deliverability:

  • SPF Records - Configure SPF for your domain
  • DKIM - Set up DKIM signing
  • DMARC - Configure DMARC policy
  • Reputation - Maintain good sender reputation

Content

  • Clear Subject Lines - Descriptive subjects
  • Plain Text Alternative - Include plain text version
  • Unsubscribe Links - Include unsubscribe option
  • Professional Formatting - Clean, professional design

Security

  • Use TLS/SSL - Encrypt SMTP connections
  • Strong Passwords - Use strong SMTP passwords
  • Limit Access - Restrict SMTP access
  • Monitor Logs - Review email logs regularly

Troubleshooting

Emails Not Sending

Check:

  1. SMTP settings are correct
  2. Credentials are valid
  3. Firewall allows SMTP port
  4. SMTP server is accessible
  5. Check error logs

Common Issues:

  • Authentication Failed - Wrong username/password
  • Connection Timeout - Firewall blocking or wrong host
  • SSL/TLS Error - Wrong encryption type
  • Port Blocked - ISP blocking SMTP port

Emails Going to Spam

Solutions:

  1. Configure SPF records
  2. Set up DKIM signing
  3. Use reputable SMTP provider
  4. Avoid spam trigger words
  5. Include unsubscribe links

Rate Limiting

Some providers limit sending:

  • Gmail - 500 emails/day (free), 2000/day (Workspace)
  • SendGrid - Based on plan
  • Mailgun - Based on plan
  • Amazon SES - Starts with sandbox mode

Advanced Configuration

Multiple SMTP Accounts

For high-volume sites, consider:

  • Multiple Providers - Use different providers
  • Load Balancing - Distribute across providers
  • Failover - Automatic failover if one fails

Email Queue

For better performance:

  • Queue Emails - Queue instead of sending immediately
  • Background Processing - Process queue in background
  • Retry Logic - Retry failed sends

Email Logging

Enable email logging:

  • Log All Emails - Log sent emails
  • Log Failures - Log failed sends
  • Delivery Tracking - Track delivery status

Resources

Last updated: February 23, 2026

]]>
API Documentation Complete REST API documentation for Flatboard 5 including authentication, endpoints, and examples https://docs.flatboard.org/api https://docs.flatboard.org/api Sat, 13 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team api rest integration development

Sommaire

API Documentation

API Overview

Base URL

https://yourdomain.com/api

API Version

Current API version: v1

All endpoints are prefixed with /api/v1/

Response Format

All responses are in JSON format:

{
  "success": true,
  "data": {
    // Response data
  },
  "message": "Operation successful"
}

Error Responses

{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Error description"
  }
}

Authentication

API Keys

Generate API keys:

  1. Go to Admin Panel > Settings > API
  2. Click "Generate API Key"
  3. Copy and save the key securely
  4. Use key in API requests

Using API Keys

Include API key in requests:

Header:

X-API-Key: your-api-key-here

Query Parameter:

?api_key=your-api-key-here

OAuth 2.0 (Coming Soon)

OAuth 2.0 support for more advanced authentication.

Rate Limiting

API requests are rate limited:

  • Default Limit: 100 requests per hour per API key
  • Headers:
    • X-RateLimit-Limit - Request limit
    • X-RateLimit-Remaining - Remaining requests
    • X-RateLimit-Reset - Reset timestamp

Endpoints

Discussions

List Discussions

GET /api/v1/discussions

Parameters:

  • category - Filter by category ID
  • page - Page number (default: 1)
  • limit - Results per page (default: 20)
  • sort - Sort order (latest, oldest, popular)

Response:

{
  "success": true,
  "data": {
    "discussions": [
      {
        "id": "123",
        "title": "Discussion Title",
        "slug": "discussion-title",
        "category_id": "456",
        "author": {
          "id": "789",
          "username": "john_doe"
        },
        "created_at": "2025-12-25T10:00:00Z",
        "reply_count": 5,
        "view_count": 100
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 20,
      "total": 50,
      "pages": 3
    }
  }
}

Get Discussion

GET /api/v1/discussions/{id}

Response:

{
  "success": true,
  "data": {
    "discussion": {
      "id": "123",
      "title": "Discussion Title",
      "content": "Discussion content...",
      "category_id": "456",
      "author": {
        "id": "789",
        "username": "john_doe",
        "avatar": "https://example.com/avatar.jpg"
      },
      "created_at": "2025-12-25T10:00:00Z",
      "updated_at": "2025-12-25T11:00:00Z",
      "reply_count": 5,
      "view_count": 100,
      "tags": ["tag1", "tag2"]
    }
  }
}

Create Discussion

POST /api/v1/discussions

Request Body:

{
  "title": "New Discussion",
  "content": "Discussion content...",
  "category_id": "456",
  "tags": ["tag1", "tag2"]
}

Response:

{
  "success": true,
  "data": {
    "discussion": {
      "id": "123",
      "title": "New Discussion",
      // ... full discussion object
    }
  }
}

Posts

List Posts

GET /api/v1/discussions/{discussion_id}/posts

Parameters:

  • page - Page number
  • limit - Results per page

Get Post

GET /api/v1/posts/{id}

Create Post

POST /api/v1/discussions/{discussion_id}/posts

Request Body:

{
  "content": "Post content..."
}

Users

Get User

GET /api/v1/users/{id}

List Users

GET /api/v1/users

Parameters:

  • page - Page number
  • limit - Results per page
  • search - Search by username

Categories

List Categories

GET /api/v1/categories

Get Category

GET /api/v1/categories/{id}

Code Examples

JavaScript (Fetch)

// Get discussions
fetch('https://yourdomain.com/api/v1/discussions', {
  headers: {
    'X-API-Key': 'your-api-key'
  }
})
.then(response => response.json())
.then(data => {
  console.log(data);
});

PHP (cURL)

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://yourdomain.com/api/v1/discussions');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: your-api-key'
]);

$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);

Python (Requests)

import requests

headers = {
    'X-API-Key': 'your-api-key'
}

response = requests.get(
    'https://yourdomain.com/api/v1/discussions',
    headers=headers
)

data = response.json()

Error Codes

Common error codes:

  • 400 - Bad Request
  • 401 - Unauthorized
  • 403 - Forbidden
  • 404 - Not Found
  • 429 - Too Many Requests
  • 500 - Internal Server Error

Best Practices

Security

  • Use HTTPS - Always use HTTPS for API requests
  • Protect API Keys - Never expose API keys in client-side code
  • Rate Limiting - Respect rate limits
  • Validate Input - Validate all input data

Performance

  • Use Pagination - Always paginate large result sets
  • Cache Responses - Cache API responses when appropriate
  • Minimize Requests - Batch requests when possible
  • Use Filters - Use filters to reduce data transfer

Error Handling

  • Check Status Codes - Always check HTTP status codes
  • Handle Errors Gracefully - Implement proper error handling
  • Retry Logic - Implement retry for transient errors
  • Log Errors - Log API errors for debugging

Presence Endpoint

Flatboard 5 provides a presence update endpoint used by the frontend heartbeat to track the current visitor's page in real time.

POST /presence/update         (authenticated users — CSRF protected)
POST /api/presence/update     (API clients)

Request Body:

{
  "page": "/d/123/discussion-title"
}

Response:

{ "success": true }

Webhooks

Flatboard 5 includes a built-in webhook system for real-time notifications to external services. Configure webhooks at Admin Panel → Webhooks.

Webhook Endpoints

Method Endpoint Description
POST /api/webhooks Receive inbound webhook payloads
GET /admin/webhooks List configured webhooks
GET /admin/webhooks/history View delivery history
POST /admin/webhooks/save Create or update a webhook
POST /admin/webhooks/test Send a test payload to a webhook
GET /admin/webhooks/stats Webhook delivery statistics

Supported Events

  • discussion.created — New discussion published
  • post.created — New reply published
  • user.registered — New user registered
  • report.created — Content report submitted

Delivery

Each event sends a POST request to the configured URL with a JSON body and an X-Flatboard-Event header identifying the event type. Delivery history and retry status are available in the admin panel.

Resources

Last updated: February 23, 2026

]]>
Storage System Complete guide to Flatboard 5 storage systems - JSON and SQLite storage options https://docs.flatboard.org/storage https://docs.flatboard.org/storage Fri, 12 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team storage json sqlite database files

Sommaire

Storage System

Storage Overview

JSON Storage

  • Available in: Community and Pro Editions
  • Type: File-based storage
  • Format: JSON files in /stockage/json/
  • Best for: Small to medium communities
  • Pros: Simple, no database, easy backups
  • Cons: Slower for very large datasets

SQLite Storage

  • Available in: Pro Edition only
  • Type: Database storage
  • Format: SQLite database file
  • Best for: Medium to large communities
  • Pros: Better performance, SQL queries, transactions
  • Cons: Requires pdo_sqlite extension

JSON Storage

Structure

JSON storage uses organized file structure:

stockage/json/
├── config.json          # Configuration
├── users/               # User data
│   ├── user_123.json
│   └── user_456.json
├── categories/          # Categories
│   ├── category_1.json
│   └── category_2.json
├── discussions/        # Discussions
│   ├── discussion_1.json
│   └── discussion_2.json
└── posts/              # Posts
    ├── post_1.json
    └── post_2.json

File Format

Example user file (users/user_123.json):

{
  "id": "123",
  "username": "john_doe",
  "email": "[email protected]",
  "password_hash": "$2y$10$...",
  "created_at": "2025-12-25T10:00:00Z",
  "group_id": "member",
  "reputation": 100
}

Advantages

  • No Database Required - Works without database setup
  • Easy Backups - Simple file copy
  • Human Readable - JSON files are readable
  • Portable - Easy to move between servers
  • Version Control - Can use Git for versioning

Limitations

  • Performance - Slower for large datasets
  • Concurrent Access - File locking required
  • No SQL Queries - Limited query capabilities
  • File System - Depends on file system performance

SQLite Storage (Pro Edition)

Database Structure

SQLite uses standard relational database:

-- Users table
CREATE TABLE users (
    id TEXT PRIMARY KEY,
    username TEXT UNIQUE NOT NULL,
    email TEXT UNIQUE NOT NULL,
    password_hash TEXT NOT NULL,
    created_at TEXT NOT NULL,
    group_id TEXT NOT NULL,
    reputation INTEGER DEFAULT 0
);

-- Discussions table
CREATE TABLE discussions (
    id TEXT PRIMARY KEY,
    title TEXT NOT NULL,
    content TEXT NOT NULL,
    category_id TEXT NOT NULL,
    author_id TEXT NOT NULL,
    created_at TEXT NOT NULL,
    reply_count INTEGER DEFAULT 0,
    view_count INTEGER DEFAULT 0
);

Advantages

  • Performance - Faster for large datasets
  • SQL Queries - Full SQL query support
  • Transactions - ACID transactions
  • Indexes - Database indexes for speed
  • Concurrent Access - Better concurrency

Limitations

  • Pro Edition Only - Requires Pro Edition
  • Extension Required - Needs pdo_sqlite
  • Backup Complexity - Database backup required
  • Less Portable - Database file management

Choosing Storage Type

Use JSON When:

  • Small to medium community (< 10,000 users)
  • Simple setup preferred
  • Easy backups needed
  • No database experience
  • Community Edition

Use SQLite When:

  • Medium to large community (> 10,000 users)
  • Better performance needed
  • Complex queries required
  • Pro Edition available
  • Database experience

Migration Between Storage Types

Using StorageMigrator Plugin

  1. Install StorageMigrator plugin
  2. Go to Admin Panel > Storage Migrator
  3. Select target storage type
  4. Review migration preview
  5. Start migration
  6. Verify data after migration

Manual Migration

For advanced users:

  1. Backup Current Data - Full backup
  2. Export Data - Export from current storage
  3. Import Data - Import to new storage
  4. Verify - Check all data migrated
  5. Update Config - Change storage type in config

Storage Optimization

JSON Optimization

  • Regular Cleanup - Remove old/unused files
  • Archive Old Data - Move old content to archive
  • Organize Files - Keep structure organized
  • File Permissions - Set correct permissions

SQLite Optimization

-- Vacuum database
VACUUM;

-- Analyze tables
ANALYZE;

-- Reindex
REINDEX;

-- Optimize
PRAGMA optimize;

Via Admin Panel:

  • Admin Panel > Tools > Database > Optimize

Backup and Restore

JSON Backup

# Backup JSON storage
tar -czf backup-json-$(date +%Y%m%d).tar.gz stockage/json/

# Restore JSON storage
tar -xzf backup-json-20251225.tar.gz

SQLite Backup

# Backup SQLite database
sqlite3 stockage/sqlite/flatboard.db ".backup backup.db"

# Restore SQLite database
sqlite3 stockage/sqlite/flatboard.db < backup.sql

Automated Backups

Set up automated backups:

#!/bin/bash
# Backup script
DATE=$(date +%Y%m%d)
BACKUP_DIR="/backups"

# JSON backup
tar -czf $BACKUP_DIR/json-$DATE.tar.gz stockage/json/

# SQLite backup (if Pro)
if [ -f "stockage/sqlite/flatboard.db" ]; then
    sqlite3 stockage/sqlite/flatboard.db ".backup $BACKUP_DIR/sqlite-$DATE.db"
fi

Storage Maintenance

Regular Maintenance

  • Clean Old Data - Remove old/unused content
  • Optimize Storage - Run optimization commands
  • Check Disk Space - Monitor available space
  • Verify Integrity - Check data integrity

Cleanup Commands

# Clean old cache
php app/Cli/console.php cleanup:cache

# Clean empty discussions
php app/Cli/console.php cleanup:empty-discussions

# Clean old storage
php app/Cli/console.php cleanup:storage

Troubleshooting

Storage Issues

JSON:

  • Check file permissions
  • Verify disk space
  • Check for file locks
  • Review error logs

SQLite:

  • Check database file permissions
  • Verify pdo_sqlite extension
  • Check database integrity
  • Review error logs

Performance Issues

JSON:

  • Consider migrating to SQLite
  • Optimize file structure
  • Archive old data
  • Increase server resources

SQLite:

  • Add indexes
  • Optimize queries
  • Vacuum database
  • Consider JSON for small sites

Best Practices

General

  • Regular Backups - Backup storage regularly
  • Monitor Space - Watch disk usage
  • Optimize Regularly - Run optimization
  • Test Restores - Test backup restoration

JSON Specific

  • Organize Files - Keep structure clean
  • Archive Old Data - Move old content
  • Set Permissions - Correct file permissions
  • Monitor Performance - Watch for slowdowns

SQLite Specific

  • Regular VACUUM - Vacuum database regularly
  • Use Indexes - Add indexes for queries
  • Optimize Queries - Write efficient queries
  • Monitor Size - Watch database growth

Resources

Last updated: February 23, 2026

]]>
Troubleshooting Guide Common problems and solutions for Flatboard 5 installation, configuration, and operation https://docs.flatboard.org/troubleshooting https://docs.flatboard.org/troubleshooting Thu, 11 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team troubleshooting problems solutions errors

Sommaire

Troubleshooting Guide

Installation Issues

PHP Version Too Old

Error: "PHP version 8.0 or higher required"

Solution:

# Check current version
php -v

# Update PHP (Ubuntu/Debian)
sudo apt update
sudo apt install php8.1 php8.1-cli php8.1-fpm

# Update PHP (CentOS/RHEL)
sudo yum install php81 php81-php-cli php81-php-fpm

Missing PHP Extensions

Error: "Required PHP extension missing"

Solution:

# Install required extensions (Ubuntu/Debian)
sudo apt install php8.1-json php8.1-mbstring php8.1-openssl php8.1-fileinfo

# Install required extensions (CentOS/RHEL)
sudo yum install php-json php-mbstring php-openssl php-fileinfo

Permission Denied

Error: "Permission denied" or "Cannot write to directory"

Solution:

# Set ownership (replace www-data with your web server user)
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 755 /var/www/html
sudo chmod -R 750 /var/www/html/stockage
sudo chmod -R 750 /var/www/html/uploads

Installer Not Loading

Symptoms: Blank page or 404 error

Solution:

  1. Check public/index.php exists
  2. Verify Apache mod_rewrite is enabled
  3. Check Nginx configuration
  4. Review PHP error logs: tail -f /var/log/php-errors.log
  5. Verify file permissions

Configuration Issues

Settings Not Saving

Symptoms: Changes not persisting

Solution:

# Check file permissions
chmod 600 stockage/json/config.json
chown www-data:www-data stockage/json/config.json

# Check disk space
df -h

# Check error logs
tail -f stockage/logs/error.log

Email Not Sending

Symptoms: Emails not delivered

Check:

  1. SMTP settings are correct
  2. Credentials are valid
  3. Firewall allows SMTP port
  4. Test email function works

Solution:

  • Verify SMTP host and port
  • Check username/password
  • Test with telnet: telnet smtp.gmail.com 587
  • Review email logs

Timezone Issues

Symptoms: Incorrect timestamps

Solution:

  • Use proper timezone identifier: Europe/Paris (not Paris)
  • Set in Admin Panel > Settings > General
  • Verify PHP timezone: php -i | grep timezone

Performance Issues

Slow Page Loads

Symptoms: Pages load slowly

Check:

  1. Cache is enabled
  2. Assets are optimized
  3. Server resources adequate
  4. Database queries optimized

Solution:

# Enable caching
# Admin Panel > Settings > Performance > Enable Cache

# Clear cache
php app/Cli/console.php cache:clear

# Optimize assets
# Admin Panel > Settings > Performance > Asset Optimization

High Memory Usage

Symptoms: PHP memory errors

Solution:

# Increase PHP memory limit (php.ini)
memory_limit = 256M

Database Slow (SQLite)

Symptoms: Slow queries

Solution:

-- Vacuum database
VACUUM;

-- Analyze tables
ANALYZE;

-- Reindex
REINDEX;

User and Permission Issues

Can't Log In

Symptoms: Login fails

Check:

  1. Username/password correct
  2. Account not banned
  3. Email verified (if required)
  4. Rate limiting not blocking

Solution:

  • Reset password via "Forgot Password"
  • Check user status in admin panel
  • Review rate limit settings
  • Check error logs

Permission Denied

Symptoms: "You don't have permission"

Solution:

  1. Check user group permissions
  2. Verify category permissions
  3. Review user-specific overrides
  4. Clear cache and test

Can't Create Discussion

Symptoms: "Permission denied" when posting

Check:

  1. User has create permission
  2. Category allows new discussions
  3. Rate limiting not blocking
  4. User is not banned

Solution:

  • Verify group permissions
  • Check category settings
  • Review rate limits
  • Check user status

Plugin and Theme Issues

Plugin Not Loading

Symptoms: Plugin doesn't activate

Check:

  1. Plugin structure is correct
  2. plugin.json is valid
  3. Plugin class exists
  4. Check error logs

Solution:

# Check plugin structure
ls -la plugins/my-plugin/

# Validate plugin.json
cat plugins/my-plugin/plugin.json | jq .

# Check error logs
tail -f stockage/logs/error.log

Theme Not Loading

Symptoms: Theme doesn't apply

Check:

  1. Theme directory structure
  2. theme.json is valid
  3. CSS/JS files exist
  4. File permissions

Solution:

  • Verify theme structure
  • Check theme.json syntax
  • Clear browser cache
  • Clear Flatboard cache

Plugin Conflicts

Symptoms: Errors after plugin activation

Solution:

  1. Deactivate conflicting plugins
  2. Check hook priorities
  3. Review plugin code
  4. Contact plugin developers

Storage Issues

JSON Storage Errors

Symptoms: "Cannot write to file" or data loss

Solution:

# Check permissions
chmod 750 stockage/json/
chmod 644 stockage/json/*.json

# Check disk space
df -h

# Verify file locks
lsof stockage/json/

SQLite Errors

Symptoms: Database errors

Check:

  1. pdo_sqlite extension enabled
  2. Database file permissions
  3. Disk space available
  4. Database integrity

Solution:

# Check extension
php -m | grep pdo_sqlite

# Check database
sqlite3 stockage/sqlite/flatboard.db "PRAGMA integrity_check;"

# Repair database
sqlite3 stockage/sqlite/flatboard.db ".recover" | sqlite3 recovered.db

Email Issues

Emails Not Sending

Symptoms: No emails received

Check:

  1. SMTP settings correct
  2. Credentials valid
  3. Firewall allows SMTP
  4. Test email works

Solution:

  • Verify SMTP configuration
  • Test connection: telnet smtp.gmail.com 587
  • Check email logs
  • Review spam folder

Emails Going to Spam

Symptoms: Emails in spam folder

Solution:

  1. Configure SPF records
  2. Set up DKIM signing
  3. Use reputable SMTP provider
  4. Avoid spam trigger words

Security Issues

CSRF Errors

Symptoms: "CSRF token mismatch"

Solution:

  • Clear browser cache
  • Ensure cookies enabled
  • Check session configuration
  • Verify HTTPS if using

Rate Limiting Issues

Symptoms: "Too many requests"

Solution:

  • Wait for rate limit reset
  • Review rate limit settings
  • Contact admin if legitimate
  • Check for abuse

Getting Help

Check Logs

Always check logs first:

# Error logs
tail -f stockage/logs/error.log

# PHP errors
tail -f stockage/logs/php-errors.log

# Access logs (if available)
tail -f /var/log/apache2/access.log

Enable Debug Mode

Temporarily enable debug mode:

// In config.json or via admin panel
"debug": true

Community Support

Common Error Messages

"Class not found"

Solution: Clear cache and check autoloader

"File not writable"

Solution: Fix file permissions

"Database connection failed"

Solution: Check SQLite extension and permissions

"Plugin incompatible"

Solution: Update plugin or check compatibility

Prevention

Regular Maintenance

  • Update Regularly - Keep Flatboard 5 updated
  • Backup Regularly - Maintain backups
  • Monitor Logs - Review logs regularly
  • Test Changes - Test in staging first

Best Practices

  • Follow Installation Guide - Follow official guides
  • Set Correct Permissions - Use recommended permissions
  • Use HTTPS - Always use HTTPS in production
  • Keep Updated - Apply security updates promptly

Resources

Last updated: February 23, 2026

]]>
License Information Complete information about Flatboard 5 licenses - Community and Pro editions, GPL3 license, and purchase requirements https://docs.flatboard.org/licenses https://docs.flatboard.org/licenses Wed, 10 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team license gpl3 community pro purchase

Sommaire

License Information

License Overview

GPL3 License

Both Flatboard Community and Flatboard Pro are licensed under the GNU General Public License version 3 (GPL3).

What this means:

  • Free and Open Source - Source code is freely available
  • Freedom to Use - Use for any purpose
  • Freedom to Modify - Modify the code as needed
  • Freedom to Distribute - Share and distribute
  • Freedom to Study - Study how it works

GPL3 Requirements:

  • If you modify and distribute, you must share your modifications
  • You must include the original license
  • You must include source code

Community Edition

License

  • License: GPL3
  • Cost: Free (Forever)
  • Source Code: Open source
  • Access: Free download from flatboard.org

Features

  • Basic Forum Functionality - Complete forum system
  • User Management - Full user account system
  • Discussion & Post System - Create discussions and posts
  • Core Plugins & Themes - Essential plugins and themes included
  • API Endpoints - REST API access
  • JSON Storage - File-based storage system
  • Documentation - Complete documentation
  • Open Source (GPL3) - Full source code access
  • Community Support - Community-driven support
  • Regular Updates - Free updates and improvements

Usage Rights

You can:

  • ✅ Use for personal or commercial projects
  • ✅ Modify the code
  • ✅ Distribute modified versions (must include GPL3)
  • ✅ Sell services based on Flatboard
  • ✅ Use in client projects

Note: All usage is free and unrestricted for Community edition. Over 10 years of continuous development, free and regularly updated for the community.

Pro Edition

License

  • License: GPL3
  • Cost: €49 (One-time payment, no subscription)
  • Source Code: Open source (GPL3)
  • Access: Purchase required to download

Features

Everything in Community Edition, plus:

  • Premium Plugin Pack - Private Messaging, Forum Monitoring, EasyPages, TUI Editor, Storage Migrator, FlatSEO
  • Premium Theme - Fully-customizable professional theme with dark/light mode, 4 layout styles, 4 navbar styles, and complete color system
  • SQLite Storage - Database storage option for better performance
  • Advanced Analytics - Visit tracking, referrer analysis, engagement metrics, and traffic source dashboard
  • FlatSEO - Complete SEO toolkit: meta management, JSON-LD structured data, XML sitemap, robots.txt editor, 301/302 redirect manager, GA4/GTM integration, per-page overrides, SEO audit
  • Priority Support - Direct support access
  • 3 Years of Feature Updates - Guaranteed feature updates for 3 years
  • No Subscription Required - One-time payment, no recurring fees

Purchase Information

  • Where to Buy: flatboard.org
  • Pricing: €49 (One-time payment)
  • Payment Methods: Various payment options available
  • Delivery: Instant download after purchase
  • Updates: 3 years of feature updates included

Usage Rights

You can:

  • ✅ Use for personal or commercial projects (if you purchased Pro)
  • ✅ Modify the code
  • ✅ Distribute (if you purchased Pro - see distribution conditions below)
  • ✅ Sell services based on Flatboard Pro
  • ✅ Use in client projects

No License Tracking

Distribution Conditions

Version Compatibility

Architecture Information

Version Support

  • Flatboard 5 - Current version, actively supported
  • Flatboard 4 - Last version of previous architecture, may receive security updates
  • Flatboard 3 - No longer supported

License Comparison

Feature Community Pro
License GPL3 GPL3
Cost Free (Forever) €49 (One-time payment)
Source Code Open Open
Storage
JSON Storage
SQLite Storage ✅ (Better performance)
Core Features
Basic Forum Functionality ✅ (Everything in Community)
User Management
Discussion & Post System
Plugins & Themes
Core Plugins & Themes
Premium Plugin Pack ✅ (Private Messaging, Forum Monitoring, EasyPages, TUI Editor, Storage Migrator, FlatSEO)
Premium Themes
API & Development
API Endpoints
Extended API Features
Support & Updates
Documentation
Community Support
Priority Support
Feature Updates ✅ (Regular) ✅ (3 years guaranteed)
Additional
Advanced Analytics
License Tracking
Subscription Required ❌ (No subscription)

Frequently Asked Questions

What is the difference between Community and Pro editions?

Community Edition is free and includes JSON storage and core features. Pro Edition costs €49 (one-time) and includes SQLite storage, premium plugins, premium themes, and priority support. Both editions are open source under GPL3.

Is Pro really GPL3 if I have to pay?

Yes. GPL3 allows charging for distribution. The source code is still open source and you have full GPL3 rights once you obtain it.

Can I use Pro in commercial projects?

Yes, if you purchased it. GPL3 allows commercial use. You can use Flatboard Pro in any project, commercial or personal, provided you have legally purchased Flatboard Pro first.

Do I need to share my modifications?

Only if you distribute. If you modify Flatboard and distribute it (share with others), you must share your modifications under GPL3. If you only use it internally, you don't need to share.

Can I remove the GPL3 license?

No. GPL3 is a copyleft license. You cannot remove it or change the license. All derivatives must remain GPL3.

Is there license tracking?

No. Flatboard Pro does not use any license tracking, activation, or validation systems. Once you download it, you have it.

Can I resell Flatboard Pro?

Yes, with conditions. You can distribute Flatboard Pro, but you must:

  • Have purchased Flatboard Pro first - You can only distribute Flatboard Pro if you have legally purchased it
  • Include the GPL3 license
  • Provide source code
  • Allow recipients the same GPL3 rights

License Text

The full GPL3 license text is available:

Copyright (c) 2015-2026 Frédéric Kaplon and contributors

All Flatboard code is released under the GPL3 license.

Disclaimer

This software is provided "as is" without warranty of any kind. Use at your own risk.

Resources

Last updated: March 6, 2026

]]>
Advanced Features Advanced features and configurations for Flatboard 5 including customizations, integrations, and power user options https://docs.flatboard.org/advanced https://docs.flatboard.org/advanced Tue, 09 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team advanced features customization integration

Sommaire

Advanced Features

Advanced Configuration

Custom Configuration

Edit stockage/json/config.json directly (with caution):

{
  "custom_setting": "value",
  "advanced_option": {
    "enabled": true,
    "config": {}
  }
}

Environment Variables

Use environment variables for sensitive data:

# Set environment variable
export FLATBOARD_DB_PASSWORD="secret"

# Use in PHP
$password = getenv('FLATBOARD_DB_PASSWORD');

Custom Hooks

Create custom hooks in plugins:

Plugin::hook('custom.event', function($data) {
    // Handle custom event
});

CLI Commands

Available Commands

# Configuration
php app/Cli/console.php config:get <key>
php app/Cli/console.php config:set <key> <value>
php app/Cli/console.php config:list

# Cache
php app/Cli/console.php cache:clear
php app/Cli/console.php cache:rebuild

# Plugins
php app/Cli/console.php plugin:activate <plugin>
php app/Cli/console.php plugin:deactivate <plugin>
php app/Cli/console.php plugin:list

# Cleanup
php app/Cli/console.php cleanup:cache
php app/Cli/console.php cleanup:empty-discussions
php app/Cli/console.php cleanup:storage

# Database (Pro Edition)
php app/Cli/console.php db:optimize
php app/Cli/console.php db:backup
php app/Cli/console.php db:restore <file>

Custom Commands

Create custom CLI commands:

// app/Cli/Commands/CustomCommand.php
namespace App\Cli\Commands;

class CustomCommand
{
    public function handle($args)
    {
        // Command logic
    }
}

Advanced Permissions

Custom Permission Checks

Check permissions programmatically:

use App\Helpers\PermissionHelper;

if (PermissionHelper::can('create_discussion', $categoryId)) {
    // User can create discussion
}

Permission Overrides

Override permissions for specific users:

// In user profile
$user->setPermissionOverride('create_discussion', true);

Custom Integrations

Webhook Integration

Set up webhooks for external services:

Plugin::hook('discussion.created', function($discussion) {
    // Send webhook
    $payload = json_encode($discussion);
    file_get_contents('https://webhook.url', [
        'http' => [
            'method' => 'POST',
            'content' => $payload
        ]
    ]);
});

API Integration

Integrate with external APIs:

$response = file_get_contents('https://api.example.com/data', [
    'http' => [
        'header' => 'Authorization: Bearer ' . $apiKey
    ]
]);

Performance Tuning

Advanced Caching

Configure custom cache:

use App\Core\Cache;

Cache::set('custom_key', $data, 3600);
$data = Cache::get('custom_key');

Database Optimization (Pro Edition)

Advanced SQLite optimization:

-- Custom indexes
CREATE INDEX idx_custom ON table(column);

-- Query optimization
EXPLAIN QUERY PLAN SELECT * FROM table WHERE column = ?;

-- Statistics
ANALYZE table;

Custom Views

Override Templates

Create custom template overrides:

themes/my-theme/views/
├── discussions/
│   └── custom-view.php
└── layouts/
    └── custom-layout.php

Custom Routes

Register custom routes:

Plugin::hook('app.routes.register', function($router) {
    $router->get('/custom', function() {
        return view('custom.template');
    });
});

Advanced Security

Custom Middleware

Create custom middleware:

namespace App\Middleware;

use App\Core\Request;
use App\Core\Response;

class CustomMiddleware implements MiddlewareInterface
{
    public function handle(Request $request, Response $response): bool
    {
        // Custom logic — return true to continue, false to stop
        return true;
    }
}

Security Headers

Add custom security headers:

header('X-Custom-Header', 'value');
header('Content-Security-Policy', "default-src 'self'");

Monitoring and Logging

Custom Logging

Create custom log entries:

use App\Core\Logger;

Logger::info('Custom event', ['data' => $data]);
Logger::error('Error occurred', ['error' => $error]);

Performance Monitoring

Monitor performance:

$start = microtime(true);
// Code to monitor
$duration = microtime(true) - $start;
Logger::info('Performance', ['duration' => $duration]);

Advanced Storage

Custom Storage Drivers

Create custom storage drivers (advanced):

class CustomStorageDriver implements StorageInterface
{
    public function save($data) { }
    public function load($id) { }
    public function delete($id) { }
}

Storage Migration

Advanced migration techniques:

// Custom migration script
$oldData = loadFromOldStorage();
$newData = transformData($oldData);
saveToNewStorage($newData);

Custom Features

Custom User Fields

Add custom user fields:

// In plugin
Plugin::hook('user.profile.fields', function(&$fields) {
    $fields[] = [
        'name' => 'custom_field',
        'label' => 'Custom Field',
        'type' => 'text'
    ];
});

Custom Post Types

Create custom post types:

Plugin::hook('post.types.register', function(&$types) {
    $types['custom'] = [
        'name' => 'Custom Post',
        'handler' => CustomPostHandler::class
    ];
});

Integration Examples

Discord Integration

Send notifications to Discord:

Plugin::hook('discussion.created', function($discussion) {
    $webhook = 'https://discord.com/api/webhooks/...';
    $payload = [
        'content' => "New discussion: {$discussion['title']}"
    ];
    file_get_contents($webhook, [
        'http' => [
            'method' => 'POST',
            'content' => json_encode($payload)
        ]
    ]);
});

Slack Integration

Integrate with Slack:

$slackWebhook = 'https://hooks.slack.com/services/...';
$message = ['text' => 'Forum notification'];
file_get_contents($slackWebhook, [
    'http' => [
        'method' => 'POST',
        'content' => json_encode($message)
    ]
]);

Best Practices

Code Organization

  • Use Namespaces - Organize code with namespaces
  • Follow PSR Standards - Adhere to PSR coding standards
  • Document Code - Add comments and documentation
  • Test Thoroughly - Test custom code

Security

  • Validate Input - Always validate user input
  • Sanitize Output - Sanitize all output
  • Use CSRF Protection - Protect forms
  • Check Permissions - Verify permissions

Performance

  • Cache When Possible - Cache expensive operations
  • Optimize Queries - Write efficient queries
  • Minimize Requests - Reduce HTTP requests
  • Use Async - Use asynchronous operations

Resources

Last updated: February 23, 2026

]]>
Updates and Version Management Information about Flatboard 5 updates, version management, and future migration support https://docs.flatboard.org/migration https://docs.flatboard.org/migration Mon, 08 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team update version management

Sommaire

Updates and Version Management

Version Information

Current Status

Flatboard 5 is a stable release.

Version numbering:

  • 5.x.y — stable releases
  • Minor updates (5.0.x) contain bug fixes and small improvements
  • No data migration is required between minor versions of Flatboard 5

Architecture Information

Flatboard 5 is a complete refactoring of the forum software with a new architecture:

  • New MVC Architecture - Completely rewritten codebase
  • Different Storage Structure - New JSON/SQLite storage format
  • Incompatible Plugins - Plugins from v3/v4 don't work
  • Incompatible Themes - Themes from v3/v4 don't work

Edition Information

Community and Pro Editions

Flatboard 5 is available in two editions:

  • Community Edition - Free, includes JSON storage and core features
  • Pro Edition - €49 one-time payment, includes SQLite storage, premium plugins, premium themes, and priority support

Both editions are open source under GPL3.

Updating Flatboard 5

Starting with Flatboard 5.2.1, you can update Flatboard directly from the admin panel without FTP or shell access:

  1. Download the update archive from the resource manager (Community or Pro edition)
  2. Upload the archive via Admin Panel > Tools > Backups — the system automatically detects update archives and routes them to admin/updates
  3. Apply the update from Admin Panel > Tools > Updates — click the Update button on the available archive card

The update is applied in 5 steps (verify → backup → extract → deploy → cleanup). Protected paths (stockage/, uploads/, .env, .htaccess) are never overwritten during deployment.


Manual Update

For minor version updates (e.g., 5.2.3 to 5.2.4):

  1. Backup - Create a backup before updating
  2. Download - Get latest version
  3. Replace Files - Replace files (keep stockage/ and uploads/)
  4. Clear Cache - Clear cache after update
  5. Test - Test functionality

Update Process

Step 1: Create Backup

Using Admin Panel (Recommended):

  1. Navigate to Admin Panel > Tools > Backups
  2. Click "Create Backup"
  3. Select backup options (recommended: select all for full backup)
  4. Wait for backup to complete
  5. Download the backup file by clicking the download icon (⬇️) next to the backup
  6. Save the backup file (backup_YYYY-MM-DD_HH-MM-SS.zip) to your computer

Step 2: Download Latest Version

Download the latest version from the official resources page:

Step 3: Replace Files

Replace application files while preserving your data:

# Backup current installation (if not done via admin panel)
tar -czf backup-$(date +%Y%m%d).tar.gz .

# Extract new version to temporary directory
unzip Flatboard_Pro.zip -d flatboard-new/  # or Flatboard_Community.zip

# Replace files (keep data directories)
cp -r flatboard-new/app/* app/
cp -r flatboard-new/public/* public/
cp -r flatboard-new/themes/* themes/
cp -r flatboard-new/plugins/* plugins/
cp -r flatboard-new/vendor/* vendor/ 2>/dev/null || true

# DO NOT overwrite these directories:
# - stockage/ (contains your data and configuration)
# - uploads/ (contains user uploads)

# Clean up
rm -rf flatboard-new/

Step 4: Clear Cache

After updating, clear the cache:

# Clear cache via CLI
php app/Cli/console.php cache:clear

# Or via Admin Panel
# Go to Admin Panel > Tools > Cache > Clear Cache

Step 5: Verify Update

  1. Check Version - Verify version in Admin Panel
  2. Test Functionality - Test key features
  3. Check Logs - Review error logs for issues
  4. Test Plugins - Verify plugins still work
  5. Test Themes - Verify themes still work

Future Migration Support

Migration tools and detailed procedures will be provided when Flatboard 5 reaches stable release. For now:

  • Flatboard 5 requires a fresh installation
  • Data migration will be supported in future releases
  • Both Community and Pro editions are available for new installations

Resources

Last updated: March 12, 2026

]]>
Backup and Restore Complete guide to backing up and restoring Flatboard 5 installations including automated backups and disaster recovery https://docs.flatboard.org/backup https://docs.flatboard.org/backup Sun, 07 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team backup restore recovery disaster data

Sommaire

Backup and Restore

Why Backups Matter

Importance of Backups

Backups protect against:

  • Data Loss - Accidental deletion or corruption
  • Hardware Failure - Server or disk failures
  • Security Breaches - Malicious attacks
  • Human Error - Mistakes during updates
  • Disasters - Natural disasters or outages

Backup Frequency

Recommended backup schedule:

  • Daily - Full backups for active forums
  • Weekly - Full backups for smaller forums
  • Before Updates - Always backup before updates
  • Before Major Changes - Backup before configuration changes

What to Backup

Essential Files

Backup these directories and files:

Flatboard5/
├── stockage/          # Configuration and data (CRITICAL)
│   ├── json/         # JSON storage files
│   └── sqlite/       # SQLite database (Pro)
├── uploads/          # User uploads (IMPORTANT)
│   ├── avatars/
│   ├── attachments/
│   └── markdown/
├── plugins/          # Installed plugins (OPTIONAL)
├── themes/           # Custom themes (OPTIONAL)
└── languages/        # Custom translations (OPTIONAL)

Critical Data

Must Backup:

  • stockage/json/ - All JSON files (users, discussions, posts, config)
  • stockage/sqlite/ - SQLite database file (Pro)
  • uploads/ - User-uploaded files

Should Backup:

  • stockage/logs/ - Log files
  • Custom plugins and themes
  • Configuration files

Optional:

  • Core application files (can re-download)
  • Default themes and plugins

Backup Methods

The easiest way to create backups is using the built-in backup feature in the admin panel:

Creating a Backup

  1. Navigate to Admin Panel

    • Go to Admin Panel > Tools > Backups
  2. Create Backup

    • Click the "Create Backup" button
    • Select what to include:
      • Configuration - System configuration files
      • Data - All user data (JSON or SQLite)
      • Uploads - User-uploaded files (avatars, attachments, images)
      • Logs - System logs
      • Cache - Cache files
      • Plugins - Installed plugins (select specific plugins or all)
      • Themes - Installed themes (select specific themes or all)
    • Click "Create" and wait for the backup to complete
  3. Download Backup

    • Once created, click the download icon (⬇️) next to the backup in the list
    • The backup file will be downloaded to your computer
    • Backup files are named: backup_YYYY-MM-DD_HH-MM-SS.zip

Uploading a Backup

You can also upload a backup file to the server:

  1. Navigate to Admin Panel

    • Go to Admin Panel > Tools > Backups
  2. Upload Backup

    • Click the "Upload Backup" button
    • Select a ZIP file from your computer
    • The file must:
      • Be a valid ZIP archive
      • Contain a manifest.json file
      • Have a .zip extension
      • Be within your PHP upload_max_filesize / post_max_size limit (displayed on the upload page)
    • Click "Upload" and wait for the upload to complete

Restoring a Backup

  1. Navigate to Admin Panel

    • Go to Admin Panel > Tools > Backups
  2. Restore Backup

    • Find the backup you want to restore in the list
    • Click the "Restore" button
    • Confirm the restoration (this action is irreversible)
    • Wait for the restore to complete
    • Important: You will be logged out after restoring data - you must log in again with the restored admin account

Method 2: Manual Backup

JSON Storage Backup

# Create backup directory
mkdir -p /backups/flatboard-$(date +%Y%m%d)

# Backup JSON storage
tar -czf /backups/flatboard-$(date +%Y%m%d)/json-backup.tar.gz stockage/json/

# Backup uploads
tar -czf /backups/flatboard-$(date +%Y%m%d)/uploads-backup.tar.gz uploads/

# Backup plugins (if custom)
tar -czf /backups/flatboard-$(date +%Y%m%d)/plugins-backup.tar.gz plugins/

# Backup themes (if custom)
tar -czf /backups/flatboard-$(date +%Y%m%d)/themes-backup.tar.gz themes/

SQLite Backup (Pro)

# Backup SQLite database
sqlite3 stockage/sqlite/flatboard.db ".backup /backups/flatboard-$(date +%Y%m%d)/flatboard.db"

# Or copy the file
cp stockage/sqlite/flatboard.db /backups/flatboard-$(date +%Y%m%d)/flatboard.db

Full Backup

# Backup entire installation (excluding core files)
tar -czf /backups/flatboard-full-$(date +%Y%m%d).tar.gz \
    stockage/ \
    uploads/ \
    plugins/ \
    themes/ \
    languages/

Method 3: Automated Backup Script

Create automated backup script:

#!/bin/bash
# backup-flatboard.sh

BACKUP_DIR="/backups/flatboard"
DATE=$(date +%Y%m%d-%H%M%S)
BACKUP_PATH="$BACKUP_DIR/$DATE"

# Create backup directory
mkdir -p "$BACKUP_PATH"

# Backup JSON storage
tar -czf "$BACKUP_PATH/json.tar.gz" stockage/json/

# Backup SQLite (if exists)
if [ -f "stockage/sqlite/flatboard.db" ]; then
    sqlite3 stockage/sqlite/flatboard.db ".backup $BACKUP_PATH/flatboard.db"
fi

# Backup uploads
tar -czf "$BACKUP_PATH/uploads.tar.gz" uploads/

# Backup custom plugins
tar -czf "$BACKUP_PATH/plugins.tar.gz" plugins/

# Backup custom themes
tar -czf "$BACKUP_PATH/themes.tar.gz" themes/

# Create manifest
echo "Backup created: $DATE" > "$BACKUP_PATH/manifest.txt"
echo "Files:" >> "$BACKUP_PATH/manifest.txt"
ls -lh "$BACKUP_PATH" >> "$BACKUP_PATH/manifest.txt"

# Compress everything
tar -czf "$BACKUP_DIR/flatboard-$DATE.tar.gz" -C "$BACKUP_DIR" "$DATE"

# Remove uncompressed directory
rm -rf "$BACKUP_PATH"

# Keep only last 7 days of backups
find "$BACKUP_DIR" -name "flatboard-*.tar.gz" -mtime +7 -delete

echo "Backup completed: $BACKUP_DIR/flatboard-$DATE.tar.gz"

Make executable:

chmod +x backup-flatboard.sh

Method 4: Cron Job Automation

Set up automated daily backups:

# Edit crontab
crontab -e

# Add daily backup at 2 AM
0 2 * * * /path/to/backup-flatboard.sh >> /var/log/flatboard-backup.log 2>&1

Backup Storage

Local Storage

Store backups on the same server:

  • Pros: Fast, easy access
  • Cons: Lost if server fails

Remote Storage

Store backups off-site:

FTP/SFTP

# Upload backup via SFTP
scp backup.tar.gz user@backup-server:/backups/

Cloud Storage

AWS S3:

aws s3 cp backup.tar.gz s3://your-bucket/backups/

Google Cloud Storage:

gsutil cp backup.tar.gz gs://your-bucket/backups/

Dropbox/OneDrive:

  • Use rclone or similar tools

Backup Rotation

Keep multiple backup versions:

# Keep daily backups for 7 days
# Keep weekly backups for 4 weeks
# Keep monthly backups for 12 months

Restore Procedures

The easiest way to restore a backup is using the built-in restore feature in the admin panel:

Step 1: Upload Backup (If Needed)

If your backup is on your computer and not on the server:

  1. Go to Admin Panel > Tools > Backups
  2. Click "Upload Backup" button
  3. Select the backup ZIP file from your computer
  4. Click "Upload" and wait for the upload to complete

The backup file must:

  • Be a valid ZIP archive
  • Contain a manifest.json file
  • Have a .zip extension
  • Be smaller than 500MB (or your PHP upload_max_filesize limit)

Step 2: Restore Backup

  1. Go to Admin Panel > Tools > Backups
  2. Find the backup you want to restore in the list
  3. Click the "Restore" button
  4. Confirm the restoration (this action is irreversible)
  5. Wait for the restore to complete
  6. You will be automatically logged out after restoring data
  7. Log in again with the restored admin account credentials

What Gets Restored

The restore process will restore only what was included in the backup:

  • Configuration - System settings (if included)
  • Data - All user data (users, discussions, posts, categories, etc.) (if included)
  • Uploads - User-uploaded files (avatars, attachments, images) (if included)
  • Logs - System logs (if included)
  • Cache - Cache files (if included)
  • Plugins - Selected plugins (if included)
  • Themes - Selected themes (if included)

Restore from Command Line

Restore JSON Storage

# Stop forum (put in maintenance mode)
# Extract backup
tar -xzf json-backup.tar.gz

# Restore files
cp -r json/* stockage/json/

# Set permissions
chmod 600 stockage/json/config.json
chmod 644 stockage/json/*.json

# Clear cache
php app/Cli/console.php cache:clear

Restore SQLite Database (Pro)

# Stop forum
# Restore database
sqlite3 stockage/sqlite/flatboard.db < backup.sql

# Or restore from backup file
cp backup.db stockage/sqlite/flatboard.db

# Set permissions
chmod 600 stockage/sqlite/flatboard.db

# Verify integrity
sqlite3 stockage/sqlite/flatboard.db "PRAGMA integrity_check;"

Restore Uploads

# Extract backup
tar -xzf uploads-backup.tar.gz

# Restore files
cp -r uploads/* uploads/

# Set permissions
chmod -R 750 uploads/

Full Restore

# Extract full backup
tar -xzf flatboard-full-20251225.tar.gz

# Restore directories
cp -r stockage/ stockage/
cp -r uploads/ uploads/
cp -r plugins/ plugins/
cp -r themes/ themes/

# Set permissions
chmod -R 750 stockage/
chmod -R 750 uploads/
chmod 755 plugins/
chmod 755 themes/

# Clear cache
php app/Cli/console.php cache:clear

Verify Restore

After restoring:

  1. Check Files - Verify all files restored
  2. Test Forum - Access forum and test functionality
  3. Check Data - Verify discussions, posts, users
  4. Test Features - Test key features
  5. Check Logs - Review error logs

Updating Flatboard (Local Update System)

Flatboard supports a local update workflow for offline or self-hosted deployments where the automatic update check URL is not configured or not reachable. This lets you apply official update archives manually without internet access during the update itself.

How It Works

  1. Download a Flatboard update archive (.zip) from the official site or your distribution channel
  2. Upload it via the Backups page — the system detects it as an update and routes it automatically
  3. Apply it from Admin → Tools → Updates using a guided 5-step process

Update archives are standard ZIP files with an embedded manifest.json that identifies them as Flatboard updates:

{
  "type": "update",
  "software": "flatboard",
  "edition": "pro",
  "version": "5.2.1",
  "build_date": "2026-03-10",
  "checksum": "sha256:...",
  "compatible_from": "5.0.0"
}

Step 1: Upload the Update Archive

  1. Go to Admin Panel → Tools → Backups

  2. Click "Upload Backup"

  3. Select the Flatboard update .zip file from your computer

    :::info The upload page displays the effective PHP upload size limit (upload_max_filesize / post_max_size). The client validates the file size before submitting to avoid a failed round-trip. :::

  4. Click "Upload" and wait for the upload to complete

The server detects the archive as a Flatboard update (manifest.type == "update" and manifest.software == "flatboard") and routes it to storage/updates/ instead of storage/backups/. A success notice with a link to Admin → Tools → Updates is displayed.

Step 2: Apply the Update

  1. Go to Admin Panel → Tools → Updates

    The page scans storage/updates/ and displays one card per valid archive:

    Card style Meaning
    Green ("Update") Archive version is newer than the installed version
    Yellow ("Reinstall") Archive version matches the installed version
    Listed for deletion only Archive version is older than the installed version
  2. Click "Update" or "Reinstall" on the desired archive

  3. The 5-step progress UI runs automatically:

    Step What it does
    1 — Verify Validates manifest (edition, semver ≥ current version, checksum)
    2 — Backup Creates a full automatic backup of your forum before touching any files
    3 — Extract Extracts the archive to a temporary directory
    4 — Deploy Copies new files into the installation, skipping protected paths
    5 — Cleanup Removes the temporary extraction directory

    Each step is executed over a separate CSRF-protected AJAX call with retry logic. The UI shows real-time progress and stops with an error message if any step fails.

Protected Paths

The deploy step never overwrites these paths regardless of what the archive contains:

  • stockage/ — all forum data (JSON / SQLite)
  • uploads/ — user-uploaded files
  • .env — environment configuration
  • .htaccess — web server configuration
  • install.php — installer

Managing Old Archives

Archives older than the currently installed version are listed separately on the Updates page with a Delete button. They cannot be applied. Clean them up once you no longer need them.

Disaster Recovery

Complete Server Failure

If server is completely lost:

  1. Provision New Server - Set up new server
  2. Install Flatboard 5 - Fresh installation
  3. Restore Backup - Restore from latest backup
  4. Verify - Test everything
  5. Update DNS - Point domain to new server

Partial Data Loss

If only some data is lost:

  1. Identify Lost Data - Determine what's missing
  2. Restore from Backup - Restore specific files
  3. Merge Data - Merge with existing data if needed
  4. Verify - Check data integrity

Corrupted Data

If data is corrupted:

  1. Stop Forum - Put in maintenance mode
  2. Restore from Backup - Restore last known good backup
  3. Verify Integrity - Check data integrity
  4. Test - Test functionality

Backup Best Practices

Regular Schedule

  • Automate - Use cron jobs for automation
  • Test Restores - Regularly test backup restoration
  • Monitor - Check backup logs regularly
  • Verify - Verify backup integrity

Security

  • Encrypt Backups - Encrypt sensitive backups
  • Secure Storage - Store backups securely
  • Access Control - Limit backup access
  • Off-Site - Keep backups off-site

Documentation

  • Document Process - Document backup procedures
  • Label Backups - Clearly label backup files
  • Keep Logs - Maintain backup logs
  • Update Procedures - Keep procedures current

Troubleshooting

Backup Fails

Check:

  1. Disk space available
  2. File permissions
  3. Backup script permissions
  4. Error logs

Restore Fails

Check:

  1. Backup file integrity
  2. File permissions
  3. Disk space
  4. Compatibility with current version

Backup Too Large

Solutions:

  1. Exclude unnecessary files
  2. Compress more aggressively
  3. Split into multiple backups
  4. Use incremental backups

Resources

Last updated: March 10, 2026

]]>
Developer Guide Complete developer guide for Flatboard 5 including architecture, coding standards, and advanced development techniques https://docs.flatboard.org/development https://docs.flatboard.org/development Sat, 06 Dec 2025 00:00:00 +0100 [email protected] (Flatboard Team) Flatboard Team development architecture code programming api

Sommaire

Developer Guide

Architecture Overview

MVC Pattern

Flatboard 5 follows the Model-View-Controller (MVC) pattern:

app/
├── Controllers/    # Handle requests and logic
├── Models/         # Data models and business logic
├── Views/          # Template files
├── Core/           # Core framework classes
├── Helpers/        # Helper functions
├── Middleware/     # Request middleware
└── Services/      # Service classes

Directory Structure

Flatboard5/
├── app/                    # Application code
│   ├── Controllers/       # Controllers
│   ├── Models/            # Models
│   ├── Views/             # Views
│   ├── Core/              # Core classes
│   ├── Helpers/           # Helpers
│   ├── Middleware/        # Middleware
│   └── Services/          # Services
├── public/                # Public files
│   └── index.php         # Entry point
├── stockage/             # Data storage
├── uploads/              # User uploads
├── plugins/              # Plugins
├── themes/               # Themes
└── vendor/               # Dependencies

Core Components

Autoloader

PSR-4 autoloading:

use App\Core\Autoloader;

Autoloader::register(BASE_PATH);

Router

Route registration (the Router requires Request and Response instances):

use App\Core\Router;
use App\Core\Request;
use App\Core\Response;

$router = new Router($request, $response);
$router->get('/path', 'Controller@method');
$router->post('/path', 'Controller@method');

// Named routes
$router->get('/forum', 'ForumController@index')->name('forum.index');
$url = $router->url('forum.index');                      // Generate URL
$url = $router->url('discussion.show', ['id' => 42]);    // With params

// Route groups (shared prefix + middleware)
$router->group(['prefix' => '/admin', 'middleware' => ['App\Middleware\AuthMiddleware']], function($router) {
    $router->get('/dashboard', 'Admin\DashboardController@index');
});

// Parameter constraints
$router->get('/user/{id}', 'UserController@show')->where('id', '[0-9]+');

// RESTful resource routes (generates GET list, GET show, POST, PUT, DELETE)
$router->resource('/posts', 'PostController');

// Regex-based routes
$router->regex('GET', '#^/custom/(.+)$#', function($matches) { /* ... */ });

// Global before/after hooks (for monitoring, logging)
$router->beforeEach(function($request) { /* ... */ });
$router->afterEach(function($request, $response) { /* ... */ });

// Route cache for production (cached to stockage/cache/routes.php)
$router->enableCache();

Controller

Base controller:

namespace App\Controllers;

use App\Core\Controller;

class MyController extends Controller
{
    public function index()
    {
        return $this->view('template', ['data' => $data]);
    }
}

Model

Base model:

namespace App\Models;

class MyModel
{
    public static function find($id)
    {
        // Load from storage
    }

    public static function create($data)
    {
        // Create new record
    }
}

Coding Standards

PSR Standards

Follow PSR standards:

  • PSR-1 - Basic coding standard
  • PSR-4 - Autoloading standard
  • PSR-12 - Extended coding style

Code Style

<?php
namespace App\Controllers;

use App\Core\Controller;
use App\Models\User;

class UserController extends Controller
{
    public function index()
    {
        $users = User::all();
        return $this->view('users.index', ['users' => $users]);
    }

    public function show($id)
    {
        $user = User::find($id);
        if (!$user) {
            return $this->notFound();
        }
        return $this->view('users.show', ['user' => $user]);
    }
}

Naming Conventions

  • Classes: PascalCase - UserController
  • Methods: camelCase - getUserData()
  • Variables: camelCase - $userData
  • Constants: UPPER_SNAKE_CASE - MAX_FILE_SIZE
  • Files: Match class name - UserController.php

Plugin Development

Plugin Structure

plugins/my-plugin/
├── plugin.json
├── MyPluginPlugin.php
├── assets/
├── views/
└── README.md

Plugin Class

<?php
namespace App\Plugins\MyPlugin;

use App\Core\Plugin;

class MyPluginPlugin
{
    public function boot()
    {
        // Register plugin routes
        Plugin::hook('router.plugins.register', [$this, 'registerRoutes']);
        // Add CSS to page header
        Plugin::hook('view.header.styles', [$this, 'addStyles']);
    }

    public function registerRoutes($router)
    {
        $router->get('/my-plugin', function() {
            return 'Hello from plugin!';
        });
    }

    public function addStyles(&$styles)
    {
        $styles[] = \App\Helpers\PluginAssetHelper::loadCss('my-plugin', 'css/style.css');
    }
}

Available Hooks

Below are the most commonly used hooks for plugin development:

Hook Use case
router.plugins.register Register plugin routes (preferred for plugins)
app.routes.register Register application-level routes
view.header.styles Inject CSS into <head>
view.footer.scripts Inject JS before </body>
view.footer.content Inject HTML into footer
view.navbar.items Add items to the main navigation bar
view.admin.sidebar.items Add items to the admin sidebar
admin.dashboard.widgets Add widgets to the admin dashboard
discussion.created After a discussion is saved
post.created After a reply is saved
user.registered After a user account is created
search.results Filter or augment search results
notification.before.create Intercept notifications before they are written
markdown.editor.config Modify the Markdown editor configuration
visitor.page_info Resolve page info for unknown URLs (presence)
presence.users Filter/enrich active users list

Theme Development

Theme Structure

themes/my-theme/
├── theme.json
├── assets/
│   ├── css/
│   ├── js/
│   └── img/
└── views/

Template Overrides

Override default templates:

themes/my-theme/views/
├── layouts/
│   └── main.php
└── discussions/
    └── list.php

CSS Variables

Use CSS variables for customization:

:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --background-color: #ffffff;
  --text-color: #212529;
}

Plugin Settings API

Plugin settings live in the "plugin" section of plugin.json. Always use Plugin::getData/setData/saveData — never Config::get/set — for plugin-specific values:

use App\Core\Plugin;

// Read a setting (third arg is default value)
$apiKey = Plugin::getData('my-plugin', 'api_key', '');

// Dot-notation for nested keys
$host = Plugin::getData('my-plugin', 'smtp.host', 'localhost');

// Write a setting (in-memory only)
Plugin::setData('my-plugin', 'api_key', 'abc123');

// Persist all settings to plugin.json
Plugin::saveData('my-plugin', ['api_key' => 'abc123', 'enabled' => true]);

// Get plugin stats (for monitoring)
$stats = Plugin::getStats();
// Returns: ['total' => int, 'active' => int, 'inactive' => int, 'hooks' => int]

Presence Service

App\Services\PresenceService provides a unified API for querying who is currently on the forum (all methods are static):

use App\Services\PresenceService;

// All presence data (anonymous visitors + bots + logged-in users)
$all = PresenceService::getAllPresence(minutes: 15, includeBots: true);
// Returns: ['visitors' => [...], 'bots' => [...], 'users' => [...], 'all' => [...], 'stats' => [...]]

// Presence on a specific page
$page = PresenceService::getPresenceByPage('/d/123', minutes: 15);

// Aggregate stats only
$stats = PresenceService::getPresenceStats(minutes: 15);
// Returns: ['total' => int, 'anonymous' => int, 'authenticated' => int, 'bots' => int]

// Filter helpers (work on any presence array)
$filtered = PresenceService::filterByPageType($all['all'], 'discussion');
$filtered = PresenceService::filterByCategory($all['all'], 'general');
$filtered = PresenceService::filterByUserGroup($all['users'], 'moderator');

// Sorting
$sorted = PresenceService::sortPresence($all['all'], sortBy: 'last_activity', order: 'desc');

VisitorTrackingMiddleware runs automatically on every non-AJAX HTML request. It skips: authenticated users, paths under /api/, /presence/update, /favicon.ico, /robots.txt, static file extensions. It fires visitor.before_track before writing each record.

Translation System

Global helper

// Both are equivalent
$text = Translator::trans('key', ['var' => 'value'], 'domain');
$text = __('key', ['var' => 'value'], 'domain');

Advanced methods

// Get current language code
$lang = Translator::getLanguage();   // e.g., 'fr', 'en'

// Change language for the current request
Translator::setLanguage('en');

// Reload all translations from disk
Translator::reload();

// Reload only theme translation overrides
Translator::reloadThemeTranslations();

// Get all keys for a domain (useful for debugging)
$all = Translator::getAll('main');

// Register plugin translations programmatically
Translator::addPluginTranslations('my-plugin', ['key' => 'value']);

Storage Development

JSON Storage

Working with JSON storage:

use App\Core\AtomicFileHelper;

// Read (returns array or null if file absent)
$data = AtomicFileHelper::readAtomic('path/to/file.json');

// Write (returns bool)
AtomicFileHelper::writeAtomic('path/to/file.json', $data);

// Batch read multiple files in one pass
$results = AtomicFileHelper::readAtomicBatch([
    'path/to/file1.json',
    'path/to/file2.json',
]);

SQLite Storage (Pro)

Working with SQLite:

use App\Storage\SqliteStorage;

$storage = new SqliteStorage();
$result = $storage->query('SELECT * FROM users WHERE id = ?', [$id]);

Security Best Practices

Input Validation

Always validate input:

use App\Core\Validator;

$validator = new Validator();
$validator->required('email')->email('email');
if (!$validator->validate($data)) {
    return $this->error($validator->errors());
}

Output Sanitization

Sanitize all output:

use App\Core\Sanitizer;

$clean = Sanitizer::clean($userInput);
echo htmlspecialchars($clean, ENT_QUOTES, 'UTF-8');

CSRF Protection

Use CSRF tokens:

use App\Core\Csrf;

// Generate token
$token = Csrf::token();

// Verify token
if (!Csrf::verify($token)) {
    return $this->error('Invalid CSRF token');
}

Testing

Unit Tests

Write unit tests:

use PHPUnit\Framework\TestCase;

class UserTest extends TestCase
{
    public function testUserCreation()
    {
        $user = User::create([
            'username' => 'testuser',
            'email' => '[email protected]'
        ]);
        $this->assertNotNull($user);
    }
}

Integration Tests

Test integrations:

public function testApiEndpoint()
{
    $response = $this->get('/api/v1/discussions');
    $this->assertEquals(200, $response->getStatusCode());
}

Performance

Caching

Use caching:

use App\Core\Cache;

// Set cache
Cache::set('key', $data, 3600);

// Get cache
$data = Cache::get('key');

// Clear cache
Cache::clear('key');

Database Optimization

Optimize queries:

// Use indexes
// Limit results
// Avoid N+1 queries
// Use transactions

Contributing

Code Contribution

  1. Fork Repository - Fork on GitHub
  2. Create Branch - Create feature branch
  3. Write Code - Follow coding standards
  4. Test - Write and run tests
  5. Submit PR - Submit pull request

Documentation

  • Code Comments - Add helpful comments
  • PHPDoc - Document functions and classes
  • README - Update README if needed
  • Changelog - Update changelog

Version Compatibility

Resources

Last updated: February 23, 2026

]]>