* @copyright 2019 MyAAC
* @link https://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Config Editor';
require_once SYSTEM . 'clients.conf.php';
$message = '';
$config_options = array(
'server_path' => array(
'name' => 'Server Path',
'type' => 'text',
'desc' => 'path to the server directory (same directory where config file is located)'
),
'env' => array(
'name' => 'Environment',
'type' => 'options',
'options' => array('prod' => 'Production', 'dev' => 'Development'),
'desc' => 'if you use this script on your live server - set to Production
if you want to test and debug the script locally, or develop plugins, set to Development
WARNING: on Development cache is disabled, so site will be significantly slower !!!
Recommended: Production cause of speed (page load time is better)'
),
'template' => array(
'name' => 'Template Name',
'type' => 'options',
'options' => '$templates',
'desc' => 'Name of the template used by website'
),
'template_allow_change' => array(
'name' => 'Template Allow Change',
'type' => 'boolean',
'desc' => 'Allow changing template of the website by showing a special select in the part of website'
),
'vocations_amount' => array(
'name' => 'Amount of Vocations',
'type' => 'number',
'desc' => 'how much basic vocations your server got (without promotion)'
),
'client' => array(
'name' => 'Client Version',
'type' => 'options',
'options' => '$clients',
'desc' => 'what client version are you using on this OT?
used for the Downloads page and some templates aswell'
),
'session_prefix' => array(
'name' => 'Session Prefix',
'type' => 'text',
'desc' => 'must be unique for every site on your server',
),
'friendly_urls' => array(
'name' => 'Friendly URLs',
'type' => 'boolean',
'desc' => 'mod_rewrite is required for this, it makes links looks more elegant to eye, and also are SEO friendly (example: https://my-aac.org/guilds/Testing instead of https://my-aac.org/?subtopic=guilds&name=Testing).
Remember to rename .htaccess.dist to .htaccess'
),
'gzip_output' => array(
'name' => 'GZIP Output',
'type' => 'boolean',
'desc' => 'gzip page content before sending it to the browser, uses less bandwidth but more cpu cycles'
),
'backward_support' => array(
'name' => 'Gesior Backward Support',
'type' => 'boolean',
'desc' => 'gesior backward support (templates & pages)
allows using gesior templates and pages with myaac
might bring some performance when disabled'
),
'meta_description' => array(
'name' => 'Meta Description',
'type' => 'textarea',
'desc' => 'description of the site in '
),
'meta_keywords' => array(
'name' => 'Meta Keywords',
'type' => 'textarea',
'desc' => 'keywords list separated by commas'
),
'title_separator' => array(
'name' => 'Title Separator',
'type' => 'text',
'desc' => 'Separator used in the title of the website'
),
'footer' => array(
'name' => 'Footer',
'type' => 'textarea',
'desc' => 'For example: "
Your Server © 2016. All rights reserved."'
),
'language' => array(
'name' => 'Language',
'type' => 'options',
'options' => array('en' => 'English'),
'desc' => 'default language (currently only English available)'
),
'visitors_counter' => array(
'name' => 'Visitors Counter',
'type' => 'boolean',
'desc' => 'Enable Visitors Counter? It will show list of online members on the website in Admin Panel'
),
'visitors_counter_ttl' => array(
'name' => 'Visitors Counter TTL',
'type' => 'number',
'desc' => 'Time To Live for Visitors Counter. In other words - how long user will be marked as online. In Minutes'
),
'views_counter' => array(
'name' => 'Views Counter',
'type' => 'boolean',
'desc' => 'Enable Views Counter? It will show how many times the website has been viewed by users'
),
'cache_engine' => array(
'name' => 'Cache Engine',
'type' => 'text',
'desc' => 'cache system. by default file cache is used.
Other available options: apc, apcu, eaccelerator, xcache, file, auto, or blank to disable'
),
'cache_prefix' => array(
'name' => 'Cache Prefix',
'type' => 'text',
'desc' => 'have to be unique if running more MyAAC instances on the same server (except file system cache)'
),
'database_log' => array(
'name' => 'Database Log',
'type' => 'boolean',
'desc' => 'Should database queries be logged and displayed in the page source? They will be included at the end of the .html source of the page, only for Super Admin'
),
'database_socket' => array(
'name' => 'Database Socket',
'type' => 'text',
'desc' => 'Set if you want to connect to database through socket (example: /var/run/mysqld/mysqld.sock)'
),
'database_persistent' => array(
'name' => 'Database Persistent',
'type' => 'boolean',
'desc' => 'Use database permanent connection (like server), may speed up your site'
),
'outfit_images_url' => array(
'name' => 'Outfit Images URL',
'type' => 'text',
'desc' => 'Set to animoutfit.php for animated outfit'
),
'item_images_url' => array(
'name' => 'Item Images URL',
'type' => 'text',
'desc' => 'Set to images/items if you host your own items in images folder'
),
);
if (isset($_POST['save'])) {
$content = ' $_config) {
$content .= PHP_EOL . "\$config['$key'] = ";
if (in_array($_config['type'], array('boolean', 'number'))) {
$content .= $_POST[$key];
}
else if (in_array($_config['type'], array('text', 'textarea'))) {
$content .= "'" . $_POST[$key] . "'";
}
else if($_config['type'] === 'options') {
if(is_numeric($_POST[$key])) {
$content .= $_POST[$key];
}
else {
$content .= "'" . $_POST[$key] . "'";
}
}
$content .= ';';
}
//$saved = file_put_contents(BASE . 'config.local.php', $content);
$saved = false;
ob_start();
if($saved) {
?>