Reviewed some settings again, fixing many glitches

This commit is contained in:
slawkens 2023-08-24 17:20:32 +02:00
parent 3ef53aff6c
commit 0746708743
56 changed files with 181 additions and 170 deletions

View File

@ -16,7 +16,7 @@ $title = 'Account editor';
$admin_base = ADMIN_URL . '?p=accounts'; $admin_base = ADMIN_URL . '?p=accounts';
$use_datatable = true; $use_datatable = true;
if ($config['account_country']) if (setting('core.account_country'))
require SYSTEM . 'countries.conf.php'; require SYSTEM . 'countries.conf.php';
$nameOrNumberColumn = 'name'; $nameOrNumberColumn = 'name';
@ -30,7 +30,7 @@ $hasPointsColumn = $db->hasColumn('accounts', 'premium_points');
$hasTypeColumn = $db->hasColumn('accounts', 'type'); $hasTypeColumn = $db->hasColumn('accounts', 'type');
$hasGroupColumn = $db->hasColumn('accounts', 'group_id'); $hasGroupColumn = $db->hasColumn('accounts', 'group_id');
if ($config['account_country']) { if (setting('core.account_country')) {
$countries = array(); $countries = array();
foreach (array('pl', 'se', 'br', 'us', 'gb') as $c) foreach (array('pl', 'se', 'br', 'us', 'gb') as $c)
$countries[$c] = $config['countries'][$c]; $countries[$c] = $config['countries'][$c];

View File

@ -54,7 +54,7 @@ if (!empty($mail_content) && !empty($mail_subject) && empty($mail_to)) {
$failed = 0; $failed = 0;
$add = ''; $add = '';
if (config('account_mail_verify')) { if (setting('core.account_mail_verify')) {
note('Note: Sending only to users with verified E-Mail.'); note('Note: Sending only to users with verified E-Mail.');
$add = ' AND `email_verified` = 1'; $add = ' AND `email_verified` = 1';
} }

View File

@ -569,7 +569,7 @@ else if (isset($_REQUEST['search'])) {
<?php } ?> <?php } ?>
</div> </div>
<div class="tab-pane fade" id="tabs-pos"> <div class="tab-pane fade" id="tabs-pos">
<?php $outfit = $config['outfit_images_url'] . '?id=' . $player->getLookType() . ($hasLookAddons ? '&addons=' . $player->getLookAddons() : '') . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet(); ?> <?php $outfit = setting('core.outfit_images_url') . '?id=' . $player->getLookType() . ($hasLookAddons ? '&addons=' . $player->getLookAddons() : '') . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet(); ?>
<div id="imgchar" style="width:64px;height:64px;position:absolute; top:30px; right:30px"> <div id="imgchar" style="width:64px;height:64px;position:absolute; top:30px; right:30px">
<img id="player_outfit" style="margin-left:0;margin-top:0;width:64px;height:64px;" src="<?php echo $outfit; ?>" alt="player outfit"/> <img id="player_outfit" style="margin-left:0;margin-top:0;width:64px;height:64px;" src="<?php echo $outfit; ?>" alt="player outfit"/>
</div> </div>
@ -858,7 +858,7 @@ else if (isset($_REQUEST['search'])) {
<?php if($hasLookAddons): ?> <?php if($hasLookAddons): ?>
look_addons = '&addons=' + $('#look_addons').val(); look_addons = '&addons=' + $('#look_addons').val();
<?php endif; ?> <?php endif; ?>
$("#player_outfit").attr("src", '<?= $config['outfit_images_url']; ?>?id=' + look_type + look_addons + '&head=' + look_head + '&body=' + look_body + '&legs=' + look_legs + '&feet=' + look_feet); $("#player_outfit").attr("src", '<?= setting('core.outfit_images_url'); ?>?id=' + look_type + look_addons + '&head=' + look_head + '&body=' + look_body + '&legs=' + look_legs + '&feet=' + look_feet);
} }
</script> </script>
<?php } ?> <?php } ?>

View File

@ -1,3 +1,3 @@
To play on {{ config.lua.serverName }} you need an account. To play on {{ config.lua.serverName }} you need an account.
All you have to do to create your new account is to enter an account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %}, password{% if config.account_country %}, country{% endif %} and your email address. All you have to do to create your new account is to enter an account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %}, password{% if setting('core.account_country') %}, country{% endif %} and your email address.
Also you have to agree to the terms presented below. If you have done so, your account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %} will be shown on the following page and your account password will be sent to your email address along with further instructions. If you do not receive the email with your password, please check your spam filter.<br/><br/> Also you have to agree to the terms presented below. If you have done so, your account {% if constant('USE_ACCOUNT_NAME') %}name{% else %}number{% endif %} will be shown on the following page and your account password will be sent to your email address along with further instructions. If you do not receive the email with your password, please check your spam filter.<br/><br/>

View File

@ -1,33 +1,37 @@
<?php <?php
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$reward = config('account_mail_confirmed_reward'); $reward = setting('core.account_mail_confirmed_reward');
$hasCoinsColumn = $db->hasColumn('accounts', 'coins'); $hasCoinsColumn = $db->hasColumn('accounts', 'coins');
if ($reward['coins'] > 0 && $hasCoinsColumn) { $rewardCoins = setting('core.account_mail_confirmed_reward_coins');
log_append('email_confirm_error.log', 'accounts.coins column does not exist.'); if ($rewardCoins > 0 && !$hasCoinsColumn) {
log_append('error.log', 'email_confirm: accounts.coins column does not exist.');
} }
if (!isset($account) || !$account->isLoaded()) { if (!isset($account) || !$account->isLoaded()) {
log_append('email_confirm_error.log', 'Account not loaded.');
return; return;
} }
if ($reward['premium_points'] > 0) { $rewardMessage = 'You received %d %s for confirming your E-Mail address.';
$account->setCustomField('premium_points', (int)$account->getCustomField('premium_points') + $reward['premium_points']);
success(sprintf($reward['message'], $reward['premium_points'], 'premium points')); $rewardPremiumPoints = setting('core.account_mail_confirmed_reward_premium_points');
if ($rewardPremiumPoints > 0) {
$account->setCustomField('premium_points', (int)$account->getCustomField('premium_points') + $rewardPremiumPoints);
success(sprintf($rewardMessage, $rewardPremiumPoints, 'premium points'));
} }
if ($reward['coins'] > 0 && $hasCoinsColumn) { if ($rewardCoins > 0 && $hasCoinsColumn) {
$account->setCustomField('coins', (int)$account->getCustomField('coins') + $reward['coins']); $account->setCustomField('coins', (int)$account->getCustomField('coins') + $rewardCoins);
success(sprintf($reward['message'], $reward['coins'], 'coins')); success(sprintf($rewardMessage, $rewardCoins, 'coins'));
} }
if ($reward['premium_days'] > 0) { $rewardPremiumDays = setting('core.account_mail_confirmed_reward_premium_days');
$account->setPremDays($account->getPremDays() + $reward['premium_days']); if ($rewardPremiumDays > 0) {
$account->setPremDays($account->getPremDays() + $rewardPremiumDays);
$account->save(); $account->save();
success(sprintf($reward['message'], $reward['premium_days'], 'premium days')); success(sprintf($rewardMessage, $rewardPremiumDays, 'premium days'));
} }

View File

