Configuration Guide

SLAED CMS uses a modular configuration system where each aspect of the system is configured through separate configuration files.

Configuration Structure

SLAED CMS configuration files are organized in the config/ directory:

config/
├── config_db.php          # Database settings
├── config_global.php      # Global settings
├── config_core.php        # Core settings
├── config_security.php    # Security parameters
├── config_*.php           # Module configurations
├── cache/                 # Cached files
└── logs/                  # Log files

Main Configuration

The main database configuration is stored in config/config_db.php:

<?php
if (!defined('FUNC_FILE')) die('Illegal file access');

$confdb = array();
$confdb['host'] = "localhost";              // Database host
$confdb['uname'] = "username";              // Database username
$confdb['pass'] = "password";               // Database password
$confdb['name'] = "database";               // Database name
$confdb['type'] = "mysqli";                 // Database type (mysqli)
$confdb['engine'] = "InnoDB";               // Database engine
$confdb['charset'] = "utf8mb4";             // Character set
$confdb['collate'] = "utf8mb4_unicode_ci";  // Collation
$confdb['prefix'] = "slaed";                // Table prefix
$confdb['sync'] = "0";                      // Time synchronization
$confdb['mode'] = "0";                      // MySQL strict mode

$prefix = "slaed";                          // Prefix (duplicate)
$admin_file = "admin";                      // Admin file name
?>

Core Settings

Core settings are configured in config/config_core.php:

<?php
if (!defined('FUNC_FILE')) die('Illegal file access');

$conf = array(
    // Caching
    'cache_b' => '1',                       // Block caching
    'cache_d' => '7',                       // Cache days
    'cache_t' => '3600',                    // Cache time (seconds)
    'cache_css' => '1',                     // CSS caching
    'cache_script' => '1',                  // JavaScript caching
    
    // Compression
    'css_c' => '1',                         // CSS compression
    'css_h' => '0',                         // CSS in header (inline)
    'css_e' => '0',                         // CSS with base64 images
    'script_c' => '1',                      // JavaScript compression
    'script_h' => '0',                      // JavaScript in header
    'script_a' => '1',                      // Asynchronous JS loading
    'html_compress' => '1',                 // HTML compression
    
    // File loading
    'css_f' => 'templates/[theme]/css/,plugins/system/',  // CSS files
    'script_f' => 'plugins/jquery/jquery.min.js,plugins/system/core.js', // JS files
    
    // Additional settings
    'variables' => '0,1,0',                 // Variable display (debug)
    'foot_time' => '1',                     // Generation time in footer
    'foot_queries' => '1',                  // Query count in footer
);
?>

Security Settings

Security parameters are configured in config/config_security.php:

<?php
if (!defined('FUNC_FILE')) die('Illegal file access');

$confs = array(
    // General protection
    'protection' => '1',                    // Enable protection
    'flood_enable' => '1',                  // Flood protection
    'flood_time' => '30',                   // Action interval (seconds)
    'flood_attempts' => '5',                // Number of attempts
    
    // Authentication
    'login_attempts' => '5',                // Login attempts
    'login_ban_time' => '3600',             // Ban time (seconds)
    'session_lifetime' => '86400',          // Session lifetime
    'remember_time' => '2592000',           // "Remember me" time
    
    // CAPTCHA
    'captcha_enable' => '1',                // Enable CAPTCHA
    'captcha_type' => 'recaptcha3',         // CAPTCHA type
    'recaptcha_site_key' => '',             // reCAPTCHA site key
    'recaptcha_secret_key' => '',           // reCAPTCHA secret key
    'recaptcha_score' => '0.5',             // Minimum score for v3
    
    // Attack protection
    'csrf_protection' => '1',               // CSRF protection
    'xss_filter' => '1',                    // XSS filter
    'sql_injection_filter' => '1',          // SQL injection filter
    'file_upload_check' => '1',             // File upload check
    
    // IP filtering
    'ip_ban_enable' => '1',                 // IP ban
    'ip_whitelist' => '',                   // IP whitelist
    'ip_blacklist' => '',                   // IP blacklist
    
    // Logging
    'log_failed_logins' => '1',             // Log failed logins
    'log_admin_actions' => '1',             // Log admin actions
    'log_file_uploads' => '1',              // Log file uploads
    
    // Additional
    'password_min_length' => '6',           // Minimum password length
    'password_require_special' => '0',      // Require special characters
    'password_require_numbers' => '1',      // Require numbers
    'max_upload_size' => '10240',           // Max upload size (KB)
);
?>

Upload Configuration

File upload settings are configured in config/config_uploads.php:

<?php
if (!defined('FUNC_FILE')) die('Illegal file access');

// Format: 'module' => 'size_KB|file_types|thumbnail|user_folders|active'
$confup = array(
    // Content modules
    'news' => '2048|jpg,jpeg,png,gif|1|0|1',           // News
    'pages' => '5120|jpg,jpeg,png,gif,pdf|1|0|1',      // Pages
    'forum' => '1024|jpg,jpeg,png,gif|1|1|1',          // Forum
    'shop' => '5120|jpg,jpeg,png,gif|1|1|1',           // Shop
    
    // Media content
    'media' => '10240|jpg,jpeg,png,gif,mp4,avi|1|1|1', // Media
    'files' => '51200|zip,rar,pdf,doc,docx,xls,xlsx|0|1|1', // Files
    'links' => '512|jpg,jpeg,png,gif|1|0|1',           // Links
    
    // Users
    'avatars' => '512|jpg,jpeg,png,gif|1|1|1',         // Avatars
    'account' => '2048|jpg,jpeg,png,gif,pdf|1|1|1',    // Accounts
    
    // System
    'content' => '5120|jpg,jpeg,png,gif,pdf|1|0|1',    // Content
    'voting' => '1024|jpg,jpeg,png,gif|1|0|1',         // Voting
);

// Image processing settings
$conf_images = array(
    'quality' => '85',                      // JPEG quality (1-100)
    'thumb_width' => '150',                 // Thumbnail width
    'thumb_height' => '150',                // Thumbnail height
    'thumb_crop' => '1',                    // Crop to size
    'watermark_enable' => '0',              // Watermarks
    'watermark_file' => 'watermark.png',    // Watermark file
    'watermark_position' => 'bottom-right', // Watermark position
);
?>

Module Configuration

Each module has its own configuration file. For example, news module configuration in config/config_news.php:

<?php
if (!defined('FUNC_FILE')) die('Illegal file access');

$confn = array(
    'storyhome' => '5',                     // News on homepage
    'storypage' => '10',                    // News per page
    'readmore' => '500',                    // Characters for "read more"
    'anonymous' => '1',                     // Anonymous comments
    'moderation' => '0',                    // Comment moderation
    'rating' => '1',                        // News rating
    'views' => '1',                         // View counter
    'social' => '1',                        // Social buttons
    'rss' => '1',                           // RSS feed
    'sitemap' => '1',                       // Include in sitemap
);
?>

Caching Configuration

File caching configuration:

// In config_core.php
$conf = array(
    'cache_enable' => '1',                  // Enable caching
    'cache_lifetime' => '3600',             // Lifetime (seconds)
    'cache_compress' => '1',                // Compress cache
    'cache_prefix' => 'slaed_',             // Cache prefix
);

// Cache directories
define('CACHE_DIR', BASE_DIR.'/config/cache');
define('CACHE_BLOCKS_DIR', CACHE_DIR.'/blocks');
define('CACHE_PAGES_DIR', CACHE_DIR.'/pages');
define('CACHE_QUERIES_DIR', CACHE_DIR.'/queries');