mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
Reviewed some settings again, fixing many glitches
This commit is contained in:
@@ -43,7 +43,7 @@ if(empty($errors)) {
|
||||
$saved = false;
|
||||
if($guild_leader) {
|
||||
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);
|
||||
$saved = true;
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ if(empty($errors)) {
|
||||
|
||||
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');
|
||||
$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()));
|
||||
@@ -62,7 +62,7 @@ if(empty($errors)) {
|
||||
}
|
||||
}
|
||||
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)) {
|
||||
|
@@ -46,7 +46,7 @@ if(empty($errors)) {
|
||||
$saved = false;
|
||||
if($guild_leader) {
|
||||
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);
|
||||
$saved = true;
|
||||
}
|
||||
|
@@ -28,8 +28,8 @@ if(empty($guild_errors))
|
||||
$player_rank = $player->getRank();
|
||||
if(!$player_rank->isLoaded())
|
||||
{
|
||||
if($player->getLevel() >= $config['guild_need_level']) {
|
||||
if(!$config['guild_need_premium'] || $account_logged->isPremium()) {
|
||||
if($player->getLevel() >= setting('core.guild_need_level')) {
|
||||
if(!setting('core.guild_need_premium') || $account_logged->isPremium()) {
|
||||
$array_of_player_nig[] = $player->getName();
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ if(empty($guild_errors))
|
||||
|
||||
if(empty($todo)) {
|
||||
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($player->getLevel() < $config['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>.';
|
||||
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>' . 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.';
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ if(isset($todo) && $todo == 'save')
|
||||
$new_guild->setName($guild_name);
|
||||
$new_guild->setOwner($player);
|
||||
$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());
|
||||
$ranks = $new_guild->getGuildRanksList();
|
||||
$ranks->orderBy('level', POT::ORDER_DESC);
|
||||
|
@@ -26,7 +26,7 @@ if(count($guilds_list) > 0)
|
||||
|
||||
$description = $guild->getCustomField('description');
|
||||
$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);
|
||||
|
||||
$guildName = $guild->getName();
|
||||
|
@@ -85,7 +85,7 @@ if(empty($guild_logo) || !file_exists(GUILD_IMAGES_DIR . $guild_logo))
|
||||
|
||||
$description = $guild->getCustomField('description');
|
||||
$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 = $description_with_lines;
|
||||
|
||||
|
Reference in New Issue
Block a user