@ -68,10 +68,12 @@ $deprecatedConfig = [
'status_ip', 'status_ip',
'status_port', 'status_port',
'mail_enabled', 'mail_enabled',
'mail_address',
'account_login_by_email', 'account_login_by_email',
'account_login_by_email_fallback', 'account_login_by_email_fallback',
'account_mail_verify', 'account_mail_verify',
'account_mail_unique', 'account_mail_unique',
'account_mail_change',
'account_premium_days', 'account_premium_days',
'account_premium_points', 'account_premium_points',
'account_create_character_create', 'account_create_character_create',

View File

@ -151,8 +151,7 @@ function getItemImage($id, $count = 1)
if($count > 1) if($count > 1)
$file_name .= '-' . $count; $file_name .= '-' . $count;
global $config; return '<img src="' . setting('core.item_images_url') . $file_name . setting('core.item_images_extension') . '"' . $tooltip . ' width="32" height="32" border="0" alt="' .$id . '" />';
return '<img src="' . $config['item_images_url'] . $file_name . config('item_images_extension') . '"' . $tooltip . ' width="32" height="32" border="0" alt="' .$id . '" />';
} }
function getItemRarity($chance) { function getItemRarity($chance) {
@ -490,8 +489,8 @@ function template_place_holder($type): string
*/ */
function template_header($is_admin = false): string function template_header($is_admin = false): string
{ {
global $title_full, $config, $twig; global $title_full, $twig;
$charset = $config['charset'] ?? 'utf-8'; $charset = setting('core.charset') ?? 'utf-8';
return $twig->render('templates.header.html.twig', return $twig->render('templates.header.html.twig',
[ [
@ -1036,14 +1035,14 @@ function get_browser_real_ip() {
return '0'; return '0';
} }
function setSession($key, $data) { function setSession($key, $data) {
$_SESSION[config('session_prefix') . $key] = $data; $_SESSION[setting('core.session_prefix') . $key] = $data;
} }
function getSession($key) { function getSession($key) {
$key = config('session_prefix') . $key; $key = setting('core.session_prefix') . $key;
return isset($_SESSION[$key]) ? $_SESSION[$key] : false; return isset($_SESSION[$key]) ? $_SESSION[$key] : false;
} }
function unsetSession($key) { function unsetSession($key) {
unset($_SESSION[config('session_prefix') . $key]); unset($_SESSION[setting('core.session_prefix') . $key]);
} }
function getTopPlayers($limit = 5) { function getTopPlayers($limit = 5) {
@ -1270,7 +1269,7 @@ function getCustomPage($name, &$success): string
set_error_handler('error_handler'); set_error_handler('error_handler');
global $config; global $config;
if($config['backward_support']) { if(setting('core.backward_support')) {
global $SQL, $main_content, $subtopic; global $SQL, $main_content, $subtopic;
} }
@ -1527,8 +1526,8 @@ function right($str, $length) {
} }
function getCreatureImgPath($creature){ function getCreatureImgPath($creature){
$creature_path = config('monsters_images_url'); $creature_path = setting('core.monsters_images_url');
$creature_gfx_name = trim(strtolower($creature)) . config('monsters_images_extension'); $creature_gfx_name = trim(strtolower($creature)) . setting('core.monsters_images_extension');
if (!file_exists($creature_path . $creature_gfx_name)) { if (!file_exists($creature_path . $creature_gfx_name)) {
$creature_gfx_name = str_replace(" ", "", $creature_gfx_name); $creature_gfx_name = str_replace(" ", "", $creature_gfx_name);
if (file_exists($creature_path . $creature_gfx_name)) { if (file_exists($creature_path . $creature_gfx_name)) {

View File

@ -137,7 +137,12 @@ require_once SYSTEM . 'compat/config.php';
date_default_timezone_set(setting('core.date_timezone')); date_default_timezone_set(setting('core.date_timezone'));
$config['account_create_character_create'] = config('account_create_character_create') && (!setting('core.mail_enabled') || !config('account_mail_verify')); setting(
[
'core.account_create_character_create',
setting('core.account_create_character_create') && (!setting('core.mail_enabled') || !setting('core.account_mail_verify'))
]
);
$settingsItemImagesURL = setting('core.item_images_url'); $settingsItemImagesURL = setting('core.item_images_url');
if($settingsItemImagesURL[strlen($settingsItemImagesURL) - 1] !== '/') { if($settingsItemImagesURL[strlen($settingsItemImagesURL) - 1] !== '/') {

View File

@ -140,8 +140,8 @@ class CreateCharacter
if(empty($errors)) if(empty($errors))
{ {
$number_of_players_on_account = $account->getPlayersList(true)->count(); $number_of_players_on_account = $account->getPlayersList(true)->count();
if($number_of_players_on_account >= config('characters_per_account')) if($number_of_players_on_account >= setting('core.characters_per_account'))
$errors[] = 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.config('characters_per_account').')</b>!'; $errors[] = 'You have too many characters on your account <b>('.$number_of_players_on_account . '/' . setting('core.characters_per_account') . ')</b>!';
} }
if(empty($errors)) if(empty($errors))

View File

@ -10,13 +10,13 @@
*/ */
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$configForumTablePrefix = setting('core.forum_table_prefix'); $settingForumTablePrefix = setting('core.forum_table_prefix');
if(null !== $configForumTablePrefix && !empty(trim($configForumTablePrefix))) { if(null !== $settingForumTablePrefix && !empty(trim($settingForumTablePrefix))) {
if(!in_array($configForumTablePrefix, array('myaac_', 'z_'))) { if(!in_array($settingForumTablePrefix, array('myaac_', 'z_'))) {
throw new RuntimeException('Invalid value for forum_table_prefix in config.php. Can be only: "myaac_" or "z_".'); throw new RuntimeException('Invalid value for forum_table_prefix in config.php. Can be only: "myaac_" or "z_".');
} }
define('FORUM_TABLE_PREFIX', $configForumTablePrefix); define('FORUM_TABLE_PREFIX', $settingForumTablePrefix);
} }
else { else {
if($db->hasTable('z_forum')) { if($db->hasTable('z_forum')) {

View File

@ -106,8 +106,8 @@ WHERE TABLE_SCHEMA = "' . $config['database_name'] . '";');
} }
$ret['templates'] = get_templates(); $ret['templates'] = get_templates();
$ret['date_timezone'] = $config['date_timezone']; $ret['date_timezone'] = setting('core.date_timezone');
$ret['backward_support'] = $config['backward_support']; $ret['backward_support'] = setting('core.backward_support');
$cache_engine = strtolower($config['cache_engine']); $cache_engine = strtolower($config['cache_engine']);
if($cache_engine == 'auto') { if($cache_engine == 'auto') {
@ -117,4 +117,4 @@ WHERE TABLE_SCHEMA = "' . $config['database_name'] . '";');
$ret['cache_engine'] = $cache_engine; $ret['cache_engine'] = $cache_engine;
return $ret; return $ret;
} }
} }

View File

@ -43,7 +43,7 @@ if($email_new_time < 10) {
} }
if(empty($errors)) { if(empty($errors)) {
$email_new_time = time() + $config['account_mail_change'] * 24 * 3600; $email_new_time = time() + setting('account_mail_change') * 24 * 3600;
$account_logged->setCustomField("email_new", $email_new); $account_logged->setCustomField("email_new", $email_new);
$account_logged->setCustomField("email_new_time", $email_new_time); $account_logged->setCustomField("email_new_time", $email_new_time);
$twig->display('success.html.twig', array( $twig->display('success.html.twig', array(

View File

@ -20,7 +20,7 @@ if(!$logged) {
return; return;
} }
if($config['account_country']) if(setting('core.account_country'))
require SYSTEM . 'countries.conf.php'; require SYSTEM . 'countries.conf.php';
$account = Account::find($account_logged->getId()); $account = Account::find($account_logged->getId());
@ -55,7 +55,7 @@ if(isset($_POST['changeinfosave']) && $_POST['changeinfosave'] == 1) {
if($show_form) { if($show_form) {
$account_rlname = $account->rlname; $account_rlname = $account->rlname;
$account_location = $account->location; $account_location = $account->location;
if ($config['account_country']) { if (setting('core.account_country')) {
$account_country = $account->country; $account_country = $account->country;
$countries = array(); $countries = array();

View File

@ -11,7 +11,7 @@
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'Create Account'; $title = 'Create Account';
if($config['account_country']) if (setting('core.account_country'))
require SYSTEM . 'countries.conf.php'; require SYSTEM . 'countries.conf.php';
if($logged) if($logged)
@ -20,7 +20,7 @@ if($logged)
return; return;
} }
if(config('account_create_character_create')) { if(setting('core.account_create_character_create')) {
require_once LIBS . 'CreateCharacter.php'; require_once LIBS . 'CreateCharacter.php';
$createCharacter = new CreateCharacter(); $createCharacter = new CreateCharacter();
} }
@ -68,7 +68,7 @@ if($save)
// country // country
$country = ''; $country = '';
if($config['account_country']) if (setting('core.account_country'))
{ {
$country = $_POST['country']; $country = $_POST['country'];
if(!isset($country)) if(!isset($country))
@ -93,7 +93,7 @@ if($save)
$errors['password'] = 'Password may not be the same as account name.'; $errors['password'] = 'Password may not be the same as account name.';
} }
if($config['account_mail_unique']) if(setting('core.account_mail_unique'))
{ {
$test_email_account = new OTS_Account(); $test_email_account = new OTS_Account();
$test_email_account->findByEMail($email); $test_email_account->findByEMail($email);
@ -115,7 +115,7 @@ if($save)
} }
if($account_db->isLoaded()) { if($account_db->isLoaded()) {
if (config('account_login_by_email') && !config('account_mail_unique')) { if (config('account_login_by_email') && !setting('core.account_mail_unique')) {
$errors['account'] = 'Account with this email already exist.'; $errors['account'] = 'Account with this email already exist.';
} }
else if (!config('account_login_by_email')) { else if (!config('account_login_by_email')) {
@ -150,7 +150,7 @@ if($save)
return; return;
} }
if(config('account_create_character_create')) { if(setting('core.account_create_character_create')) {
$character_name = isset($_POST['name']) ? stripslashes(ucwords(strtolower($_POST['name']))) : null; $character_name = isset($_POST['name']) ? stripslashes(ucwords(strtolower($_POST['name']))) : null;
$character_sex = isset($_POST['sex']) ? (int)$_POST['sex'] : null; $character_sex = isset($_POST['sex']) ? (int)$_POST['sex'] : null;
$character_vocation = isset($_POST['vocation']) ? (int)$_POST['vocation'] : null; $character_vocation = isset($_POST['vocation']) ? (int)$_POST['vocation'] : null;
@ -191,27 +191,28 @@ if($save)
$new_account->setCustomField('created', time()); $new_account->setCustomField('created', time());
$new_account->logAction('Account created.'); $new_account->logAction('Account created.');
if($config['account_country']) { if(setting('core.account_country')) {
$new_account->setCustomField('country', $country); $new_account->setCustomField('country', $country);
} }
if($config['account_premium_days'] && $config['account_premium_days'] > 0) { $settingAccountPremiumDays = setting('core.account_premium_days');
if($settingAccountPremiumDays && $settingAccountPremiumDays > 0) {
if($db->hasColumn('accounts', 'premend')) { // othire if($db->hasColumn('accounts', 'premend')) { // othire
$new_account->setCustomField('premend', time() + $config['account_premium_days'] * 86400); $new_account->setCustomField('premend', time() + $settingAccountPremiumDays * 86400);
} }
else { // rest else { // rest
if ($db->hasColumn('accounts', 'premium_ends_at')) { // TFS 1.4+ if ($db->hasColumn('accounts', 'premium_ends_at')) { // TFS 1.4+
$new_account->setCustomField('premium_ends_at', time() + $config['account_premium_days'] * (60 * 60 * 24)); $new_account->setCustomField('premium_ends_at', time() + $settingAccountPremiumDays * (60 * 60 * 24));
} }
else { else {
$new_account->setCustomField('premdays', $config['account_premium_days']); $new_account->setCustomField('premdays', $settingAccountPremiumDays);
$new_account->setCustomField('lastday', time()); $new_account->setCustomField('lastday', time());
} }
} }
} }
if($config['account_premium_points']) { if(setting('account_premium_points') && setting('account_premium_points') > 0) {
$new_account->setCustomField('premium_points', $config['account_premium_points']); $new_account->setCustomField('premium_points', setting('account_premium_points'));
} }
$tmp_account = $email; $tmp_account = $email;
@ -219,7 +220,7 @@ if($save)
$tmp_account = (USE_ACCOUNT_NAME ? $account_name : $account_id); $tmp_account = (USE_ACCOUNT_NAME ? $account_name : $account_id);
} }
if(setting('core.mail_enabled') && $config['account_mail_verify']) if(setting('core.mail_enabled') && setting('core.account_mail_verify'))
{ {
$hash = md5(generateRandomString(16, true, true) . $email); $hash = md5(generateRandomString(16, true, true) . $email);
$new_account->setCustomField('email_hash', $hash); $new_account->setCustomField('email_hash', $hash);
@ -238,7 +239,7 @@ if($save)
'description' => 'Your account ' . $account_type . ' is <b>' . $tmp_account . '</b><br/>You will need the account ' . $account_type . ' and your password to play on ' . configLua('serverName') . '. 'description' => 'Your account ' . $account_type . ' is <b>' . $tmp_account . '</b><br/>You will need the account ' . $account_type . ' and your password to play on ' . configLua('serverName') . '.
Please keep your account ' . $account_type . ' and password in a safe place and Please keep your account ' . $account_type . ' and password in a safe place and
never give your account ' . $account_type . ' or password to anybody.', never give your account ' . $account_type . ' or password to anybody.',
'custom_buttons' => config('account_create_character_create') ? '' : null 'custom_buttons' => setting('core.account_create_character_create') ? '' : null
)); ));
} }
else else
@ -249,7 +250,7 @@ if($save)
} }
else else
{ {
if(config('account_create_character_create')) { if(setting('core.account_create_character_create')) {
// character creation // character creation
$character_created = $createCharacter->doCreate($character_name, $character_sex, $character_vocation, $character_town, $new_account, $errors); $character_created = $createCharacter->doCreate($character_name, $character_sex, $character_vocation, $character_town, $new_account, $errors);
if (!$character_created) { if (!$character_created) {
@ -258,7 +259,7 @@ if($save)
} }
} }
if(config('account_create_auto_login')) { if(setting('core.account_create_auto_login')) {
if ($hasBeenCreatedByEMail) { if ($hasBeenCreatedByEMail) {
$_POST['account_login'] = $email; $_POST['account_login'] = $email;
} }
@ -273,7 +274,7 @@ if($save)
} }
echo 'Your account'; echo 'Your account';
if(config('account_create_character_create')) { if(setting('core.account_create_character_create')) {
echo ' and character have'; echo ' and character have';
} }
else { else {
@ -281,7 +282,7 @@ if($save)
} }
echo ' been created.'; echo ' been created.';
if(!config('account_create_character_create')) { if(!setting('core.account_create_character_create')) {
echo ' Now you can login and create your first character.'; echo ' Now you can login and create your first character.';
} }
@ -291,10 +292,10 @@ if($save)
'description' => 'Your account ' . $account_type . ' is <b>' . $tmp_account . '</b><br/>You will need the account ' . $account_type . ' and your password to play on ' . configLua('serverName') . '. 'description' => 'Your account ' . $account_type . ' is <b>' . $tmp_account . '</b><br/>You will need the account ' . $account_type . ' and your password to play on ' . configLua('serverName') . '.
Please keep your account ' . $account_type . ' and password in a safe place and Please keep your account ' . $account_type . ' and password in a safe place and
never give your account ' . $account_type . ' or password to anybody.', never give your account ' . $account_type . ' or password to anybody.',
'custom_buttons' => config('account_create_character_create') ? '' : null 'custom_buttons' => setting('core.account_create_character_create') ? '' : null
)); ));
if(setting('core.mail_enabled') && $config['account_welcome_mail']) if(setting('core.mail_enabled') && setting('account_welcome_mail'))
{ {
$mailBody = $twig->render('account.welcome_mail.html.twig', array( $mailBody = $twig->render('account.welcome_mail.html.twig', array(
'account' => $tmp_account 'account' => $tmp_account
@ -330,7 +331,7 @@ if(setting('core.account_country_recognize')) {
if(!empty($errors)) if(!empty($errors))
$twig->display('error_box.html.twig', array('errors' => $errors)); $twig->display('error_box.html.twig', array('errors' => $errors));
if($config['account_country']) { if (setting('core.account_country')) {
$countries = array(); $countries = array();
foreach (array('pl', 'se', 'br', 'us', 'gb') as $c) foreach (array('pl', 'se', 'br', 'us', 'gb') as $c)
$countries[$c] = $config['countries'][$c]; $countries[$c] = $config['countries'][$c];
@ -353,7 +354,7 @@ $params = array(
'save' => $save 'save' => $save
); );
if($save && config('account_create_character_create')) { if($save && setting('core.account_create_character_create')) {
$params = array_merge($params, array( $params = array_merge($params, array(
'name' => $character_name, 'name' => $character_name,
'sex' => $character_sex, 'sex' => $character_sex,

View File

@ -77,10 +77,10 @@ if($player->isLoaded() && !$player->isDeleted())
$rows = 0; $rows = 0;
if($config['characters']['outfit']) if($config['characters']['outfit'])
$outfit = $config['outfit_images_url'] . '?id=' . $player->getLookType() . ($db->hasColumn('players', 'lookaddons') ? '&addons=' . $player->getLookAddons() : '') . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet(); $outfit = setting('core.outfit_images_url') . '?id=' . $player->getLookType() . ($db->hasColumn('players', 'lookaddons') ? '&addons=' . $player->getLookAddons() : '') . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet();
$flag = ''; $flag = '';
if($config['account_country']) { if(setting('core.account_country')) {
$flag = getFlagImage($account->getCountry()); $flag = getFlagImage($account->getCountry());
} }
@ -423,7 +423,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
if($db->hasColumn('players', 'deletion')) if($db->hasColumn('players', 'deletion'))
$deleted = 'deletion'; $deleted = 'deletion';
$query = $db->query('SELECT `name`, `level`, `vocation`' . $promotion . ' FROM `players` WHERE `name` LIKE ' . $db->quote('%' . $name . '%') . ' AND ' . $deleted . ' != 1 LIMIT ' . (int)config('characters_search_limit') . ';'); $query = $db->query('SELECT `name`, `level`, `vocation`' . $promotion . ' FROM `players` WHERE `name` LIKE ' . $db->quote('%' . $name . '%') . ' AND ' . $deleted . ' != 1 LIMIT ' . (int)setting('core.characters_search_limit') . ';');
if($query->rowCount() > 0) { if($query->rowCount() > 0) {
echo 'Did you mean:<ul>'; echo 'Did you mean:<ul>';
foreach($query as $player) { foreach($query as $player) {

View File

@ -17,7 +17,7 @@ $title = 'Creatures';
if (empty($_REQUEST['name'])) { if (empty($_REQUEST['name'])) {
// display list of monsters // display list of monsters
$preview = config('monsters_images_preview'); $preview = setting('core.monsters_images_preview');
$creatures = Monster::where('hidden', '!=', 1)->when(!empty($_REQUEST['boss']), function ($query) { $creatures = Monster::where('hidden', '!=', 1)->when(!empty($_REQUEST['boss']), function ($query) {
$query->where('rewardboss', 1); $query->where('rewardboss', 1);
})->get()->toArray(); })->get()->toArray();
@ -65,7 +65,7 @@ if (isset($creature['name'])) {
$item['name'] = getItemNameById($item['id']); $item['name'] = getItemNameById($item['id']);
$item['rarity_chance'] = round($item['chance'] / 1000, 2); $item['rarity_chance'] = round($item['chance'] / 1000, 2);
$item['rarity'] = getItemRarity($item['chance']); $item['rarity'] = getItemRarity($item['chance']);
$item['tooltip'] = ucfirst($item['name']) . '<br/>Chance: ' . $item['rarity'] . (config('monsters_loot_percentage') ? ' ('. $item['rarity_chance'] .'%)' : '') . '<br/>Max count: ' . $item['count']; $item['tooltip'] = ucfirst($item['name']) . '<br/>Chance: ' . $item['rarity'] . (setting('core.monsters_loot_percentage') ? ' ('. $item['rarity_chance'] .'%)' : '') . '<br/>Max count: ' . $item['count'];
} }
$creature['loot'] = isset($loot) ? $loot : null; $creature['loot'] = isset($loot) ? $loot : null;

View File

@ -57,7 +57,7 @@ foreach($posts as &$post) {
} }
if($config['characters']['outfit']) { if($config['characters']['outfit']) {
$post['outfit'] = $config['outfit_images_url'] . '?id=' . $player->getLookType() . ($lookaddons ? '&addons=' . $player->getLookAddons() : '') . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet(); $post['outfit'] = setting('core.outfit_images_url') . '?id=' . $player->getLookType() . ($lookaddons ? '&addons=' . $player->getLookAddons() : '') . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet();
} }
$groupName = ''; $groupName = '';

View File

@ -43,7 +43,7 @@ if(empty($errors)) {
$saved = false; $saved = false;
if($guild_leader) { if($guild_leader) {
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') { if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
$description = htmlspecialchars(stripslashes(substr(trim($_REQUEST['description']),0,$config['guild_description_chars_limit']))); $description = htmlspecialchars(stripslashes(substr(trim($_REQUEST['description']),0, setting('core.guild_description_chars_limit'))));
$guild->setCustomField('description', $description); $guild->setCustomField('description', $description);
$saved = true; $saved = true;
} }

View File

@ -42,7 +42,7 @@ if(empty($errors)) {
if($guild_leader) if($guild_leader)
{ {
$max_image_size_b = $config['guild_image_size_kb'] * 1024; $max_image_size_b = setting('core.guild_image_size_kb') * 1024;
$allowed_ext = array('image/gif', 'image/jpg', 'image/pjpeg', 'image/jpeg', 'image/bmp', 'image/png', 'image/x-png'); $allowed_ext = array('image/gif', 'image/jpg', 'image/pjpeg', 'image/jpeg', 'image/bmp', 'image/png', 'image/x-png');
$ext_name = array('image/gif' => 'gif', 'image/jpg' => 'jpg', 'image/jpeg' => 'jpg', 'image/pjpeg' => 'jpg', 'image/bmp' => 'bmp', 'image/png' => 'png', 'image/x-png' => 'png'); $ext_name = array('image/gif' => 'gif', 'image/jpg' => 'jpg', 'image/jpeg' => 'jpg', 'image/pjpeg' => 'jpg', 'image/bmp' => 'bmp', 'image/png' => 'png', 'image/x-png' => 'png');
$save_file_name = str_replace(' ', '_', strtolower($guild->getName())); $save_file_name = str_replace(' ', '_', strtolower($guild->getName()));
@ -62,7 +62,7 @@ if(empty($errors)) {
} }
} }
else { else {
$upload_errors[] = 'You didn\'t send file or file is too big. Limit: <b>'.$config['guild_image_size_kb'].' KB</b>.'; $upload_errors[] = 'You didn\'t send file or file is too big. Limit: <b>'.setting('core.guild_image_size_kb').' KB</b>.';
} }
if(empty($upload_errors)) { if(empty($upload_errors)) {

View File

@ -46,7 +46,7 @@ if(empty($errors)) {
$saved = false; $saved = false;
if($guild_leader) { if($guild_leader) {
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') { if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
$motd = htmlspecialchars(stripslashes(substr($_REQUEST['motd'],0, $config['guild_motd_chars_limit']))); $motd = htmlspecialchars(stripslashes(substr($_REQUEST['motd'],0, setting('core.guild_motd_chars_limit'))));
$guild->setCustomField('motd', $motd); $guild->setCustomField('motd', $motd);
$saved = true; $saved = true;
} }

View File

@ -28,8 +28,8 @@ if(empty($guild_errors))
$player_rank = $player->getRank(); $player_rank = $player->getRank();
if(!$player_rank->isLoaded()) if(!$player_rank->isLoaded())
{ {
if($player->getLevel() >= $config['guild_need_level']) { if($player->getLevel() >= setting('core.guild_need_level')) {
if(!$config['guild_need_premium'] || $account_logged->isPremium()) { if(!setting('core.guild_need_premium') || $account_logged->isPremium()) {
$array_of_player_nig[] = $player->getName(); $array_of_player_nig[] = $player->getName();
} }
} }
@ -39,7 +39,7 @@ if(empty($guild_errors))
if(empty($todo)) { if(empty($todo)) {
if(count($array_of_player_nig) == 0) { if(count($array_of_player_nig) == 0) {
$guild_errors[] = 'On your account all characters are in guilds, have too low level to create new guild' . ($config['guild_need_premium'] ? ' or you don\' have a premium account' : '') . '.'; $guild_errors[] = 'On your account all characters are in guilds, have too low level to create new guild' . (setting('core.guild_need_premium') ? ' or you don\' have a premium account' : '') . '.';
} }
} }
@ -91,10 +91,10 @@ if($todo == 'save')
} }
if(empty($guild_errors)) { if(empty($guild_errors)) {
if($player->getLevel() < $config['guild_need_level']) { if($player->getLevel() < setting('core.guild_need_level')) {
$guild_errors[] = 'Character <b>'.$name.'</b> has too low level. To create guild you need character with level <b>'.$config['guild_need_level'].'</b>.'; $guild_errors[] = 'Character <b>'.$name.'</b> has too low level. To create guild you need character with level <b>' . setting('core.guild_need_level') . '</b>.';
} }
if($config['guild_need_premium'] && !$account_logged->isPremium()) { if(setting('core.guild_need_premium') && !$account_logged->isPremium()) {
$guild_errors[] = 'Character <b>'.$name.'</b> is on FREE account. To create guild you need PREMIUM account.'; $guild_errors[] = 'Character <b>'.$name.'</b> is on FREE account. To create guild you need PREMIUM account.';
} }
} }
@ -112,7 +112,7 @@ if(isset($todo) && $todo == 'save')
$new_guild->setName($guild_name); $new_guild->setName($guild_name);
$new_guild->setOwner($player); $new_guild->setOwner($player);
$new_guild->save(); $new_guild->save();
$new_guild->setCustomField('description', config('guild_description_default')); $new_guild->setCustomField('description', setting('core.guild_description_default'));
//$new_guild->setCustomField('creationdata', time()); //$new_guild->setCustomField('creationdata', time());
$ranks = $new_guild->getGuildRanksList(); $ranks = $new_guild->getGuildRanksList();
$ranks->orderBy('level', POT::ORDER_DESC); $ranks->orderBy('level', POT::ORDER_DESC);

View File

@ -26,7 +26,7 @@ if(count($guilds_list) > 0)
$description = $guild->getCustomField('description'); $description = $guild->getCustomField('description');
$description_with_lines = str_replace(array("\r\n", "\n", "\r"), '<br />', $description, $count); $description_with_lines = str_replace(array("\r\n", "\n", "\r"), '<br />', $description, $count);
if ($count < $config['guild_description_lines_limit']) if ($count < setting('core.guild_description_lines_limit'))
$description = nl2br($description); $description = nl2br($description);
$guildName = $guild->getName(); $guildName = $guild->getName();

View File

@ -85,7 +85,7 @@ if(empty($guild_logo) || !file_exists(GUILD_IMAGES_DIR . $guild_logo))
$description = $guild->getCustomField('description'); $description = $guild->getCustomField('description');
$description_with_lines = str_replace(array("\r\n", "\n", "\r"), '<br />', $description, $count); $description_with_lines = str_replace(array("\r\n", "\n", "\r"), '<br />', $description, $count);
if($count < $config['guild_description_lines_limit']) if($count < setting('core.guild_description_lines_limit'))
$description = nl2br($description); $description = nl2br($description);
//$description = $description_with_lines; //$description = $description_with_lines;

View File

@ -239,7 +239,7 @@ foreach($highscores as $id => &$player)
$player['link'] = getPlayerLink($player['name'], false); $player['link'] = getPlayerLink($player['name'], false);
$player['flag'] = getFlagImage($player['country']); $player['flag'] = getFlagImage($player['country']);
if($settingHighscoresOutfit) { if($settingHighscoresOutfit) {
$player['outfit'] = '<img style="position:absolute;margin-top:' . (in_array($player['looktype'], config('outfit_images_wrong_looktypes')) ? '-15px;margin-left:5px' : '-45px;margin-left:-25px') . ';" src="' . config('outfit_images_url') . '?id=' . $player['looktype'] . ($outfit_addons ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] . '" alt="" />'; $player['outfit'] = '<img style="position:absolute;margin-top:' . (in_array($player['looktype'], setting('core.outfit_images_wrong_looktypes')) ? '-15px;margin-left:5px' : '-45px;margin-left:-25px') . ';" src="' . setting('core.outfit_images_url') . '?id=' . $player['looktype'] . ($outfit_addons ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] . '" alt="" />';
} }
$player['rank'] = $offset + $i; $player['rank'] = $offset + $i;
} }

View File

@ -21,7 +21,7 @@ if($cache->enabled() && $cache->fetch('last_kills', $tmp)) {
else { else {
if($db->hasTable('player_killers')) // tfs 0.3 if($db->hasTable('player_killers')) // tfs 0.3
{ {
$players_deaths = $db->query('SELECT `player_deaths`.`id`, `player_deaths`.`date`, `player_deaths`.`level`, `players`.`name`' . ($db->hasColumn('players', 'world_id') ? ', `players`.`world_id`' : '') . ' FROM `player_deaths` LEFT JOIN `players` ON `player_deaths`.`player_id` = `players`.`id` ORDER BY `date` DESC LIMIT 0, ' . $config['last_kills_limit']); $players_deaths = $db->query('SELECT `player_deaths`.`id`, `player_deaths`.`date`, `player_deaths`.`level`, `players`.`name`' . ($db->hasColumn('players', 'world_id') ? ', `players`.`world_id`' : '') . ' FROM `player_deaths` LEFT JOIN `players` ON `player_deaths`.`player_id` = `players`.`id` ORDER BY `date` DESC LIMIT 0, ' . setting('core.last_kills_limit'));
if(!empty($players_deaths)) { if(!empty($players_deaths)) {
foreach($players_deaths as $death) { foreach($players_deaths as $death) {
@ -82,9 +82,9 @@ else {
} }
} }
} else { } else {
//$players_deaths = $db->query("SELECT `p`.`name` AS `victim`, `player_deaths`.`killed_by` as `killed_by`, `player_deaths`.`time` as `time`, `player_deaths`.`is_player` as `is_player`, `player_deaths`.`level` as `level` FROM `player_deaths`, `players` as `d` INNER JOIN `players` as `p` ON player_deaths.player_id = p.id WHERE player_deaths.`is_player`='1' ORDER BY `time` DESC LIMIT " . $config['last_kills_limit'] . ";"); //$players_deaths = $db->query("SELECT `p`.`name` AS `victim`, `player_deaths`.`killed_by` as `killed_by`, `player_deaths`.`time` as `time`, `player_deaths`.`is_player` as `is_player`, `player_deaths`.`level` as `level` FROM `player_deaths`, `players` as `d` INNER JOIN `players` as `p` ON player_deaths.player_id = p.id WHERE player_deaths.`is_player`='1' ORDER BY `time` DESC LIMIT " . setting('core.last_kills_limit') . ";");
$players_deaths = $db->query("SELECT `p`.`name` AS `victim`, `d`.`killed_by` as `killed_by`, `d`.`time` as `time`, `d`.`level`, `d`.`is_player` FROM `player_deaths` as `d` INNER JOIN `players` as `p` ON d.player_id = p.id ORDER BY `time` DESC LIMIT " . $config['last_kills_limit'] . ";"); $players_deaths = $db->query("SELECT `p`.`name` AS `victim`, `d`.`killed_by` as `killed_by`, `d`.`time` as `time`, `d`.`level`, `d`.`is_player` FROM `player_deaths` as `d` INNER JOIN `players` as `p` ON d.player_id = p.id ORDER BY `time` DESC LIMIT " . setting('core.last_kills_limit') . ";");
if(!empty($players_deaths)) { if(!empty($players_deaths)) {
foreach($players_deaths as $death) { foreach($players_deaths as $death) {
$players_deaths_count++; $players_deaths_count++;
@ -114,4 +114,4 @@ else {
$twig->display('lastkills.html.twig', array( $twig->display('lastkills.html.twig', array(
'lastkills' => $last_kills 'lastkills' => $last_kills
)); ));

View File

@ -62,7 +62,7 @@ if(isset($_GET['archive']))
'content' => $content_, 'content' => $content_,
'date' => $news['date'], 'date' => $news['date'],
'icon' => $categories[$news['category']]['icon_id'], 'icon' => $categories[$news['category']]['icon_id'],
'author' => $config['news_author'] ? $author : '', 'author' => setting('core.news_author') ? $author : '',
'comments' => $news['comments'] != 0 ? getForumThreadLink($news['comments']) : null, 'comments' => $news['comments'] != 0 ? getForumThreadLink($news['comments']) : null,
)); ));
} }
@ -116,7 +116,7 @@ if(!$news_cached)
); );
} }
$tickers_db = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'news` WHERE `type` = ' . TICKER .($canEdit ? '' : ' AND `hidden` != 1') .' ORDER BY `date` DESC LIMIT ' . $config['news_ticker_limit']); $tickers_db = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'news` WHERE `type` = ' . TICKER .($canEdit ? '' : ' AND `hidden` != 1') .' ORDER BY `date` DESC LIMIT ' . setting('core.news_ticker_limit'));
$tickers_content = ''; $tickers_content = '';
if($tickers_db->rowCount() > 0) if($tickers_db->rowCount() > 0)
{ {
@ -167,7 +167,7 @@ else {
if(!$news_cached) if(!$news_cached)
{ {
ob_start(); ob_start();
$newses = $db->query('SELECT * FROM ' . $db->tableName(TABLE_PREFIX . 'news') . ' WHERE type = ' . NEWS . ($canEdit ? '' : ' AND hidden != 1') . ' ORDER BY date' . ' DESC LIMIT ' . $config['news_limit']); $newses = $db->query('SELECT * FROM ' . $db->tableName(TABLE_PREFIX . 'news') . ' WHERE type = ' . NEWS . ($canEdit ? '' : ' AND hidden != 1') . ' ORDER BY date' . ' DESC LIMIT ' . setting('core.news_limit'));
if($newses->rowCount() > 0) if($newses->rowCount() > 0)
{ {
foreach($newses as $news) foreach($newses as $news)
@ -211,7 +211,7 @@ if(!$news_cached)
'content' => $content_ . $admin_options, 'content' => $content_ . $admin_options,
'date' => $news['date'], 'date' => $news['date'],
'icon' => $categories[$news['category']]['icon_id'], 'icon' => $categories[$news['category']]['icon_id'],
'author' => $config['news_author'] ? $author : '', 'author' => setting('core.news_author') ? $author : '',
'comments' => $news['comments'] != 0 ? getForumThreadLink($news['comments']) : null, 'comments' => $news['comments'] != 0 ? getForumThreadLink($news['comments']) : null,
'hidden'=> $news['hidden'] 'hidden'=> $news['hidden']
)); ));

View File

@ -15,7 +15,7 @@ use MyAAC\Models\ServerRecord;
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'Who is online?'; $title = 'Who is online?';
if($config['account_country']) if (setting('core.account_country'))
require SYSTEM . 'countries.conf.php'; require SYSTEM . 'countries.conf.php';
$promotion = ''; $promotion = '';
@ -42,7 +42,7 @@ if($db->hasColumn('players', 'skull_time')) {
$outfit_addons = false; $outfit_addons = false;
$outfit = ''; $outfit = '';
if($config['online_outfit']) { if (setting('core.online_outfit')) {
$outfit = ', lookbody, lookfeet, lookhead, looklegs, looktype'; $outfit = ', lookbody, lookfeet, lookhead, looklegs, looktype';
if($db->hasColumn('players', 'lookaddons')) { if($db->hasColumn('players', 'lookaddons')) {
$outfit .= ', lookaddons'; $outfit .= ', lookaddons';
@ -50,7 +50,7 @@ if($config['online_outfit']) {
} }
} }
if($config['online_vocations']) { if (setting('core.online_vocations')) {
$vocs = array(); $vocs = array();
foreach($config['vocations'] as $id => $name) { foreach($config['vocations'] as $id => $name) {
$vocs[$id] = 0; $vocs[$id] = 0;
@ -67,7 +67,7 @@ $players = 0;
$data = ''; $data = '';
foreach($playersOnline as $player) { foreach($playersOnline as $player) {
$skull = ''; $skull = '';
if($config['online_skulls']) if (setting('core.online_skulls'))
{ {
if($player['skulltime'] > 0) if($player['skulltime'] > 0)
{ {
@ -90,18 +90,18 @@ foreach($playersOnline as $player) {
'player' => $player, 'player' => $player,
'level' => $player['level'], 'level' => $player['level'],
'vocation' => $config['vocations'][$player['vocation']], 'vocation' => $config['vocations'][$player['vocation']],
'country_image' => $config['account_country'] ? getFlagImage($player['country']) : null, 'country_image' => setting('core.account_country') ? getFlagImage($player['country']) : null,
'outfit' => $config['online_outfit'] ? $config['outfit_images_url'] . '?id=' . $player['looktype'] . ($outfit_addons ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] : null 'outfit' => setting('core.online_outfit') ? setting('core.outfit_images_url') . '?id=' . $player['looktype'] . ($outfit_addons ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] : null
); );
if($config['online_vocations']) { if (setting('core.online_vocations')) {
$vocs[($player['vocation'] > $config['vocations_amount'] ? $player['vocation'] - $config['vocations_amount'] : $player['vocation'])]++; $vocs[($player['vocation'] > $config['vocations_amount'] ? $player['vocation'] - $config['vocations_amount'] : $player['vocation'])]++;
} }
} }
$record = ''; $record = '';
if($players > 0) { if($players > 0) {
if($config['online_record']) { if( setting('core.online_record')) {
$result = null; $result = null;
$timestamp = false; $timestamp = false;
if($db->hasTable('server_record')) { if($db->hasTable('server_record')) {

View File

@ -71,7 +71,7 @@ $twig->display('spells.html.twig', array(
'post_vocation_id' => $vocation_id, 'post_vocation_id' => $vocation_id,
'post_vocation' => $vocation, 'post_vocation' => $vocation,
'spells' => $spells, 'spells' => $spells,
'item_path' => $config['item_images_url'], 'item_path' => setting('core.item_images_url'),
)); ));
?> ?>

View File

@ -11,7 +11,7 @@
defined('MYAAC') or die('Direct access not allowed!'); defined('MYAAC') or die('Direct access not allowed!');
$title = 'Support in game'; $title = 'Support in game';
if($config['account_country']) if(setting('core.account_country'))
require SYSTEM . 'countries.conf.php'; require SYSTEM . 'countries.conf.php';
$groups = new OTS_Groups_List(); $groups = new OTS_Groups_List();

View File

@ -170,7 +170,7 @@ if(!empty($page) && preg_match('/^[A-z0-9\-]+$/', $page)) {
$_REQUEST['subtopic'] = $_REQUEST['p']; $_REQUEST['subtopic'] = $_REQUEST['p'];
} }
if (config('backward_support')) { if (setting('core.backward_support')) {
require SYSTEM . 'compat/pages.php'; require SYSTEM . 'compat/pages.php';
} }
@ -271,7 +271,7 @@ if($hooks->trigger(HOOK_BEFORE_PAGE)) {
unset($file); unset($file);
if(config('backward_support') && isset($main_content[0])) if(setting('core.backward_support') && isset($main_content[0]))
$content .= $main_content; $content .= $main_content;
$content .= ob_get_contents(); $content .= ob_get_contents();
@ -282,7 +282,7 @@ if(!isset($title)) {
$title = ucfirst($page); $title = ucfirst($page);
} }
if(config('backward_support')) { if(setting('core.backward_support')) {
$main_content = $content; $main_content = $content;
$topic = $title; $topic = $title;
} }

View File

@ -1047,12 +1047,12 @@ Sent by MyAAC,<br/>
'desc' => 'Show player outfit?', 'desc' => 'Show player outfit?',
'default' => true, 'default' => true,
], ],
'highscores_country_box' => [ // not implemented yet /*'highscores_country_box' => [ // not implemented yet
'name' => 'Display Country Box', 'name' => 'Display Country Box',
'type' => 'hidden', 'type' => 'hidden',
'desc' => 'Show player outfit?', 'desc' => 'Show player outfit?',
'default' => false, 'default' => false,
], ],*/
'highscores_groups_hidden' => [ 'highscores_groups_hidden' => [
'name' => 'Hidden Groups', 'name' => 'Hidden Groups',
'type' => 'number', 'type' => 'number',
@ -1225,9 +1225,9 @@ Sent by MyAAC,<br/>
'team_style' => [ 'team_style' => [
'name' => 'Style', 'name' => 'Style',
'type' => 'options', 'type' => 'options',
'desc' => '', 'desc' => 'How to show groups',
'options' => ['normal table', 'in boxes, grouped by group id'], 'options' => [1 => 'normal table', 2 => 'in boxes, grouped by group id'],
'default' => 1, 'default' => 2,
], ],
'team_status' => [ 'team_status' => [
'name' => 'Display Online Status', 'name' => 'Display Online Status',

View File

@ -125,7 +125,7 @@ function updateStatus() {
$status['playersMax'] = $serverStatus->getMaxPlayers(); $status['playersMax'] = $serverStatus->getMaxPlayers();
// for status afk thing // for status afk thing
if($config['online_afk']) if (setting('core.online_afk'))
{ {
$status['playersTotal'] = 0; $status['playersTotal'] = 0;
// get amount of players that are currently logged in-game, including disconnected clients (exited) // get amount of players that are currently logged in-game, including disconnected clients (exited)

View File

@ -54,7 +54,7 @@ if(file_exists(BASE . $template_path . '/index.php')) {
elseif(file_exists(BASE . $template_path . '/template.php')) { elseif(file_exists(BASE . $template_path . '/template.php')) {
$template_index = 'template.php'; $template_index = 'template.php';
} }
elseif($config['backward_support'] && file_exists(BASE . $template_path . '/layout.php')) { elseif(setting('core.backward_support') && file_exists(BASE . $template_path . '/layout.php')) {
$template_index = 'layout.php'; $template_index = 'layout.php';
} }
else { else {
@ -77,7 +77,7 @@ if ($cache->enabled() && $cache->fetch('template_ini_' . $template_name, $tmp))
else { else {
$file = BASE . $template_path . '/config.ini'; $file = BASE . $template_path . '/config.ini';
$exists = file_exists($file); $exists = file_exists($file);
if ($exists || ($config['backward_support'] && file_exists(BASE . $template_path . '/layout_config.ini'))) { if ($exists || (setting('core.backward_support') && file_exists(BASE . $template_path . '/layout_config.ini'))) {
if (!$exists) { if (!$exists) {
$file = BASE . $template_path . '/layout_config.ini'; $file = BASE . $template_path . '/layout_config.ini';
} }

View File

@ -31,7 +31,7 @@ Here you can tell other players about yourself. This information will be display
<input name="info_location" value="{{ account_location }}" size="30" maxlength="50" > <input name="info_location" value="{{ account_location }}" size="30" maxlength="50" >
</td> </td>
</tr> </tr>
{% if config.account_country %} {% if setting('core.account_country') %}
<tr> <tr>
<td class="LabelV" >Country:</td> <td class="LabelV" >Country:</td>
<td> <td>
@ -97,4 +97,4 @@ Here you can tell other players about yourself. This information will be display
</table> </table>
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -1,4 +1,4 @@
Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <br/><b>For security reasons, the actual change will be finalised after a waiting period of {{ config.account_mail_change }} days.</b><br/><br/> Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <br/><b>For security reasons, the actual change will be finalised after a waiting period of {{ setting('core.account_mail_change') }} days.</b><br/><br/>
<form action="{{ getLink('account/email') }}" method="post"> <form action="{{ getLink('account/email') }}" method="post">
<div class="TableContainer"> <div class="TableContainer">
<table class="Table1" cellpadding="0" cellspacing="0"> <table class="Table1" cellpadding="0" cellspacing="0">
@ -67,4 +67,4 @@ Please enter your password and the new email address. Make sure that you enter a
</table> </table>
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -59,13 +59,13 @@
<td></td><td><span id="email_error" class="FormFieldError">{% if errors.email is defined %}{{ errors.email }}{% endif %}</span></td> <td></td><td><span id="email_error" class="FormFieldError">{% if errors.email is defined %}{{ errors.email }}{% endif %}</span></td>
</tr> </tr>
{% if setting('core.mail_enabled') and config.account_mail_verify %} {% if setting('core.mail_enabled') and setting('account_mail_verify') %}
<tr><td></td><td><span><strong>Please use real address!<br/>We will send a link to validate your Email.</strong></span></td></tr> <tr><td></td><td><span><strong>Please use real address!<br/>We will send a link to validate your Email.</strong></span></td></tr>
{% endif %} {% endif %}
{{ hook('HOOK_ACCOUNT_CREATE_AFTER_EMAIL') }} {{ hook('HOOK_ACCOUNT_CREATE_AFTER_EMAIL') }}
{% if config.account_country %} {% if setting('core.account_country') %}
<tr> <tr>
<td class="LabelV" style="width: 150px"> <td class="LabelV" style="width: 150px">
<span{% if errors.country[0] is defined %} class="red"{% endif %}>Country:</span> <span{% if errors.country[0] is defined %} class="red"{% endif %}>Country:</span>
@ -122,7 +122,7 @@
{{ hook('HOOK_ACCOUNT_CREATE_BETWEEN_BOXES_1') }} {{ hook('HOOK_ACCOUNT_CREATE_BETWEEN_BOXES_1') }}
{% if (not setting('core.mail_enabled') or not config.account_mail_verify) and config.account_create_character_create %} {% if (not setting('core.mail_enabled') or not setting('core.account_mail_verify')) and setting('account_create_character_create') %}
<tr> <tr>
<td> <td>
<div class="TableShadowContainerRightTop"> <div class="TableShadowContainerRightTop">

View File

@ -2,7 +2,7 @@ Please choose a name{% if config.character_samples|length > 1 %}, vocation{% end
{% if config.character_towns|length > 1 %}, town{% endif %} {% if config.character_towns|length > 1 %}, town{% endif %}
and sex for your character. <br/> and sex for your character. <br/>
In any case the name must not violate the naming conventions stated in the <a href="?subtopic=rules" target="_blank" >{{ config.lua.serverName }} Rules</a>, or your character might get deleted or name locked. In any case the name must not violate the naming conventions stated in the <a href="?subtopic=rules" target="_blank" >{{ config.lua.serverName }} Rules</a>, or your character might get deleted or name locked.
{% if account_logged.getPlayersList(true)|length >= config.characters_per_account %} {% if account_logged.getPlayersList(true)|length >= setting('core.characters_per_account') %}
<b><span style="color: red"> You have maximum number of characters per account on your account. Delete one before you make new.</span></b> <b><span style="color: red"> You have maximum number of characters per account on your account. Delete one before you make new.</span></b>
{% endif %} {% endif %}
<br/><br/> <br/><br/>

View File

@ -21,7 +21,7 @@
<tr> <tr>
<td>{{ news.id|raw }}</td> <td>{{ news.id|raw }}</td>
<td><i><a href="?p=news&action=edit&id={{ news.id }}">{{ news.title }}</a></i></td> <td><i><a href="?p=news&action=edit&id={{ news.id }}">{{ news.title }}</a></i></td>
<td>{{ news.date|date(config.news_date_format) }}</td> <td>{{ news.date|date(setting('core.news_date_format')) }}</td>
<td><a target="_blank" rel="noopener noreferrer" href="{{ news.player_link }}">{{ news.player_name }}</a></td> <td><a target="_blank" rel="noopener noreferrer" href="{{ news.player_link }}">{{ news.player_name }}</a></td>
<td> <td>
<div class="btn-group"> <div class="btn-group">
@ -66,7 +66,7 @@
<tr> <tr>
<td>{{ ticker.id|raw }}</td> <td>{{ ticker.id|raw }}</td>
<td><i><a href="?p=news&action=edit&id={{ ticker.id }}">{{ ticker.title }}</a></i></td> <td><i><a href="?p=news&action=edit&id={{ ticker.id }}">{{ ticker.title }}</a></i></td>
<td>{{ ticker.date|date(config.news_date_format) }}</td> <td>{{ ticker.date|date(setting('core.news_date_format')) }}</td>
<td><a target="_blank" rel="noopener noreferrer" href="{{ ticker.player_link }}">{{ ticker.player_name }}</a></td> <td><a target="_blank" rel="noopener noreferrer" href="{{ ticker.player_link }}">{{ ticker.player_name }}</a></td>
<td> <td>
<div class="btn-group"> <div class="btn-group">
@ -110,7 +110,7 @@
<tr> <tr>
<td>{{ article.id|raw }}</td> <td>{{ article.id|raw }}</td>
<td><i><a href="?p=news&action=edit&id={{ article.id }}">{{ article.title }}</a></i></td> <td><i><a href="?p=news&action=edit&id={{ article.id }}">{{ article.title }}</a></i></td>
<td>{{ article.date|date(config.news_date_format) }}</td> <td>{{ article.date|date(setting('core.news_date_format')) }}</td>
<td><a target="_blank" rel="noopener noreferrer" href="{{ article.player_link }}">{{ article.player_name }}</a></td> <td><a target="_blank" rel="noopener noreferrer" href="{{ article.player_link }}">{{ article.player_name }}</a></td>
<td> <td>
<div class="btn-group"> <div class="btn-group">

View File

@ -17,7 +17,7 @@
{% endif %} {% endif %}
<table border="0" cellspacing="1" cellpadding="4" width="100%"> <table border="0" cellspacing="1" cellpadding="4" width="100%">
{% if config.characters.outfit %} {% if config.characters.outfit %}
<div style="width:64px;height:64px;border:2px solid #F1E0C6; border-radius:50px; padding:13px; margin-top:38px;margin-left:376px;position:absolute;"><img style="margin-left:{% if player.getLookType() in config.outfit_images_wrong_looktypes %}-0px;margin-top:-0px;width:64px;height:64px;{% else %}-60px;margin-top:-60px;width:128px;height:128px;{% endif %}" src="{{ outfit }}" alt="player outfit"/></div> <div style="width:64px;height:64px;border:2px solid #F1E0C6; border-radius:50px; padding:13px; margin-top:38px;margin-left:376px;position:absolute;"><img style="margin-left:{% if player.getLookType() in setting('core.outfit_images_wrong_looktypes') %}-0px;margin-top:-0px;width:64px;height:64px;{% else %}-60px;margin-top:-60px;width:128px;height:128px;{% endif %}" src="{{ outfit }}" alt="player outfit"/></div>
{% endif %} {% endif %}
<tr bgcolor="{{ config.vdarkborder }}"> <tr bgcolor="{{ config.vdarkborder }}">

View File

@ -155,7 +155,7 @@
{% if (item.count > 1) %} {% if (item.count > 1) %}
<span class="loot_amount">{{ item.count }}</span> <span class="loot_amount">{{ item.count }}</span>
{% endif %} {% endif %}
<a href="{{ config.monsters_items_url }}{{ item.name|title }}"><img title="{{ item.tooltip }}" src="{{ config.item_images_url }}{{ item.id }}{{ config.item_images_extension }}" class="loot_image"/></a> <a href="{{ setting('core.monsters_items_url') }}{{ item.name|title }}"><img title="{{ item.tooltip }}" src="{{ setting('core.item_images_url') }}{{ item.id }}{{ setting('core.item_images_extension') }}" class="loot_image"/></a>
</span> </span>
{% endfor %} {% endfor %}
</td> </td>

View File

@ -24,7 +24,7 @@ Page: {{ links_to_pages|raw }}<br/>
{% set i = i + 1 %} {% set i = i + 1 %}
<td valign="top">{{ post.player_link|raw }}<br/> <td valign="top">{{ post.player_link|raw }}<br/>
{% if post.outfit is defined %} {% if post.outfit is defined %}
<img style="margin-left:{% if post.player.getLookType() in config.outfit_images_wrong_looktypes %}-0px;margin-top:-0px;width:64px;height:64px;{% else %}-60px;margin-top:-60px;width:128px;height:128px;{% endif %}" src="{{ post.outfit }}" alt="player outfit"/> <img style="margin-left:{% if post.player.getLookType() in setting('core.outfit_images_wrong_looktypes') %}-0px;margin-top:-0px;width:64px;height:64px;{% else %}-60px;margin-top:-60px;width:128px;height:128px;{% endif %}" src="{{ post.outfit }}" alt="player outfit"/>
<br /> <br />
{% endif %} {% endif %}
<span style="font-size: 10px"> <span style="font-size: 10px">

View File

@ -2,8 +2,8 @@
Here you can change description of your guild.<br/> Here you can change description of your guild.<br/>
<form enctype="multipart/form-data" action="?subtopic=guilds&guild={{ guild.getName() }}&action=change_description" method="post"> <form enctype="multipart/form-data" action="?subtopic=guilds&guild={{ guild.getName() }}&action=change_description" method="post">
<input type="hidden" name="todo" value="save"/> <input type="hidden" name="todo" value="save"/>
<textarea name="description" cols="60" rows="{{ config.guild_description_lines_limit - 1 }}">{{ guild.getCustomField('description')|raw }}</textarea><br> <textarea name="description" cols="60" rows="{{ setting('core.guild_description_lines_limit') - 1 }}">{{ guild.getCustomField('description')|raw }}</textarea><br>
(max. {{ config.guild_description_lines_limit }} lines, max. {{ config.guild_description_chars_limit }} chars) <input type="submit" value="Save description"/></form><br/> (max. {{ setting('core.guild_description_lines_limit') }} lines, max. {{ setting('core.guild_description_chars_limit') }} chars) <input type="submit" value="Save description"/></form><br/>
<br/> <br/>
<div style="text-align:center"> <div style="text-align:center">
<form action="?subtopic=guilds&guild={{ guild.getName() }}&action=manager" method="post"> <form action="?subtopic=guilds&guild={{ guild.getName() }}&action=manager" method="post">

View File

@ -6,7 +6,7 @@ Here you can change logo of your guild.<br/>Actuall logo: <img src="{{ constant(
Select new logo: <input name="newlogo" id="newlogo" type="file" /> Select new logo: <input name="newlogo" id="newlogo" type="file" />
<input type="submit" value="Send new logo" /> <input type="submit" value="Send new logo" />
</form> </form>
Only <b>jpg, gif, png, bmp</b> pictures. Max. size: <b>{{ config.guild_image_size_kb }} KB</b><br> Only <b>jpg, gif, png, bmp</b> pictures. Max. size: <b>{{ setting('core.guild_image_size_kb') }} KB</b><br>
<br/> <br/>
<div style="text-align:center"> <div style="text-align:center">
<form action="?subtopic=guilds&guild={{ guild.getName() }}&action=manager" method="post"> <form action="?subtopic=guilds&guild={{ guild.getName() }}&action=manager" method="post">
@ -16,7 +16,7 @@ Only <b>jpg, gif, png, bmp</b> pictures. Max. size: <b>{{ config.guild_image_siz
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
$('#upload_form').submit(function (event) { $('#upload_form').submit(function (event) {
var max_img_size = {{ config.guild_image_size_kb * 1024 }}; var max_img_size = {{ setting('core.guild_image_size_kb') * 1024 }};
var input = document.getElementById("newlogo"); var input = document.getElementById("newlogo");
// check for browser support (may need to be modified) // check for browser support (may need to be modified)
if (input.files && input.files.length == 1) { if (input.files && input.files.length == 1) {

View File

@ -3,7 +3,7 @@ Here you can change MOTD (Message of the Day, showed in game!) of your guild.<br
<form enctype="multipart/form-data" action="?subtopic=guilds&guild={{ guild.getName() }}&action=change_motd" method="post"> <form enctype="multipart/form-data" action="?subtopic=guilds&guild={{ guild.getName() }}&action=change_motd" method="post">
<input type="hidden" name="todo" value="save"/> <input type="hidden" name="todo" value="save"/>
<textarea name="motd" cols="60" rows="3">{{ guild.getCustomField('motd')|raw }}</textarea><br/> <textarea name="motd" cols="60" rows="3">{{ guild.getCustomField('motd')|raw }}</textarea><br/>
(max. {{ config.guild_motd_chars_limit }} chars) <input type="submit" value="Save MOTD" /></form><br/> (max. {{ setting('core.guild_motd_chars_limit') }} chars) <input type="submit" value="Save MOTD" /></form><br/>
<br/> <br/>
<div style="text-align:center"> <div style="text-align:center">
<form action="?subtopic=guilds&guild={{ guild.getName() }}&action=manager" method="post"> <form action="?subtopic=guilds&guild={{ guild.getName() }}&action=manager" method="post">

View File

@ -29,13 +29,13 @@
</table> </table>
<table border="0" cellpadding="4" cellspacing="1" width="100%"> <table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr bgcolor="{{ config.vdarkborder }}"> <tr bgcolor="{{ config.vdarkborder }}">
{% if config.account_country %} {% if setting('core.account_country') %}
<td style="width: 11px" class="white">#</td> <td style="width: 11px" class="white">#</td>
{% endif %} {% endif %}
<td style="width: 10%" class="white"><b>Rank</b></td> <td style="width: 10%" class="white"><b>Rank</b></td>
{% if config.highscores_outfit %} {% if setting('core.highscores_outfit') %}
<td class="white"><b>Outfit</b></td> <td class="white"><b>Outfit</b></td>
{% endif %} {% endif %}
@ -56,13 +56,13 @@
<tr bgcolor="{{ getStyle(row) }}"> <tr bgcolor="{{ getStyle(row) }}">
{% set row = row + 1 %} {% set row = row + 1 %}
{% if config.account_country %} {% if setting('core.account_country') %}
<td>{{ player.flag|raw }}</td> <td>{{ player.flag|raw }}</td>
{% endif %} {% endif %}
<td>{{ player.rank }}.</td> <td>{{ player.rank }}.</td>
{% if config.highscores_outfit %} {% if setting('core.highscores_outfit') %}
<td>{{ player.outfit|raw }}</td> <td>{{ player.outfit|raw }}</td>
{% endif %} {% endif %}
@ -70,7 +70,7 @@
<a href="{{ player.link }}"> <a href="{{ player.link }}">
<span style="color: {% if player.online > 0 %}green{% else %}red{% endif %}">{{ player.name }}</span> <span style="color: {% if player.online > 0 %}green{% else %}red{% endif %}">{{ player.name }}</span>
</a> </a>
{% if config.highscores_vocation %} {% if setting('core.highscores_vocation') %}
<br/><small>{{ player.vocation }}</small> <br/><small>{{ player.vocation }}</small>
{% endif %} {% endif %}
</td> </td>

View File

@ -1,9 +1,9 @@
<div class="NewsHeadline"> <div class="NewsHeadline">
<div class="NewsHeadlineBackground" style="background-image:url({{ template_path }}/images/news/newsheadline_background.gif)"> <div class="NewsHeadlineBackground" style="background-image:url({{ template_path }}/images/news/newsheadline_background.gif)">
<img src="{{ constant('BASE_URL') }}images/news/icon_{{ icon }}.gif" class="NewsHeadlineIcon" /> <img src="{{ constant('BASE_URL') }}images/news/icon_{{ icon }}.gif" class="NewsHeadlineIcon" />
<div class="NewsHeadlineDate">{{ date|date(config.news_date_format) }} - </div> <div class="NewsHeadlineDate">{{ date|date(setting('core.news_date_format')) }} - </div>
<div class="NewsHeadlineText">{{ title }}</div> <div class="NewsHeadlineText">{{ title }}</div>
{% if config.news_author and author is not empty %} {% if setting('core.news_author') and author is not empty %}
<div class="NewsHeadlineAuthor"><b>Author: </b><i>{{ author }}</i></div> <div class="NewsHeadlineAuthor"><b>Author: </b><i>{{ author }}</i></div>
{% endif %} {% endif %}
</div> </div>

View File

@ -10,7 +10,7 @@
{% if not status.online %} {% if not status.online %}
Server is offline.<br/> Server is offline.<br/>
{% else %} {% else %}
{% if config.online_afk %} {% if setting('core.online_afk') %}
{% set players_count = players|length %} {% set players_count = players|length %}
{% set afk = players_count - status.players %} {% set afk = players_count - status.players %}
{% if afk < 0 %} {% if afk < 0 %}
@ -28,9 +28,9 @@
</table> </table>
<br/> <br/>
{# vocation statistics #} {# vocation statistics #}
{% if config.online_vocations %} {% if setting('core.online_vocations') %}
<br/> <br/>
{% if config.online_vocations_images %} {% if setting('core.online_vocations_images') %}
<table width="200" cellspacing="1" cellpadding="0" border="0" align="center"> <table width="200" cellspacing="1" cellpadding="0" border="0" align="center">
<tr bgcolor="{{ config.darkborder }}"> <tr bgcolor="{{ config.darkborder }}">
<td><img src="images/sorcerer.png" /></td> <td><img src="images/sorcerer.png" /></td>
@ -70,7 +70,7 @@
{% endif %} {% endif %}
{# show skulls #} {# show skulls #}
{% if config.online_skulls %} {% if setting('core.online_skulls') %}
<table width="100%" cellspacing="1"> <table width="100%" cellspacing="1">
<tr> <tr>
<td style="background: {{ config.darkborder }};" align="center"> <td style="background: {{ config.darkborder }};" align="center">
@ -84,10 +84,10 @@
<table border="0" cellspacing="1" cellpadding="4" width="100%"> <table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr bgcolor="{{ config.vdarkborder }}"> <tr bgcolor="{{ config.vdarkborder }}">
{% if config.account_country %} {% if setting('core.account_country') %}
<td width="11px"><a href="{{ getLink('online?order=country') }}" class="white">#</A></td> <td width="11px"><a href="{{ getLink('online?order=country') }}" class="white">#</A></td>
{% endif %} {% endif %}
{% if config.online_outfit %} {% if setting('core.online_outfit') %}
<td class="white"><b>Outfit</b></td> <td class="white"><b>Outfit</b></td>
{% endif %} {% endif %}
<td width="60%"><a href="{{ getLink('online?order=name') }}" class="white">Name</A></td> <td width="60%"><a href="{{ getLink('online?order=name') }}" class="white">Name</A></td>
@ -98,11 +98,11 @@
{% for player in players %} {% for player in players %}
{% set i = i + 1 %} {% set i = i + 1 %}
<tr bgcolor="{{ getStyle(i) }}"> <tr bgcolor="{{ getStyle(i) }}">
{% if config.account_country %} {% if setting('core.account_country') %}
<td>{{ player.country_image|raw }}</td> <td>{{ player.country_image|raw }}</td>
{% endif %} {% endif %}
{% if config.online_outfit %} {% if setting('core.online_outfit') %}
<td width="5%"><img style="position:absolute;margin-top:{% if player.player.looktype in config.outfit_images_wrong_looktypes %}-20px;margin-left:-0px;{% else %}-45px;margin-left:-25px;{% endif %}" src="{{ player.outfit }}" alt="player outfit"/></td> <td width="5%"><img style="position:absolute;margin-top:{% if player.player.looktype in setting('core.outfit_images_wrong_looktypes') %}-20px;margin-left:-0px;{% else %}-45px;margin-left:-25px;{% endif %}" src="{{ player.outfit }}" alt="player outfit"/></td>
{% endif %} {% endif %}
<td>{{ player.name|raw }}{{ player.skull }}</td> <td>{{ player.name|raw }}{{ player.skull }}</td>
<td>{{ player.level }}</td> <td>{{ player.level }}</td>

View File

@ -47,7 +47,7 @@
{% if houseLevel %} {% if houseLevel %}
<li>Houses: <b>{{ houseLevel }} level</b></li> <li>Houses: <b>{{ houseLevel }} level</b></li>
{% endif %} {% endif %}
<li>Guilds: <b>{{ config.guild_need_level }} level</b> (Create via website)</li> <li>Guilds: <b>{{ setting('core.guild_need_level') }} level</b> (Create via website)</li>
<br> <br>
<h2>Frags & Skull system</h2> <h2>Frags & Skull system</h2>
@ -99,4 +99,4 @@
<h2>Other</h2> <h2>Other</h2>
<li>Respect our <a href="{{ getLink('rules') }}">rules</a>.</li> <li>Respect our <a href="{{ getLink('rules') }}">rules</a>.</li>
<li>Please report rule violations (Botters, players breaking rules etc) with <b>CTRL + R</b>.</li> <li>Please report rule violations (Botters, players breaking rules etc) with <b>CTRL + R</b>.</li>
</ul> </ul>

View File

@ -17,7 +17,7 @@
<td> <td>
<div class="InnerTableContainer"> <div class="InnerTableContainer">
{% set i = 0 %} {% set i = 0 %}
{% if config.team_style == 1 %} {% if setting('core.team_style') == 1 %}
<table border="0" cellpadding="4" cellspacing="1" width="100%"> <table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr bgcolor="{{ config.vdarkborder }}"> <tr bgcolor="{{ config.vdarkborder }}">
@ -63,12 +63,12 @@
{% if setting('core.team_outfit') %} {% if setting('core.team_outfit') %}
<td> <td>
<img style="position: absolute; margin-top: {% if member.player.looktype in config.outfit_images_wrong_looktypes %}-16px;margin-left:-0px;{% else %} -45px; margin-left: -30px;{% endif %}" src="{{ member.outfit }}" alt="player outfit"/> <img style="position: absolute; margin-top: {% if member.player.looktype in setting('core.outfit_images_wrong_looktypes') %}-16px;margin-left:-0px;{% else %} -45px; margin-left: -30px;{% endif %}" src="{{ member.outfit }}" alt="player outfit"/>
</td> </td>
{% endif %} {% endif %}
<td> <td>
{% if config.account_country %} {% if setting('core.account_country') %}
{{ member.flag_image|raw }} {{ member.flag_image|raw }}
{% endif %} {% endif %}
{{ member.link|raw }} {{ member.link|raw }}
@ -100,7 +100,7 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</table> </table>
{% elseif config.team_style == 2 %} {% elseif setting('core.team_style') == 2 %}
{% for group in groupmember|reverse %} {% for group in groupmember|reverse %}
{% if group.members is not empty %} {% if group.members is not empty %}
<div style="text-align:center"><h2>{{ group.group_name|capitalize }}</h2></div> <div style="text-align:center"><h2>{{ group.group_name|capitalize }}</h2></div>
@ -141,12 +141,12 @@
<tr bgcolor="{{ getStyle(i) }}" style="height: 32px;"> <tr bgcolor="{{ getStyle(i) }}" style="height: 32px;">
{% if setting('core.team_outfit') %} {% if setting('core.team_outfit') %}
<td> <td>
<img style="position: absolute; margin-top: {% if member.player.looktype in config.outfit_images_wrong_looktypes %}-16px;margin-left:-0px;{% else %} -45px; margin-left: -30px;{% endif %}" src="{{ member.outfit }}" alt="player outfit"/> <img style="position: absolute; margin-top: {% if member.player.looktype in setting('core.outfit_images_wrong_looktypes') %}-16px;margin-left:-0px;{% else %} -45px; margin-left: -30px;{% endif %}" src="{{ member.outfit }}" alt="player outfit"/>
</td> </td>
{% endif %} {% endif %}
<td> <td>
{% if config.account_country %} {% if setting('core.account_country') %}
{{ member.flag_image|raw }} {{ member.flag_image|raw }}
{% endif %} {% endif %}
{{ member.link|raw }} {{ member.link|raw }}

View File

@ -5,8 +5,8 @@
<base href="{{ constant('BASE_URL') }}" /> <base href="{{ constant('BASE_URL') }}" />
<title>{{ title }}</title> <title>{{ title }}</title>
{% endif %} {% endif %}
<meta name="description" content="{{ config.meta_description }}" /> <meta name="description" content="{{ setting('core.meta_description') }}" />
<meta name="keywords" content="{{ config.meta_keywords }}, myaac, wodzaac" /> <meta name="keywords" content="{{ setting('core.meta_keywords') }}, myaac, wodzaac" />
<meta name="generator" content="MyAAC" /> <meta name="generator" content="MyAAC" />
<link rel="stylesheet" type="text/css" href="{{ constant('BASE_URL') }}tools/css/messages.css" /> <link rel="stylesheet" type="text/css" href="{{ constant('BASE_URL') }}tools/css/messages.css" />
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/js/jquery.min.js"></script> <script type="text/javascript" src="{{ constant('BASE_URL') }}tools/js/jquery.min.js"></script>

View File

@ -1,7 +1,7 @@
var list = new Array(); var list = new Array();
{% set i = 0 %} {% set i = 0 %}
{% for cat in categories %} {% for cat in categories %}
{% if cat.id != 'shops' or config.gifts_system %} {% if cat.id != 'shops' or setting('core.gifts_system') %}
list[{{ i }}] = '{{ cat.id }}'; list[{{ i }}] = '{{ cat.id }}';
{% endif %} {% endif %}
{% set i = i + 1 %} {% set i = i + 1 %}

View File

@ -3,8 +3,8 @@
$topPlayers = getTopPlayers(5); $topPlayers = getTopPlayers(5);
foreach($topPlayers as &$player) { foreach($topPlayers as &$player) {
$outfit_url = ''; $outfit_url = '';
if($config['online_outfit']) { if (setting('core.online_outfit')) {
$outfit_url = $config['outfit_images_url'] . '?id=' . $player['looktype'] . (!empty $outfit_url = setting('core.outfit_images_url') . '?id=' . $player['looktype'] . (!empty
($player['lookaddons']) ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet']; ($player['lookaddons']) ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'];
$player['outfit'] = $outfit_url; $player['outfit'] = $outfit_url;

View File

@ -45,8 +45,8 @@
<div class="top_level" style="background:url({{ template_path }}/images/themeboxes/bg_top.png)" align=" "> <div class="top_level" style="background:url({{ template_path }}/images/themeboxes/bg_top.png)" align=" ">
{% for player in topPlayers %} {% for player in topPlayers %}
<div style="text-align:left"><a href="{{ getPlayerLink(player['name'], false) }} " class="topfont {% if player['online'] %}online{% else %}offline{% endif %}"> <div style="text-align:left"><a href="{{ getPlayerLink(player['name'], false) }} " class="topfont {% if player['online'] %}online{% else %}offline{% endif %}">
{% if config.online_outfit %} {% if setting('core.online_outfit') %}
<img style="position:absolute;margin-top:{% if player.looktype in config.outfit_images_wrong_looktypes %}-20px;margin-left:-0px;{% else %}-45px;margin-left:-25px;{% endif %}" src="{{ player.outfit }}" alt="player outfit"/> <img style="position:absolute;margin-top:{% if player.looktype in setting('core.outfit_images_wrong_looktypes') %}-20px;margin-left:-0px;{% else %}-45px;margin-left:-25px;{% endif %}" src="{{ player.outfit }}" alt="player outfit"/>
{% endif %} {% endif %}
<span style="color: #CCC; margin-left: 40px">{{ player['rank'] }} - </span> <span style="color: #CCC; margin-left: 40px">{{ player['rank'] }} - </span>
{{ player['name'] }} {{ player['name'] }}

View File

@ -124,7 +124,7 @@ if(isset($config['boxes']))
document.getElementById("ActiveSubmenuItemIcon_"+activeSubmenuItem).style.visibility = "visible"; document.getElementById("ActiveSubmenuItemIcon_"+activeSubmenuItem).style.visibility = "visible";
menus = localStorage.getItem('menus'); menus = localStorage.getItem('menus');
if(menus.lastIndexOf("&") === -1) { if(menus.lastIndexOf("&") === -1) {
menus = "news=1&account=0&community=0&library=0&forum=0<?php if($config['gifts_system']) echo '&shops=0'; ?>&"; menus = "news=1&account=0&community=0&library=0&forum=0<?php if (setting('core.gifts_system')) echo '&shops=0'; ?>&";
} }
FillMenuArray(); FillMenuArray();
InitializeMenu(); InitializeMenu();
@ -329,7 +329,7 @@ if(isset($config['boxes']))
$menus = get_template_menus(); $menus = get_template_menus();
foreach($config['menu_categories'] as $id => $cat) { foreach($config['menu_categories'] as $id => $cat) {
if(!isset($menus[$id]) || ($id == MENU_CATEGORY_SHOP && !$config['gifts_system'])) { if(!isset($menus[$id]) || ($id == MENU_CATEGORY_SHOP && !setting('core.gifts_system'))) {
continue; continue;
} }
?> ?>
@ -368,7 +368,7 @@ foreach($config['menu_categories'] as $id => $cat) {
?> ?>
</div> </div>
<?php <?php
if($id == MENU_CATEGORY_SHOP || (!$config['gifts_system'] && $id == MENU_CATEGORY_SHOP - 1)) { if($id == MENU_CATEGORY_SHOP || (!setting('core.gifts_system') && $id == MENU_CATEGORY_SHOP - 1)) {
?> ?>
<div id='MenuBottom' style='background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);'></div> <div id='MenuBottom' style='background-image:url(<?php echo $template_path; ?>/images/general/box-bottom.gif);'></div>
<?php <?php

View File

@ -85,9 +85,9 @@ if(isset($_GET['title'], $_GET['body'], $_GET['player_id'], $_GET['category'], $
'content' => $_GET['body'], 'content' => $_GET['body'],
'date' => time(), 'date' => time(),
'icon' => $categories[$_GET['category']]['icon_id'], 'icon' => $categories[$_GET['category']]['icon_id'],
'author' => $config['news_author'] ? $author : '', 'author' => setting('core.news_author') ? $author : '',
'comments' => null, 'comments' => null,
'news_date_format' => $config['news_date_format'], 'news_date_format' => setting('core.news_date_format'),
'hidden'=> 0 'hidden'=> 0
))); )));
} }

View File

@ -46,7 +46,7 @@ else if(isset($_GET['email']))
if(!Validator::email($email)) if(!Validator::email($email))
error_(Validator::getLastError()); error_(Validator::getLastError());
if($config['account_mail_unique']) if(setting('core.account_mail_unique'))
{ {
if(Account::where('email', '=', $email)->exists()) if(Account::where('email', '=', $email)->exists())
error_('Account with this e-mail already exist.'); error_('Account with this e-mail already exist.');