Ejemplo n.º 1
0
        ob_start();
    }
}
// Define standard date/time formats
$forum_time_formats = array($pun_config['o_time_format'], 'H:i:s', 'H:i', 'g:i:s a', 'g:i a');
$forum_date_formats = array($pun_config['o_date_format'], 'Y-m-d', 'Y-d-m', 'd-m-Y', 'm-d-Y', 'M j Y', 'jS M Y');
// Check/update/set cookie and fetch user info
$pun_user = array();
check_cookie($pun_user);
// Load the language system
require PUN_ROOT . 'include/classes/lang.php';
$lang = new Flux_Lang();
$lang->setDefaultLanguage('English');
$lang->setLanguage($pun_user['language']);
// Load the common language file
$lang->load('common');
// Check if we are to display a maintenance message
if ($pun_config['o_maintenance'] && $pun_user['g_id'] > PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT')) {
    maintenance_message();
}
// Load cached bans
$pun_bans = $cache->get('bans');
if ($pun_bans === Flux_Cache::NOT_FOUND) {
    // Get the ban list from the DB
    $query = $db->select(array('id' => 'b.id', 'username' => 'b.username', 'ip' => 'b.ip', 'email' => 'b.email', 'message' => 'b.message', 'expire' => 'b.expire', 'ban_creator' => 'b.ban_creator'), 'bans AS b');
    $params = array();
    $pun_bans = $query->run($params);
    unset($query, $params);
    $cache->set('bans', $pun_bans);
}
// Check if current user is banned
Ejemplo n.º 2
0
if (!defined('FORUM_CACHE_DIR')) {
    define('FORUM_CACHE_DIR', PUN_ROOT . 'cache/');
}
// Load the cache module
require PUN_ROOT . 'modules/cache/src/Cache.php';
$cache = Flux_Cache::load('File', array('dir' => FORUM_CACHE_DIR), 'VarExport');
// TODO: Move this config into config.php
// TODO: according to the comment above - how do you want to move this to config when it doesn't exist? :)
// Load the language system
require PUN_ROOT . 'include/classes/lang.php';
$lang = new Flux_Lang();
// If we've been passed a default language, use it
$install_lang = isset($_REQUEST['install_lang']) ? trim($_REQUEST['install_lang']) : 'English';
$lang->setLanguage($install_lang);
// Load the install.php language file
$lang->load('install');
// If PUN is defined, config.php is probably valid and thus the software is installed
if (defined('PUN')) {
    exit($lang->t('Already installed'));
}
// Define PUN because email.php requires it
define('PUN', 1);
// Make sure we are running at least MIN_PHP_VERSION
if (!function_exists('version_compare') || version_compare(PHP_VERSION, MIN_PHP_VERSION, '<')) {
    exit($lang->t('You are running error', 'PHP', PHP_VERSION, FORUM_VERSION, MIN_PHP_VERSION));
}
// Load the DB module
require PUN_ROOT . 'modules/database/src/Database/Adapter.php';
//
// Generate output to be used for config.php
//