mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Core/Config
* convert configuration from list of constants to object * fixes config changes not applying on cli whithout closing and reopening again * config variables are no longer embedded in localization text
This commit is contained in:
@@ -85,10 +85,10 @@ class AccountPage extends GenericPage
|
||||
switch ($this->category[0])
|
||||
{
|
||||
case 'forgotpassword':
|
||||
if (CFG_ACC_AUTH_MODE != AUTH_MODE_SELF)
|
||||
if (Cfg::get('ACC_AUTH_MODE') != AUTH_MODE_SELF)
|
||||
{
|
||||
if (CFG_ACC_EXT_RECOVER_URL)
|
||||
header('Location: '.CFG_ACC_EXT_RECOVER_URL, true, 302);
|
||||
if (Cfg::get('ACC_EXT_RECOVER_URL'))
|
||||
header('Location: '.Cfg::get('ACC_EXT_RECOVER_URL'), true, 302);
|
||||
else
|
||||
$this->error();
|
||||
}
|
||||
@@ -102,10 +102,10 @@ class AccountPage extends GenericPage
|
||||
$this->head = sprintf(Lang::account('recoverPass'), $nStep);
|
||||
break;
|
||||
case 'forgotusername':
|
||||
if (CFG_ACC_AUTH_MODE != AUTH_MODE_SELF)
|
||||
if (Cfg::get('ACC_AUTH_MODE') != AUTH_MODE_SELF)
|
||||
{
|
||||
if (CFG_ACC_EXT_RECOVER_URL)
|
||||
header('Location: '.CFG_ACC_EXT_RECOVER_URL, true, 302);
|
||||
if (Cfg::get('ACC_EXT_RECOVER_URL'))
|
||||
header('Location: '.Cfg::get('ACC_EXT_RECOVER_URL'), true, 302);
|
||||
else
|
||||
$this->error();
|
||||
}
|
||||
@@ -145,13 +145,13 @@ class AccountPage extends GenericPage
|
||||
|
||||
break;
|
||||
case 'signup':
|
||||
if (!CFG_ACC_ALLOW_REGISTER)
|
||||
if (!Cfg::get('ACC_ALLOW_REGISTER'))
|
||||
$this->error();
|
||||
|
||||
if (CFG_ACC_AUTH_MODE != AUTH_MODE_SELF)
|
||||
if (Cfg::get('ACC_AUTH_MODE') != AUTH_MODE_SELF)
|
||||
{
|
||||
if (CFG_ACC_EXT_CREATE_URL)
|
||||
header('Location: '.CFG_ACC_EXT_CREATE_URL, true, 302);
|
||||
if (Cfg::get('ACC_EXT_CREATE_URL'))
|
||||
header('Location: '.Cfg::get('ACC_EXT_CREATE_URL'), true, 302);
|
||||
else
|
||||
$this->error();
|
||||
}
|
||||
@@ -172,7 +172,7 @@ class AccountPage extends GenericPage
|
||||
{
|
||||
$nStep = 2;
|
||||
DB::Aowow()->query('UPDATE ?_account SET status = ?d, statusTimer = 0, token = 0, userGroups = ?d WHERE token = ?', ACC_STATUS_OK, U_GROUP_NONE, $this->_get['token']);
|
||||
DB::Aowow()->query('REPLACE INTO ?_account_bannedips (ip, type, count, unbanDate) VALUES (?, 1, ?d + 1, UNIX_TIMESTAMP() + ?d)', User::$ip, CFG_ACC_FAILED_AUTH_COUNT, CFG_ACC_FAILED_AUTH_BLOCK);
|
||||
DB::Aowow()->query('REPLACE INTO ?_account_bannedips (ip, type, count, unbanDate) VALUES (?, 1, ?d + 1, UNIX_TIMESTAMP() + ?d)', User::$ip, Cfg::get('ACC_FAILED_AUTH_COUNT'), Cfg::get('ACC_FAILED_AUTH_BLOCK'));
|
||||
|
||||
$this->text = sprintf(Lang::account('accActivated'), $this->_get['token']);
|
||||
}
|
||||
@@ -386,7 +386,7 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
|
||||
return Lang::account('wrongPass');
|
||||
case AUTH_IPBANNED:
|
||||
User::destroy();
|
||||
return sprintf(Lang::account('loginExceeded'), Util::formatTime(CFG_ACC_FAILED_AUTH_BLOCK * 1000));
|
||||
return sprintf(Lang::account('loginExceeded'), Util::formatTime(Cfg::get('ACC_FAILED_AUTH_BLOCK') * 1000));
|
||||
case AUTH_INTERNAL_ERR:
|
||||
User::destroy();
|
||||
return Lang::main('intError');
|
||||
@@ -418,10 +418,10 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
|
||||
|
||||
// limit account creation
|
||||
$ip = DB::Aowow()->selectRow('SELECT ip, count, unbanDate FROM ?_account_bannedips WHERE type = 1 AND ip = ?', User::$ip);
|
||||
if ($ip && $ip['count'] >= CFG_ACC_FAILED_AUTH_COUNT && $ip['unbanDate'] >= time())
|
||||
if ($ip && $ip['count'] >= Cfg::get('ACC_FAILED_AUTH_COUNT') && $ip['unbanDate'] >= time())
|
||||
{
|
||||
DB::Aowow()->query('UPDATE ?_account_bannedips SET count = count + 1, unbanDate = UNIX_TIMESTAMP() + ?d WHERE ip = ? AND type = 1', CFG_ACC_FAILED_AUTH_BLOCK, User::$ip);
|
||||
return sprintf(Lang::account('signupExceeded'), Util::formatTime(CFG_ACC_FAILED_AUTH_BLOCK * 1000));
|
||||
DB::Aowow()->query('UPDATE ?_account_bannedips SET count = count + 1, unbanDate = UNIX_TIMESTAMP() + ?d WHERE ip = ? AND type = 1', Cfg::get('ACC_FAILED_AUTH_BLOCK'), User::$ip);
|
||||
return sprintf(Lang::account('signupExceeded'), Util::formatTime(Cfg::get('ACC_FAILED_AUTH_BLOCK') * 1000));
|
||||
}
|
||||
|
||||
// username taken
|
||||
@@ -440,21 +440,21 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
|
||||
User::$localeId,
|
||||
U_GROUP_PENDING,
|
||||
ACC_STATUS_NEW,
|
||||
CFG_ACC_CREATE_SAVE_DECAY,
|
||||
Cfg::get('ACC_CREATE_SAVE_DECAY'),
|
||||
$token
|
||||
);
|
||||
if (!$ok)
|
||||
return Lang::main('intError');
|
||||
else if ($_ = $this->sendMail(Lang::user('accConfirm', 0), sprintf(Lang::user('accConfirm', 1), $token), CFG_ACC_CREATE_SAVE_DECAY))
|
||||
else if ($_ = $this->sendMail(Lang::user('accConfirm', 0), sprintf(Lang::user('accConfirm', 1), $token), Cfg::get('ACC_CREATE_SAVE_DECAY')))
|
||||
{
|
||||
if ($id = DB::Aowow()->selectCell('SELECT id FROM ?_account WHERE token = ?', $token))
|
||||
Util::gainSiteReputation($id, SITEREP_ACTION_REGISTER);
|
||||
|
||||
// success:: update ip-bans
|
||||
if (!$ip || $ip['unbanDate'] < time())
|
||||
DB::Aowow()->query('REPLACE INTO ?_account_bannedips (ip, type, count, unbanDate) VALUES (?, 1, 1, UNIX_TIMESTAMP() + ?d)', User::$ip, CFG_ACC_FAILED_AUTH_BLOCK);
|
||||
DB::Aowow()->query('REPLACE INTO ?_account_bannedips (ip, type, count, unbanDate) VALUES (?, 1, 1, UNIX_TIMESTAMP() + ?d)', User::$ip, Cfg::get('ACC_FAILED_AUTH_BLOCK'));
|
||||
else
|
||||
DB::Aowow()->query('UPDATE ?_account_bannedips SET count = count + 1, unbanDate = UNIX_TIMESTAMP() + ?d WHERE ip = ? AND type = 1', CFG_ACC_FAILED_AUTH_BLOCK, User::$ip);
|
||||
DB::Aowow()->query('UPDATE ?_account_bannedips SET count = count + 1, unbanDate = UNIX_TIMESTAMP() + ?d WHERE ip = ? AND type = 1', Cfg::get('ACC_FAILED_AUTH_BLOCK'), User::$ip);
|
||||
|
||||
return $_;
|
||||
}
|
||||
@@ -462,11 +462,11 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
|
||||
|
||||
private function doRecoverPass()
|
||||
{
|
||||
if ($_ = $this->initRecovery(ACC_STATUS_RECOVER_PASS, CFG_ACC_RECOVERY_DECAY, $token))
|
||||
if ($_ = $this->initRecovery(ACC_STATUS_RECOVER_PASS, Cfg::get('ACC_RECOVERY_DECAY'), $token))
|
||||
return $_;
|
||||
|
||||
// send recovery mail
|
||||
return $this->sendMail(Lang::user('resetPass', 0), sprintf(Lang::user('resetPass', 1), $token), CFG_ACC_RECOVERY_DECAY);
|
||||
return $this->sendMail(Lang::user('resetPass', 0), sprintf(Lang::user('resetPass', 1), $token), Cfg::get('ACC_RECOVERY_DECAY'));
|
||||
}
|
||||
|
||||
private function doResetPass()
|
||||
@@ -494,11 +494,11 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
|
||||
|
||||
private function doRecoverUser()
|
||||
{
|
||||
if ($_ = $this->initRecovery(ACC_STATUS_RECOVER_USER, CFG_ACC_RECOVERY_DECAY, $token))
|
||||
if ($_ = $this->initRecovery(ACC_STATUS_RECOVER_USER, Cfg::get('ACC_RECOVERY_DECAY'), $token))
|
||||
return $_;
|
||||
|
||||
// send recovery mail
|
||||
return $this->sendMail(Lang::user('recoverUser', 0), sprintf(Lang::user('recoverUser', 1), $token), CFG_ACC_RECOVERY_DECAY);
|
||||
return $this->sendMail(Lang::user('recoverUser', 0), sprintf(Lang::user('recoverUser', 1), $token), Cfg::get('ACC_RECOVERY_DECAY'));
|
||||
}
|
||||
|
||||
private function initRecovery($type, $delay, &$token)
|
||||
@@ -519,10 +519,10 @@ Markup.printHtml("description text here", "description-generic", { allow: Markup
|
||||
private function sendMail($subj, $msg, $delay = 300)
|
||||
{
|
||||
// send recovery mail
|
||||
$subj = CFG_NAME_SHORT.Lang::main('colon') . $subj;
|
||||
$subj = Cfg::get('NAME_SHORT').Lang::main('colon') . $subj;
|
||||
$msg .= "\r\n\r\n".sprintf(Lang::user('tokenExpires'), Util::formatTime($delay * 1000))."\r\n";
|
||||
$header = 'From: '.CFG_CONTACT_EMAIL . "\r\n" .
|
||||
'Reply-To: '.CFG_CONTACT_EMAIL . "\r\n" .
|
||||
$header = 'From: '.Cfg::get('CONTACT_EMAIL') . "\r\n" .
|
||||
'Reply-To: '.Cfg::get('CONTACT_EMAIL') . "\r\n" .
|
||||
'X-Mailer: PHP/' . phpversion();
|
||||
|
||||
if (!mail($this->_post['email'], $subj, $msg, $header))
|
||||
|
||||
@@ -105,9 +105,9 @@ class AchievementsPage extends GenericPage
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($acvList->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($acvList->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_achievementsfound', $acvList->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_achievementsfound', $acvList->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT'));
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,42 +115,25 @@ class AdminPage extends GenericPage
|
||||
[SC_CSS_STRING, '.grid .status { position:absolute; right:5px; }']
|
||||
);
|
||||
|
||||
$head = '<table class="grid"><tr><th><b>Key</b></th><th><b>Value</b></th><th style="width:150px;"><b>Options</b></th></tr>';
|
||||
$mainTab = [];
|
||||
$miscTab = [];
|
||||
foreach (Util::$configCats as $idx => $catName)
|
||||
$head = '<tr><th><b>Key</b></th><th><b>Value</b></th><th style="width:150px;"><b>Options</b></th></tr>';
|
||||
foreach (Cfg::$categories as $idx => $catName)
|
||||
{
|
||||
if ($rows = DB::Aowow()->select('SELECT * FROM ?_config WHERE cat = ?d ORDER BY `flags` DESC, `key` ASC', $idx))
|
||||
{
|
||||
$buff = $head;
|
||||
foreach ($rows as $r)
|
||||
$buff .= $this->configAddRow($r);
|
||||
$rows = '';
|
||||
foreach (Cfg::forCategory($idx) as $key => [$value, $flags, , $default, $comment])
|
||||
$rows .= $this->configAddRow($key, $value, $flags, $default, $comment);
|
||||
|
||||
if (!$idx) //cat: misc
|
||||
$buff .= '<tr><td colspan="3"><a class="icon-add" onclick="cfg_add(this)">new configuration</a></td></tr>';
|
||||
if ($idx == Cfg::CAT_MISCELLANEOUS)
|
||||
$rows .= '<tr><td colspan="3"><a class="icon-add" onclick="cfg_add(this)">new configuration</a></td></tr>';
|
||||
|
||||
$buff .= '</table>';
|
||||
if (!$rows)
|
||||
continue;
|
||||
|
||||
if ($idx)
|
||||
$mainTab[$catName] = $buff;
|
||||
else
|
||||
$miscTab[$catName] = $buff;
|
||||
}
|
||||
$this->lvTabs[] = [null, array(
|
||||
'data' => '<table class="grid">' . $head . $rows . '</table>',
|
||||
'name' => $catName,
|
||||
'id' => Profiler::urlize($catName)
|
||||
)];
|
||||
}
|
||||
|
||||
foreach ($mainTab as $n => $t)
|
||||
$this->lvTabs[] = [null, array(
|
||||
'data' => $t,
|
||||
'name' => $n,
|
||||
'id' => Profiler::urlize($n)
|
||||
)];
|
||||
|
||||
foreach ($miscTab as $n => $t)
|
||||
$this->lvTabs[] = [null, array(
|
||||
'data' => $t,
|
||||
'name' => $n,
|
||||
'id' => Profiler::urlize($n)
|
||||
)];
|
||||
}
|
||||
|
||||
private function handlePhpInfo() : void
|
||||
@@ -320,55 +303,55 @@ class AdminPage extends GenericPage
|
||||
//
|
||||
}
|
||||
|
||||
private function configAddRow($r)
|
||||
private function configAddRow($key, $value, $flags, $default, $comment)
|
||||
{
|
||||
$buff = '<tr>';
|
||||
$info = explode(' - ', $r['comment']);
|
||||
$key = $r['flags'] & CON_FLAG_PHP ? strtolower($r['key']) : strtoupper($r['key']);
|
||||
$info = explode(' - ', $comment);
|
||||
$key = $flags & Cfg::FLAG_PHP ? strtolower($key) : strtoupper($key);
|
||||
|
||||
// name
|
||||
if (!empty($info[1]))
|
||||
$buff .= '<td>'.sprintf(Util::$dfnString, $info[1], $key).'</td>';
|
||||
if (!empty($info[0]))
|
||||
$buff .= '<td>'.sprintf(Util::$dfnString, $info[0], $key).'</td>';
|
||||
else
|
||||
$buff .= '<td>'.$key.'</td>';
|
||||
|
||||
// value
|
||||
if ($r['flags'] & CON_FLAG_TYPE_BOOL)
|
||||
$buff .= '<td><div id="'.$key.'"><input id="'.$key.'1" type="radio" name="'.$key.'" value="1" '.($r['value'] ? 'checked' : null).' /><label for="'.$key.'1">Enabled</label> <input id="'.$key.'0" type="radio" name="'.$key.'" value="0" '.($r['value'] ? null : 'checked').' /><label for="'.$key.'0">Disabled</label></div></td>';
|
||||
else if ($r['flags'] & CON_FLAG_OPT_LIST && !empty($info[2]))
|
||||
if ($flags & Cfg::FLAG_TYPE_BOOL)
|
||||
$buff .= '<td><div id="'.$key.'"><input id="'.$key.'1" type="radio" name="'.$key.'" value="1" '.($value ? 'checked' : null).' /><label for="'.$key.'1">Enabled</label> <input id="'.$key.'0" type="radio" name="'.$key.'" value="0" '.($value ? null : 'checked').' /><label for="'.$key.'0">Disabled</label></div></td>';
|
||||
else if ($flags & Cfg::FLAG_OPT_LIST && !empty($info[1]))
|
||||
{
|
||||
$buff .= '<td><select id="'.$key.'" name="'.$key.'">';
|
||||
foreach (explode(', ', $info[2]) as $option)
|
||||
foreach (explode(', ', $info[1]) as $option)
|
||||
{
|
||||
$opt = explode(':', $option);
|
||||
$buff .= '<option value="'.$opt[0].'"'.($r['value'] == $opt[0] ? ' selected ' : null).'>'.$opt[1].'</option>';
|
||||
[$idx, $name] = explode(':', $option);
|
||||
$buff .= '<option value="'.$idx.'"'.($value == $idx ? ' selected ' : null).'>'.$name.'</option>';
|
||||
}
|
||||
$buff .= '</select></td>';
|
||||
}
|
||||
else if ($r['flags'] & CON_FLAG_BITMASK && !empty($info[2]))
|
||||
else if ($flags & Cfg::FLAG_BITMASK && !empty($info[1]))
|
||||
{
|
||||
$buff .= '<td><div id="'.$key.'">';
|
||||
foreach (explode(', ', $info[2]) as $option)
|
||||
foreach (explode(', ', $info[1]) as $option)
|
||||
{
|
||||
$opt = explode(':', $option);
|
||||
$buff .= '<input id="'.$key.$opt[0].'" type="checkbox" name="'.$key.'" value="'.$opt[0].'"'.($r['value'] & (1 << $opt[0]) ? ' checked ' : null).'><label for="'.$key.$opt[0].'">'.$opt[1].'</label>';
|
||||
[$idx, $name] = explode(':', $option);
|
||||
$buff .= '<input id="'.$key.$idx.'" type="checkbox" name="'.$key.'" value="'.$idx.'"'.($value & (1 << $idx) ? ' checked ' : null).'><label for="'.$key.$idx.'">'.$name.'</label>';
|
||||
}
|
||||
$buff .= '</div></td>';
|
||||
}
|
||||
else
|
||||
$buff .= '<td><input id="'.$key.'" type="'.($r['flags'] & CON_FLAG_TYPE_STRING ? 'text" placeholder="<empty>' : 'number'.($r['flags'] & CON_FLAG_TYPE_FLOAT ? '" step="any' : '')).'" name="'.$key.'" value="'.$r['value'].'" /></td>';
|
||||
$buff .= '<td><input id="'.$key.'" type="'.($flags & Cfg::FLAG_TYPE_STRING ? 'text" placeholder="<empty>' : 'number'.($flags & Cfg::FLAG_TYPE_FLOAT ? '" step="any' : '')).'" name="'.$key.'" value="'.$value.'" /></td>';
|
||||
|
||||
// actions
|
||||
$buff .= '<td style="position:relative;">';
|
||||
|
||||
$buff .= '<a class="icon-save tip" onclick="cfg_submit.bind(this, \''.$key.'\')()" onmouseover="$WH.Tooltip.showAtCursor(event, \'Save Changes\', 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"></a>';
|
||||
|
||||
if (strstr($info[0], 'default:'))
|
||||
$buff .= '|<a class="icon-refresh tip" onclick="cfg_default(\''.$key.'\', \''.trim(explode('default:', $info[0])[1]).'\')" onmouseover="$WH.Tooltip.showAtCursor(event, \'Restore Default Value\', 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"></a>';
|
||||
if (isset($default))
|
||||
$buff .= '|<a class="icon-refresh tip" onclick="cfg_default(\''.$key.'\', \''.$default.'\')" onmouseover="$WH.Tooltip.showAtCursor(event, \'Restore Default Value\', 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"></a>';
|
||||
else
|
||||
$buff .= '|<a class="icon-refresh tip disabled"></a>';
|
||||
|
||||
if (!($r['flags'] & CON_FLAG_PERSISTENT))
|
||||
if (!($flags & Cfg::FLAG_PERSISTENT))
|
||||
$buff .= '|<a class="icon-delete tip" onclick="cfg_remove.bind(this, \''.$key.'\')()" onmouseover="$WH.Tooltip.showAtCursor(event, \'Remove Setting\', 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"></a>';
|
||||
|
||||
$buff .= '<span class="status"></span></td></tr>';
|
||||
|
||||
@@ -55,9 +55,9 @@ class AreaTriggersPage extends GenericPage
|
||||
$tabData['data'] = array_values($trigger->getListviewData());
|
||||
|
||||
// create note if search limit was exceeded; overwriting 'note' is intentional
|
||||
if ($trigger->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($trigger->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringEntityString, $trigger->getMatches(), '"'.Lang::game('areatriggers').'"', CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringEntityString, $trigger->getMatches(), '"'.Lang::game('areatriggers').'"', Cfg::get('SQL_LIMIT_DEFAULT'));
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class ArenaTeamPage extends GenericPage
|
||||
{
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
if (!Cfg::get('PROFILER_ENABLE'))
|
||||
$this->error();
|
||||
|
||||
$params = array_map('urldecode', explode('.', $pageParam));
|
||||
|
||||
@@ -33,7 +33,7 @@ class ArenaTeamsPage extends GenericPage
|
||||
{
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
if (!Cfg::get('PROFILER_ENABLE'))
|
||||
$this->error();
|
||||
|
||||
$this->getSubjectFromUrl($pageParam);
|
||||
@@ -58,7 +58,7 @@ class ArenaTeamsPage extends GenericPage
|
||||
protected function generateTitle()
|
||||
{
|
||||
if ($this->realm)
|
||||
array_unshift($this->title, $this->realm,/* CFG_BATTLEGROUP,*/ Lang::profiler('regions', $this->region), Lang::profiler('arenaTeams'));
|
||||
array_unshift($this->title, $this->realm,/* Cfg::get('BATTLEGROUP'),*/ Lang::profiler('regions', $this->region), Lang::profiler('arenaTeams'));
|
||||
else if ($this->region)
|
||||
array_unshift($this->title, Lang::profiler('regions', $this->region), Lang::profiler('arenaTeams'));
|
||||
else
|
||||
@@ -111,12 +111,12 @@ class ArenaTeamsPage extends GenericPage
|
||||
$tabData['data'] = array_values($teams->getListviewData());
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($this->filter['query'] && $teams->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($this->filter['query'] && $teams->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_arenateamsfound2', $this->sumSubjects, $teams->getMatches());
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
else if ($teams->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
else if ($teams->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_arenateamsfound', $this->sumSubjects, 0);
|
||||
|
||||
if ($this->filterObj->error)
|
||||
|
||||
@@ -99,7 +99,7 @@ class ClassPage extends GenericPage
|
||||
BUTTON_LINKS => ['type' => $this->type, 'typeId' => $this->typeId],
|
||||
BUTTON_WOWHEAD => true,
|
||||
BUTTON_TALENT => ['href' => '?talent#'.Util::$tcEncoding[$tcClassId[$this->typeId] * 3], 'pet' => false],
|
||||
BUTTON_FORUM => false // todo (low): CFG_BOARD_URL + X
|
||||
BUTTON_FORUM => false // todo (low): Cfg::get('BOARD_URL') + X
|
||||
);
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ class ClassPage extends GenericPage
|
||||
['s.cuFlags', SPELL_CU_LAST_RANK, '&'],
|
||||
['s.rankNo', 0]
|
||||
],
|
||||
CFG_SQL_LIMIT_NONE
|
||||
Cfg::get('SQL_LIMIT_NONE')
|
||||
);
|
||||
|
||||
$genSpells = new SpellList($conditions);
|
||||
@@ -153,7 +153,7 @@ class ClassPage extends GenericPage
|
||||
['requiredClass', $_mask, '&'],
|
||||
[['requiredClass', CLASS_MASK_ALL, '&'], CLASS_MASK_ALL, '!'],
|
||||
['itemset', 0], // hmm, do or dont..?
|
||||
CFG_SQL_LIMIT_NONE
|
||||
Cfg::get('SQL_LIMIT_NONE')
|
||||
);
|
||||
|
||||
$items = new ItemList($conditions);
|
||||
|
||||
@@ -25,7 +25,7 @@ class EmotesPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$cnd = [CFG_SQL_LIMIT_NONE];
|
||||
$cnd = [Cfg::get('SQL_LIMIT_NONE')];
|
||||
if (!User::isInGroup(U_GROUP_STAFF))
|
||||
$cnd[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ class EnchantmentPage extends GenericPage
|
||||
foreach ($iet as $tplId => $data)
|
||||
$randIds[$ire[$data['ench']]['id'] > 0 ? $tplId : -$tplId] = $ire[$data['ench']]['id'];
|
||||
|
||||
$randItems = new ItemList(array(CFG_SQL_LIMIT_NONE, ['randomEnchant', array_keys($randIds)]));
|
||||
$randItems = new ItemList(array(Cfg::get('SQL_LIMIT_NONE'), ['randomEnchant', array_keys($randIds)]));
|
||||
if (!$randItems->error)
|
||||
{
|
||||
$data = $randItems->getListviewData();
|
||||
|
||||
@@ -72,9 +72,9 @@ class EnchantmentsPage extends GenericPage
|
||||
if ($xCols)
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
if ($ench->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($ench->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_enchantmentsfound', $ench->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_enchantmentsfound', $ench->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT'));
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ class FactionPage extends GenericPage
|
||||
'sort' => ['standing', 'name']
|
||||
);
|
||||
|
||||
if ($items->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($items->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=17;crs='.$this->typeId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = [ItemList::$brickFile, $tabData, 'itemStandingCol'];
|
||||
@@ -217,7 +217,7 @@ class FactionPage extends GenericPage
|
||||
'sort' => ['-reputation', 'name']
|
||||
);
|
||||
|
||||
if ($killCreatures->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($killCreatures->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=42;crs='.$this->typeId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = [CreatureList::$brickFile, $tabData, 'npcRepCol'];
|
||||
@@ -237,7 +237,7 @@ class FactionPage extends GenericPage
|
||||
'name' => '$LANG.tab_members'
|
||||
);
|
||||
|
||||
if ($members->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($members->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=3;crs='.$this->typeId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = [CreatureList::$brickFile, $tabData];
|
||||
@@ -271,7 +271,7 @@ class FactionPage extends GenericPage
|
||||
'extraCols' => '$_'
|
||||
);
|
||||
|
||||
if ($quests->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($quests->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
$tabData['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=1;crs='.$this->typeId.';crv=0');
|
||||
|
||||
$this->lvTabs[] = [QuestList::$brickFile, $tabData, 'questRepCol'];
|
||||
|
||||
@@ -126,8 +126,8 @@ trait TrProfiler
|
||||
|
||||
$this->region = $cat[0];
|
||||
|
||||
// if ($cat[1] == Profiler::urlize(CFG_BATTLEGROUP))
|
||||
// $this->battlegroup = CFG_BATTLEGROUP;
|
||||
// if ($cat[1] == Profiler::urlize(Cfg::get('BATTLEGROUP')))
|
||||
// $this->battlegroup = Cfg::get('BATTLEGROUP');
|
||||
if (isset($cat[1]))
|
||||
{
|
||||
foreach (Profiler::getRealms() as $rId => $r)
|
||||
@@ -173,7 +173,7 @@ trait TrProfiler
|
||||
if ($this->realm)
|
||||
$this->path[] = Profiler::urlize($this->realm, true);
|
||||
// else
|
||||
// $this->path[] = Profiler::urlize(CFG_BATTLEGROUP);
|
||||
// $this->path[] = Profiler::urlize(Cfg::get('BATTLEGROUP'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@ class GenericPage
|
||||
|
||||
protected $jsGlobals = [];
|
||||
protected $lvData = [];
|
||||
protected $title = [CFG_NAME]; // for title-Element
|
||||
protected $title = []; // for title-Element
|
||||
protected $name = ''; // for h1-Element
|
||||
protected $tabId = null;
|
||||
protected $gDataKey = false; // adds the dataKey to the user vars
|
||||
@@ -272,6 +272,8 @@ class GenericPage
|
||||
|
||||
$this->initRequestData();
|
||||
|
||||
$this->title[] = Cfg::get('NAME');
|
||||
|
||||
if (!isset($this->contribute))
|
||||
$this->contribute = CONTRIBUTE_NONE;
|
||||
|
||||
@@ -279,8 +281,9 @@ class GenericPage
|
||||
if ($pageParam)
|
||||
$this->fullParams .= '='.$pageParam;
|
||||
|
||||
if (CFG_CACHE_DIR && Util::writeDir(CFG_CACHE_DIR))
|
||||
$this->cacheDir = mb_substr(CFG_CACHE_DIR, -1) != '/' ? CFG_CACHE_DIR.'/' : CFG_CACHE_DIR;
|
||||
$cacheDir = Cfg::get('CACHE_DIR');
|
||||
if ($cacheDir && Util::writeDir($cacheDir))
|
||||
$this->cacheDir = mb_substr($cacheDir, -1) != '/' ? $cacheDir.'/' : $cacheDir;
|
||||
|
||||
// force page refresh
|
||||
if (isset($_GET['refresh']) && User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_DEV))
|
||||
@@ -337,9 +340,9 @@ class GenericPage
|
||||
$this->forwardToSignIn($_SERVER['QUERY_STRING'] ?? '');
|
||||
}
|
||||
|
||||
if (CFG_MAINTENANCE && !User::isInGroup(U_GROUP_EMPLOYEE))
|
||||
if (Cfg::get('MAINTENANCE') && !User::isInGroup(U_GROUP_EMPLOYEE))
|
||||
$this->maintenance();
|
||||
else if (CFG_MAINTENANCE && User::isInGroup(U_GROUP_EMPLOYEE))
|
||||
else if (Cfg::get('MAINTENANCE') && User::isInGroup(U_GROUP_EMPLOYEE))
|
||||
Util::addNote(U_GROUP_EMPLOYEE, 'Maintenance mode enabled!');
|
||||
|
||||
// get errors from previous page from session and apply to template
|
||||
@@ -514,7 +517,7 @@ class GenericPage
|
||||
switch ($type)
|
||||
{
|
||||
case SC_JS_FILE:
|
||||
$str = ($dynData ? HOST_URL : STATIC_URL).'/'.$str;
|
||||
$str = ($dynData ? Cfg::get('HOST_URL') : Cfg::get('STATIC_URL')).'/'.$str;
|
||||
case SC_JS_STRING:
|
||||
if ($flags & SC_FLAG_PREFIX)
|
||||
array_unshift($this->js, [$type, $str]);
|
||||
@@ -522,7 +525,7 @@ class GenericPage
|
||||
$this->js[] = [$type, $str];
|
||||
break;
|
||||
case SC_CSS_FILE:
|
||||
$str = STATIC_URL.'/'.$str;
|
||||
$str = Cfg::get('STATIC_URL').'/'.$str;
|
||||
case SC_CSS_STRING:
|
||||
if ($flags & SC_FLAG_PREFIX)
|
||||
array_unshift($this->css, [$type, $str]);
|
||||
@@ -609,7 +612,7 @@ class GenericPage
|
||||
'mode' => 1,
|
||||
'status' => 1,
|
||||
'name' => 'internal error',
|
||||
'style' => 'color: #ff3333; font-weight: bold; font-size: 14px; padding-left: 40px; background-image: url('.STATIC_URL.'/images/announcements/warn-small.png); background-size: 15px 15px; background-position: 12px center; border: dashed 2px #C03030;',
|
||||
'style' => 'color: #ff3333; font-weight: bold; font-size: 14px; padding-left: 40px; background-image: url('.Cfg::get('STATIC_URL').'/images/announcements/warn-small.png); background-size: 15px 15px; background-position: 12px center; border: dashed 2px #C03030;',
|
||||
'text' => '[span]'.implode("[br]", $_).'[/span]'
|
||||
);
|
||||
}
|
||||
@@ -959,7 +962,7 @@ class GenericPage
|
||||
|
||||
$this->initJSGlobal($type);
|
||||
|
||||
$obj = Type::newList($type, [CFG_SQL_LIMIT_NONE, ['id', array_unique($ids, SORT_NUMERIC)]]);
|
||||
$obj = Type::newList($type, [Cfg::get('SQL_LIMIT_NONE'), ['id', array_unique($ids, SORT_NUMERIC)]]);
|
||||
if (!$obj)
|
||||
continue;
|
||||
|
||||
@@ -981,7 +984,7 @@ class GenericPage
|
||||
if ($this->mode == CACHE_TYPE_NONE)
|
||||
return;
|
||||
|
||||
if (!CFG_CACHE_MODE || CFG_DEBUG)
|
||||
if (!Cfg::get('CACHE_MODE') || Cfg::get('DEBUG'))
|
||||
return;
|
||||
|
||||
$noCache = ['coError', 'ssError', 'viError'];
|
||||
@@ -1004,7 +1007,7 @@ class GenericPage
|
||||
else
|
||||
$cache = $saveString;
|
||||
|
||||
if (CFG_CACHE_MODE & CACHE_MODE_MEMCACHED)
|
||||
if (Cfg::get('CACHE_MODE') & CACHE_MODE_MEMCACHED)
|
||||
{
|
||||
// on &refresh also clear related
|
||||
if ($this->skipCache == CACHE_MODE_MEMCACHED)
|
||||
@@ -1030,7 +1033,7 @@ class GenericPage
|
||||
$this->memcached()->set($cKey, $data);
|
||||
}
|
||||
|
||||
if (CFG_CACHE_MODE & CACHE_MODE_FILECACHE)
|
||||
if (Cfg::get('CACHE_MODE') & CACHE_MODE_FILECACHE)
|
||||
{
|
||||
$data = time()." ".AOWOW_REVISION." ".($saveString ? '1' : '0')."\n";
|
||||
$data .= gzcompress($saveString ? $cache : serialize($cache), 9);
|
||||
@@ -1062,27 +1065,27 @@ class GenericPage
|
||||
if ($this->mode == CACHE_TYPE_NONE)
|
||||
return false;
|
||||
|
||||
if (!CFG_CACHE_MODE || CFG_DEBUG)
|
||||
if (!Cfg::get('CACHE_MODE') || Cfg::get('DEBUG'))
|
||||
return false;
|
||||
|
||||
$cKey = $this->generateCacheKey();
|
||||
$rev = $type = $cache = $data = null;
|
||||
|
||||
if ((CFG_CACHE_MODE & CACHE_MODE_MEMCACHED) && !($this->skipCache & CACHE_MODE_MEMCACHED))
|
||||
if ((Cfg::get('CACHE_MODE') & CACHE_MODE_MEMCACHED) && !($this->skipCache & CACHE_MODE_MEMCACHED))
|
||||
{
|
||||
if ($cache = $this->memcached()->get($cKey))
|
||||
{
|
||||
$type = $cache['isString'];
|
||||
$data = $cache['data'];
|
||||
|
||||
if ($cache['timestamp'] + CFG_CACHE_DECAY <= time() || $cache['revision'] != AOWOW_REVISION)
|
||||
if ($cache['timestamp'] + Cfg::get('CACHE_DECAY') <= time() || $cache['revision'] != AOWOW_REVISION)
|
||||
$cache = null;
|
||||
else
|
||||
$this->cacheLoaded = [CACHE_MODE_MEMCACHED, $cache['timestamp']];
|
||||
}
|
||||
}
|
||||
|
||||
if (!$cache && (CFG_CACHE_MODE & CACHE_MODE_FILECACHE) && !($this->skipCache & CACHE_MODE_FILECACHE))
|
||||
if (!$cache && (Cfg::get('CACHE_MODE') & CACHE_MODE_FILECACHE) && !($this->skipCache & CACHE_MODE_FILECACHE))
|
||||
{
|
||||
if (!file_exists($this->cacheDir.$cKey))
|
||||
return false;
|
||||
@@ -1098,7 +1101,7 @@ class GenericPage
|
||||
|
||||
[$time, $rev, $type] = explode(' ', $cache[0]);
|
||||
|
||||
if ($time + CFG_CACHE_DECAY <= time() || $rev != AOWOW_REVISION)
|
||||
if ($time + Cfg::get('CACHE_DECAY') <= time() || $rev != AOWOW_REVISION)
|
||||
$cache = null;
|
||||
else
|
||||
{
|
||||
@@ -1131,7 +1134,7 @@ class GenericPage
|
||||
|
||||
private function memcached() : Memcached
|
||||
{
|
||||
if (!$this->memcached && (CFG_CACHE_MODE & CACHE_MODE_MEMCACHED))
|
||||
if (!$this->memcached && (Cfg::get('CACHE_MODE') & CACHE_MODE_MEMCACHED))
|
||||
{
|
||||
$this->memcached = new Memcached();
|
||||
$this->memcached->addServer('localhost', 11211);
|
||||
|
||||
@@ -482,7 +482,7 @@ class GuidePage extends GenericPage
|
||||
return false;
|
||||
|
||||
// req: valid data
|
||||
if (!in_array($this->_post['category'], $this->validCats) || !(CFG_LOCALES & (1 << $this->_post['locale'])))
|
||||
if (!in_array($this->_post['category'], $this->validCats) || !(Cfg::get('LOCALES') & (1 << $this->_post['locale'])))
|
||||
return false;
|
||||
|
||||
// sanitize: spec / class
|
||||
|
||||
@@ -31,7 +31,7 @@ class GuildPage extends GenericPage
|
||||
{
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
if (!Cfg::get('PROFILER_ENABLE'))
|
||||
$this->error();
|
||||
|
||||
$params = array_map('urldecode', explode('.', $pageParam));
|
||||
@@ -124,7 +124,7 @@ class GuildPage extends GenericPage
|
||||
/**************/
|
||||
|
||||
// tab: members
|
||||
$member = new LocalProfileList(array(['p.guild', $this->subjectGUID], CFG_SQL_LIMIT_NONE));
|
||||
$member = new LocalProfileList(array(['p.guild', $this->subjectGUID], Cfg::get('SQL_LIMIT_NONE')));
|
||||
if (!$member->error)
|
||||
{
|
||||
$this->lvTabs[] = [ProfileList::$brickFile, array(
|
||||
|
||||
@@ -29,7 +29,7 @@ class GuildsPage extends GenericPage
|
||||
{
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
if (!Cfg::get('PROFILER_ENABLE'))
|
||||
$this->error();
|
||||
|
||||
$this->getSubjectFromUrl($pageParam);
|
||||
@@ -54,7 +54,7 @@ class GuildsPage extends GenericPage
|
||||
protected function generateTitle()
|
||||
{
|
||||
if ($this->realm)
|
||||
array_unshift($this->title, $this->realm,/* CFG_BATTLEGROUP,*/ Lang::profiler('regions', $this->region), Lang::profiler('guilds'));
|
||||
array_unshift($this->title, $this->realm,/* Cfg::get('BATTLEGROUP'),*/ Lang::profiler('regions', $this->region), Lang::profiler('guilds'));
|
||||
else if ($this->region)
|
||||
array_unshift($this->title, Lang::profiler('regions', $this->region), Lang::profiler('guilds'));
|
||||
else
|
||||
@@ -107,12 +107,12 @@ class GuildsPage extends GenericPage
|
||||
$tabData['data'] = array_values($guilds->getListviewData());
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($this->filter['query'] && $guilds->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($this->filter['query'] && $guilds->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_guildsfound2', $this->sumSubjects, $guilds->getMatches());
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
else if ($guilds->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
else if ($guilds->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_guildsfound', $this->sumSubjects, 0);
|
||||
|
||||
if ($this->filterObj->error)
|
||||
|
||||
@@ -41,7 +41,7 @@ class HomePage extends GenericPage
|
||||
$this->extendGlobalData($_);
|
||||
|
||||
if (empty($this->featuredBox['boxBG']))
|
||||
$this->featuredBox['boxBG'] = STATIC_URL.'/images/'.User::$localeString.'/mainpage-bg-news.jpg';
|
||||
$this->featuredBox['boxBG'] = Cfg::get('STATIC_URL').'/images/'.User::$localeString.'/mainpage-bg-news.jpg';
|
||||
|
||||
// load overlay links
|
||||
$this->featuredBox['overlays'] = DB::Aowow()->select('SELECT * FROM ?_home_featuredbox_overlay WHERE featureId = ?d', $this->featuredBox['id']);
|
||||
@@ -55,7 +55,7 @@ class HomePage extends GenericPage
|
||||
protected function generateTitle()
|
||||
{
|
||||
if ($_ = DB::Aowow()->selectCell('SELECT title FROM ?_home_titles WHERE active = 1 AND locale = ?d ORDER BY RAND() LIMIT 1', User::$localeId))
|
||||
$this->homeTitle = CFG_NAME.Lang::main('colon').$_;
|
||||
$this->homeTitle = Cfg::get('NAME').Lang::main('colon').$_;
|
||||
}
|
||||
|
||||
protected function generatePath() {}
|
||||
|
||||
@@ -565,7 +565,7 @@ class ItemPage extends genericPage
|
||||
// tab: container can contain
|
||||
if ($this->subject->getField('slots') > 0)
|
||||
{
|
||||
$contains = new ItemList(array(['bagFamily', $_bagFamily, '&'], ['slots', 1, '<'], CFG_SQL_LIMIT_NONE));
|
||||
$contains = new ItemList(array(['bagFamily', $_bagFamily, '&'], ['slots', 1, '<'], Cfg::get('SQL_LIMIT_NONE')));
|
||||
if (!$contains->error)
|
||||
{
|
||||
$this->extendGlobalData($contains->getJSGlobals(GLOBALINFO_SELF));
|
||||
@@ -586,7 +586,7 @@ class ItemPage extends genericPage
|
||||
// tab: can be contained in (except keys)
|
||||
else if ($_bagFamily != 0x0100)
|
||||
{
|
||||
$contains = new ItemList(array(['bagFamily', $_bagFamily, '&'], ['slots', 0, '>'], CFG_SQL_LIMIT_NONE));
|
||||
$contains = new ItemList(array(['bagFamily', $_bagFamily, '&'], ['slots', 0, '>'], Cfg::get('SQL_LIMIT_NONE')));
|
||||
if (!$contains->error)
|
||||
{
|
||||
$this->extendGlobalData($contains->getJSGlobals(GLOBALINFO_SELF));
|
||||
@@ -1193,7 +1193,7 @@ class ItemPage extends genericPage
|
||||
}
|
||||
|
||||
// link
|
||||
$xml->addChild('link', HOST_URL.'?item='.$this->subject->id);
|
||||
$xml->addChild('link', Cfg::get('HOST_URL').'?item='.$this->subject->id);
|
||||
}
|
||||
|
||||
return $root->asXML();
|
||||
|
||||
@@ -231,7 +231,7 @@ class ItemsPage extends GenericPage
|
||||
$nameSource = [];
|
||||
$grouping = isset($this->filter['gb']) ? $this->filter['gb'] : null;
|
||||
$extraOpts = [];
|
||||
$maxResults = CFG_SQL_LIMIT_DEFAULT;
|
||||
$maxResults = Cfg::get('SQL_LIMIT_DEFAULT');
|
||||
|
||||
switch ($grouping)
|
||||
{
|
||||
@@ -409,7 +409,7 @@ class ItemsPage extends GenericPage
|
||||
}
|
||||
else if ($items->getMatches() > $maxResults)
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsfound', $items->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsfound', $items->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT'));
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,9 +62,9 @@ class ItemsetsPage extends GenericPage
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($itemsets->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($itemsets->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT'));
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,20 +25,20 @@ class MorePage extends GenericPage
|
||||
|
||||
private $page = [];
|
||||
private $req2priv = array(
|
||||
1 => CFG_REP_REQ_COMMENT, // write comments
|
||||
2 => 0, // NYI post external links
|
||||
4 => 0, // NYI no captcha
|
||||
5 => CFG_REP_REQ_SUPERVOTE, // votes count for more
|
||||
9 => CFG_REP_REQ_VOTEMORE_BASE, // more votes per day
|
||||
10 => CFG_REP_REQ_UPVOTE, // can upvote
|
||||
11 => CFG_REP_REQ_DOWNVOTE, // can downvote
|
||||
12 => CFG_REP_REQ_REPLY, // can reply
|
||||
13 => 0, // avatar border [NYI: checked by js, avatars not in use]
|
||||
14 => 0, // avatar border [NYI: checked by js, avatars not in use]
|
||||
15 => 0, // avatar border [NYI: checked by js, avatars not in use]
|
||||
16 => 0, // avatar border [NYI: checked by js, avatars not in use]
|
||||
17 => CFG_REP_REQ_PREMIUM // premium status
|
||||
);
|
||||
1 => 'REP_REQ_COMMENT', // write comments
|
||||
// 2 => 'REP_REQ_EXT_LINKS', // NYI post external links
|
||||
// 4 => 'REP_REQ_NO_CAPTCHA', // NYI no captcha
|
||||
5 => 'REP_REQ_SUPERVOTE', // votes count for more
|
||||
9 => 'REP_REQ_VOTEMORE_BASE', // more votes per day
|
||||
10 => 'REP_REQ_UPVOTE', // can upvote
|
||||
11 => 'REP_REQ_DOWNVOTE', // can downvote
|
||||
12 => 'REP_REQ_REPLY', // can reply
|
||||
13 => 'REP_REQ_BORDER_UNCO', // uncommon avatar border [NYI: hardcoded in Icon.getPrivilegeBorder(), avatars not in use]
|
||||
14 => 'REP_REQ_BORDER_RARE', // rare avatar border [NYI: hardcoded in Icon.getPrivilegeBorder(), avatars not in use]
|
||||
15 => 'REP_REQ_BORDER_EPIC', // epic avatar border [NYI: hardcoded in Icon.getPrivilegeBorder(), avatars not in use]
|
||||
16 => 'REP_REQ_BORDER_LEGE', // legendary avatar border [NYI: hardcoded in Icon.getPrivilegeBorder(), avatars not in use]
|
||||
17 => 'REP_REQ_PREMIUM' // premium status
|
||||
);
|
||||
|
||||
private $validPages = array( // [tabId, path[, subPaths]]
|
||||
'whats-new' => [2, [2, 7]],
|
||||
@@ -49,7 +49,7 @@ class MorePage extends GenericPage
|
||||
'searchplugins' => [2, [2, 8]],
|
||||
'help' => [2, [2, 13], ['commenting-and-you', 'modelviewer', 'screenshots-tips-tricks', 'stat-weighting', 'talent-calculator', 'item-comparison', 'profiler', 'markup-guide']],
|
||||
'reputation' => [1, [3, 10]],
|
||||
'privilege' => [1, [3, 10], [1, 2, 4, 5, 9, 10, 11, 12, 13, 14, 15, 16, 17]],
|
||||
'privilege' => [1, [3, 10], [1, /* 2, 4, */ 5, 9, 10, 11, 12, 13, 14, 15, 16, 17]],
|
||||
'privileges' => [1, [3, 10, 0]],
|
||||
'top-users' => [1, [3, 11]]
|
||||
);
|
||||
@@ -90,7 +90,10 @@ class MorePage extends GenericPage
|
||||
else
|
||||
$this->error();
|
||||
|
||||
// order by requirement ASC
|
||||
// apply actual values and order by requirement ASC
|
||||
foreach ($this->req2priv as &$var)
|
||||
$var = Cfg::get($var);
|
||||
|
||||
asort($this->req2priv);
|
||||
}
|
||||
|
||||
@@ -123,14 +126,7 @@ class MorePage extends GenericPage
|
||||
$this->page[0] != 'privilege')
|
||||
return;
|
||||
|
||||
$consts = get_defined_constants(true);
|
||||
foreach ($consts['user'] as $k => $v)
|
||||
{
|
||||
if (strstr($k, 'CFG_REP_'))
|
||||
$txt = str_replace($k, Lang::nf($v), $txt);
|
||||
else if ($k == 'CFG_USER_MAX_VOTES' || $k == 'CFG_BOARD_URL')
|
||||
$txt = str_replace($k, $v, $txt);
|
||||
}
|
||||
$txt = Cfg::applyToString($txt);
|
||||
}
|
||||
|
||||
protected function generatePath() { }
|
||||
@@ -208,7 +204,7 @@ class MorePage extends GenericPage
|
||||
GROUP BY a.id
|
||||
ORDER BY reputation DESC
|
||||
LIMIT ?d
|
||||
', $t ?: DBSIMPLE_SKIP, CFG_SQL_LIMIT_SEARCH);
|
||||
', $t ?: DBSIMPLE_SKIP, Cfg::get('SQL_LIMIT_SEARCH'));
|
||||
|
||||
$data = [];
|
||||
if ($res)
|
||||
|
||||
@@ -81,9 +81,9 @@ class NpcsPage extends GenericPage
|
||||
$tabData['hiddenCols'] = ['type'];
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($npcs->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($npcs->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_npcsfound', $npcs->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_npcsfound', $npcs->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT'));
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -467,9 +467,9 @@ class ObjectPage extends GenericPage
|
||||
$this->extendGlobalData($focusSpells->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($focusSpells->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($focusSpells->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryNarrowingString, 'LANG.lvnote_spellsfound', $focusSpells->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['note'] = sprintf(Util::$tryNarrowingString, 'LANG.lvnote_spellsfound', $focusSpells->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT'));
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,9 +63,9 @@ class ObjectsPage extends GenericPage
|
||||
$tabData['visibleCols'] = ['skill'];
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($objects->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($objects->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_objectsfound', $objects->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_objectsfound', $objects->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT'));
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ class PetPage extends GenericPage
|
||||
if ($mask & (1 << ($i - 1)))
|
||||
$list[] = $i;
|
||||
|
||||
$food = new ItemList(array(['i.subClass', [5, 8]], ['i.FoodType', $list], CFG_SQL_LIMIT_NONE));
|
||||
$food = new ItemList(array(['i.subClass', [5, 8]], ['i.FoodType', $list], Cfg::get('SQL_LIMIT_NONE')));
|
||||
$this->extendGlobalData($food->getJSGlobals());
|
||||
|
||||
$this->lvTabs[] = [ItemList::$brickFile, array(
|
||||
|
||||
@@ -44,7 +44,7 @@ class ProfilePage extends GenericPage
|
||||
{
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
if (!Cfg::get('PROFILER_ENABLE'))
|
||||
$this->error();
|
||||
|
||||
$params = array_map('urldecode', explode('.', $pageParam));
|
||||
|
||||
@@ -20,7 +20,7 @@ class ProfilerPage extends GenericPage
|
||||
{
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
if (!Cfg::get('PROFILER_ENABLE'))
|
||||
$this->error();
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class ProfilesPage extends GenericPage
|
||||
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
if (!CFG_PROFILER_ENABLE)
|
||||
if (!Cfg::get('PROFILER_ENABLE'))
|
||||
$this->error();
|
||||
|
||||
$realms = [];
|
||||
@@ -62,7 +62,7 @@ class ProfilesPage extends GenericPage
|
||||
protected function generateTitle()
|
||||
{
|
||||
if ($this->realm)
|
||||
array_unshift($this->title, $this->realm,/* CFG_BATTLEGROUP,*/ Lang::profiler('regions', $this->region), Lang::game('profiles'));
|
||||
array_unshift($this->title, $this->realm,/* Cfg::get('BATTLEGROUP'),*/ Lang::profiler('regions', $this->region), Lang::game('profiles'));
|
||||
else if ($this->region)
|
||||
array_unshift($this->title, Lang::profiler('regions', $this->region), Lang::game('profiles'));
|
||||
else
|
||||
@@ -166,12 +166,12 @@ class ProfilesPage extends GenericPage
|
||||
$tabData['visibleCols'][] = 'guildrank';
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($this->filter['query'] && $profiles->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($this->filter['query'] && $profiles->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_charactersfound2', $this->sumSubjects, $profiles->getMatches());
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
else if ($profiles->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
else if ($profiles->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_charactersfound', $this->sumSubjects, 0);
|
||||
|
||||
if ($this->filterObj->useLocalList)
|
||||
|
||||
@@ -75,9 +75,9 @@ class QuestsPage extends GenericPage
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
// create note if search limit was exceeded
|
||||
if ($quests->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($quests->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_questsfound', $quests->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_questsfound', $quests->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT'));
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
else if (isset($this->category[1]) && $this->category[1] > 0)
|
||||
|
||||
@@ -23,7 +23,7 @@ class ScreenshotPage extends GenericPage
|
||||
private $tmpPath = 'static/uploads/temp/';
|
||||
private $pendingPath = 'static/uploads/screenshots/pending/';
|
||||
private $destination = null;
|
||||
private $minSize = CFG_SCREENSHOT_MIN_SIZE;
|
||||
private $minSize = 200;
|
||||
private $command = '';
|
||||
|
||||
protected $validCats = ['add', 'crop', 'complete', 'thankyou'];
|
||||
@@ -43,11 +43,10 @@ class ScreenshotPage extends GenericPage
|
||||
$this->name = Lang::screenshot('submission');
|
||||
$this->command = $pageParam;
|
||||
|
||||
if ($this->minSize <= 0)
|
||||
{
|
||||
trigger_error('config error: dimensions for uploaded screenshots equal or less than zero. Value forced to 200', E_USER_WARNING);
|
||||
$this->minSize = 200;
|
||||
}
|
||||
if ($ms = Cfg::get('SCREENSHOT_MIN_SIZE'))
|
||||
$this->minSize = abs($ms);
|
||||
else
|
||||
trigger_error('config error: Invalid value for minimum screenshot dimensions. Value forced to '.$this->minSize, E_USER_WARNING);
|
||||
|
||||
// get screenshot destination
|
||||
// target delivered as screenshot=<command>&<type>.<typeId>.<hash:16> (hash is optional)
|
||||
@@ -194,7 +193,7 @@ class ScreenshotPage extends GenericPage
|
||||
// r: x <= 488 && y <= 325 while x proportional to y
|
||||
// mincrop is optional and specifies the minimum resulting image size
|
||||
$this->cropper = [
|
||||
'url' => STATIC_URL.'/uploads/temp/'.$this->ssName().'.jpg',
|
||||
'url' => Cfg::get('STATIC_URL').'/uploads/temp/'.$this->ssName().'.jpg',
|
||||
'parent' => 'ss-container',
|
||||
'oWidth' => $oSize[0],
|
||||
'rWidth' => $rSize[0],
|
||||
|
||||
@@ -45,7 +45,7 @@ class SearchPage extends GenericPage
|
||||
'opensearch' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkEmptySet']
|
||||
);
|
||||
|
||||
private $maxResults = CFG_SQL_LIMIT_SEARCH;
|
||||
private $maxResults = 500;
|
||||
private $searchMask = 0x0;
|
||||
private $query = ''; // lookup
|
||||
private $included = [];
|
||||
@@ -84,6 +84,9 @@ class SearchPage extends GenericPage
|
||||
$this->statWeights = [$wt, $wtv];
|
||||
}
|
||||
|
||||
if ($limit = Cfg::get('SQL_LIMIT_SEARCH'))
|
||||
$this->maxResults = $limit;
|
||||
|
||||
// select search mode
|
||||
if ($this->_get['json'])
|
||||
{
|
||||
@@ -99,21 +102,21 @@ class SearchPage extends GenericPage
|
||||
}
|
||||
else if ($this->_get['opensearch'])
|
||||
{
|
||||
$this->maxResults = CFG_SQL_LIMIT_QUICKSEARCH;
|
||||
$this->maxResults = Cfg::get('SQL_LIMIT_QUICKSEARCH');
|
||||
$this->searchMask |= SEARCH_TYPE_OPEN | SEARCH_MASK_OPEN;
|
||||
}
|
||||
else
|
||||
$this->searchMask |= SEARCH_TYPE_REGULAR | SEARCH_MASK_ALL;
|
||||
|
||||
// handle maintenance status for js-cases
|
||||
if (CFG_MAINTENANCE && !User::isInGroup(U_GROUP_EMPLOYEE) && !($this->searchMask & SEARCH_TYPE_REGULAR))
|
||||
if (Cfg::get('MAINTENANCE') && !User::isInGroup(U_GROUP_EMPLOYEE) && !($this->searchMask & SEARCH_TYPE_REGULAR))
|
||||
$this->notFound();
|
||||
|
||||
// fill include, exclude and ignore
|
||||
$this->tokenizeQuery();
|
||||
|
||||
// invalid conditions: not enough characters to search OR no types to search
|
||||
if ((CFG_MAINTENANCE && !User::isInGroup(U_GROUP_EMPLOYEE)) ||
|
||||
if ((Cfg::get('MAINTENANCE') && !User::isInGroup(U_GROUP_EMPLOYEE)) ||
|
||||
(!$this->included && ($this->searchMask & (SEARCH_TYPE_OPEN | SEARCH_TYPE_REGULAR))) ||
|
||||
(($this->searchMask & SEARCH_TYPE_JSON) && !$this->included && !$this->statWeights))
|
||||
{
|
||||
@@ -303,7 +306,7 @@ class SearchPage extends GenericPage
|
||||
|
||||
$hasQ = is_numeric($data['name'][0]) || $data['name'][0] == '@';
|
||||
$result[1][] = ($hasQ ? mb_substr($data['name'], 1) : $data['name']).$osInfo[1];
|
||||
$result[3][] = HOST_URL.'/?'.Type::getFileString($osInfo[0]).'='.$data['id'];
|
||||
$result[3][] = Cfg::get('HOST_URL').'/?'.Type::getFileString($osInfo[0]).'='.$data['id'];
|
||||
|
||||
$extra = [$osInfo[0], $data['id']]; // type, typeId
|
||||
|
||||
@@ -552,7 +555,7 @@ class SearchPage extends GenericPage
|
||||
|
||||
if (($this->searchMask & SEARCH_TYPE_JSON) && ($this->searchMask & 0x20) && !empty($shared['pcsToSet']))
|
||||
{
|
||||
$cnd = [['i.id', array_keys($shared['pcsToSet'])], CFG_SQL_LIMIT_NONE];
|
||||
$cnd = [['i.id', array_keys($shared['pcsToSet'])], Cfg::get('SQL_LIMIT_NONE')];
|
||||
$miscData = ['pcsToSet' => $shared['pcsToSet']];
|
||||
}
|
||||
else if (($this->searchMask & SEARCH_TYPE_JSON) && ($this->searchMask & 0x40))
|
||||
|
||||
@@ -82,7 +82,7 @@ class SkillPage extends GenericPage
|
||||
$condition = array(
|
||||
['OR', ['s.reagent1', 0, '>'], ['s.reagent2', 0, '>'], ['s.reagent3', 0, '>'], ['s.reagent4', 0, '>'], ['s.reagent5', 0, '>'], ['s.reagent6', 0, '>'], ['s.reagent7', 0, '>'], ['s.reagent8', 0, '>']],
|
||||
['OR', ['s.skillLine1', $this->typeId], ['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $this->typeId]]],
|
||||
CFG_SQL_LIMIT_NONE
|
||||
Cfg::get('SQL_LIMIT_NONE')
|
||||
);
|
||||
|
||||
$recipes = new SpellList($condition); // also relevant for 3
|
||||
@@ -104,7 +104,7 @@ class SkillPage extends GenericPage
|
||||
$conditions = array(
|
||||
['requiredSkill', $this->typeId],
|
||||
['class', ITEM_CLASS_RECIPE],
|
||||
CFG_SQL_LIMIT_NONE
|
||||
Cfg::get('SQL_LIMIT_NONE')
|
||||
);
|
||||
|
||||
$recipeItems = new ItemList($conditions);
|
||||
@@ -134,7 +134,7 @@ class SkillPage extends GenericPage
|
||||
|
||||
if ($created)
|
||||
{
|
||||
$created = new ItemList(array(['i.id', $created], CFG_SQL_LIMIT_NONE));
|
||||
$created = new ItemList(array(['i.id', $created], Cfg::get('SQL_LIMIT_NONE')));
|
||||
if (!$created->error)
|
||||
{
|
||||
$this->extendGlobalData($created->getJSGlobals(GLOBALINFO_SELF));
|
||||
@@ -156,7 +156,7 @@ class SkillPage extends GenericPage
|
||||
$conditions = array(
|
||||
['requiredSkill', $this->typeId],
|
||||
['class', ITEM_CLASS_RECIPE, '!'],
|
||||
CFG_SQL_LIMIT_NONE
|
||||
Cfg::get('SQL_LIMIT_NONE')
|
||||
);
|
||||
|
||||
$reqBy = new ItemList($conditions);
|
||||
@@ -179,7 +179,7 @@ class SkillPage extends GenericPage
|
||||
// tab: required by [itemset]
|
||||
$conditions = array(
|
||||
['skillId', $this->typeId],
|
||||
CFG_SQL_LIMIT_NONE
|
||||
Cfg::get('SQL_LIMIT_NONE')
|
||||
);
|
||||
|
||||
$reqBy = new ItemsetList($conditions);
|
||||
@@ -201,7 +201,7 @@ class SkillPage extends GenericPage
|
||||
$condition = array(
|
||||
['AND', ['s.reagent1', 0], ['s.reagent2', 0], ['s.reagent3', 0], ['s.reagent4', 0], ['s.reagent5', 0], ['s.reagent6', 0], ['s.reagent7', 0], ['s.reagent8', 0]],
|
||||
['OR', ['s.skillLine1', $this->typeId], ['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $this->typeId]]],
|
||||
CFG_SQL_LIMIT_NONE
|
||||
Cfg::get('SQL_LIMIT_NONE')
|
||||
);
|
||||
|
||||
foreach (Game::$skillLineMask as $line1 => $sets)
|
||||
@@ -266,7 +266,7 @@ class SkillPage extends GenericPage
|
||||
{
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
$trainer = new CreatureList(array(CFG_SQL_LIMIT_NONE, ['ct.id', $list], ['s.guid', NULL, '!'], ['ct.npcflag', 0x10, '&']));
|
||||
$trainer = new CreatureList(array(Cfg::get('SQL_LIMIT_NONE'), ['ct.id', $list], ['s.guid', NULL, '!'], ['ct.npcflag', 0x10, '&']));
|
||||
|
||||
if (!$trainer->error)
|
||||
{
|
||||
@@ -302,7 +302,7 @@ class SkillPage extends GenericPage
|
||||
|
||||
if ($sort)
|
||||
{
|
||||
$quests = new QuestList(array(['zoneOrSort', -$sort], CFG_SQL_LIMIT_NONE));
|
||||
$quests = new QuestList(array(['zoneOrSort', -$sort], Cfg::get('SQL_LIMIT_NONE')));
|
||||
if (!$quests->error)
|
||||
{
|
||||
$this->extendGlobalData($quests->getJSGlobals());
|
||||
|
||||
@@ -328,7 +328,7 @@ class SoundPage extends GenericPage
|
||||
if ($creatureIds || $displayIds)
|
||||
{
|
||||
$extra = [];
|
||||
$cnds = [CFG_SQL_LIMIT_NONE, &$extra];
|
||||
$cnds = [Cfg::get('SQL_LIMIT_NONE'), &$extra];
|
||||
if (!User::isInGroup(U_GROUP_STAFF))
|
||||
$cnds[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
|
||||
|
||||
|
||||
@@ -54,9 +54,9 @@ class SoundsPage extends GenericPage
|
||||
$tabData['data'] = array_values($sounds->getListviewData());
|
||||
|
||||
// create note if search limit was exceeded; overwriting 'note' is intentional
|
||||
if ($sounds->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($sounds->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_soundsfound', $sounds->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_soundsfound', $sounds->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT'));
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ class SpellPage extends GenericPage
|
||||
|
||||
if ($_ = DB::Aowow()->selectCell('SELECT ic.name FROM ?_glyphproperties gp JOIN ?_icons ic ON gp.iconId = ic.id WHERE gp.spellId = ?d { OR gp.id = ?d }', $this->typeId, $glyphId ?: DBSIMPLE_SKIP))
|
||||
if (file_exists('static/images/wow/Interface/Spellbook/'.$_.'.png'))
|
||||
$infobox .= '[img src='.STATIC_URL.'/images/wow/Interface/Spellbook/'.$_.'.png border=0 float=center margin=15]';
|
||||
$infobox .= '[img src='.Cfg::get('STATIC_URL').'/images/wow/Interface/Spellbook/'.$_.'.png border=0 float=center margin=15]';
|
||||
|
||||
|
||||
/****************/
|
||||
@@ -1127,7 +1127,7 @@ class SpellPage extends GenericPage
|
||||
|
||||
if ($list)
|
||||
{
|
||||
$tbTrainer = new CreatureList(array(CFG_SQL_LIMIT_NONE, ['ct.id', $list], ['s.guid', null, '!'], ['ct.npcflag', 0x10, '&']));
|
||||
$tbTrainer = new CreatureList(array(Cfg::get('SQL_LIMIT_NONE'), ['ct.id', $list], ['s.guid', null, '!'], ['ct.npcflag', 0x10, '&']));
|
||||
if (!$tbTrainer->error)
|
||||
{
|
||||
$this->extendGlobalData($tbTrainer->getJSGlobals());
|
||||
|
||||
@@ -436,9 +436,9 @@ class SpellsPage extends GenericPage
|
||||
}
|
||||
|
||||
// create note if search limit was exceeded; overwriting 'note' is intentional
|
||||
if ($spells->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($spells->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_spellsfound', $spells->getMatches(), CFG_SQL_LIMIT_DEFAULT);
|
||||
$tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_spellsfound', $spells->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT'));
|
||||
$tabData['_truncated'] = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ class UserPage extends GenericPage
|
||||
'_totalCount' => $nFound
|
||||
);
|
||||
|
||||
if ($nFound > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['name'] = '$LANG.tab_latestcomments';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_usercomments, '.$nFound.')';
|
||||
@@ -180,7 +180,7 @@ class UserPage extends GenericPage
|
||||
'_totalCount' => $nFound
|
||||
);
|
||||
|
||||
if ($nFound > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['name'] = '$LANG.tab_latestreplies';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_userreplies, '.$nFound.')';
|
||||
@@ -197,7 +197,7 @@ class UserPage extends GenericPage
|
||||
'_totalCount' => $nFound
|
||||
);
|
||||
|
||||
if ($nFound > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['name'] = '$LANG.tab_latestscreenshots';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_userscreenshots, '.$nFound.')';
|
||||
@@ -214,7 +214,7 @@ class UserPage extends GenericPage
|
||||
'_totalCount' => $nFound
|
||||
);
|
||||
|
||||
if ($nFound > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
{
|
||||
$tabData['name'] = '$LANG.tab_latestvideos';
|
||||
$tabData['note'] = '$$WH.sprintf(LANG.lvnote_uservideos, '.$nFound.')';
|
||||
|
||||
@@ -87,10 +87,10 @@ class UtilityPage extends GenericPage
|
||||
// todo (low): preview should be html-formated
|
||||
$this->feedData[] = array(
|
||||
'title' => [true, [], Lang::typeName($d['type']).Lang::main('colon').htmlentities($d['subject'])],
|
||||
'link' => [false, [], HOST_URL.'/?go-to-comment&id='.$d['id']],
|
||||
'link' => [false, [], Cfg::get('HOST_URL').'/?go-to-comment&id='.$d['id']],
|
||||
'description' => [true, [], htmlentities($d['preview'])."<br /><br />".Lang::main('byUser', [$d['user'], '']) . Util::formatTimeDiff($d['date'], true)],
|
||||
'pubDate' => [false, [], date(DATE_RSS, $d['date'])],
|
||||
'guid' => [false, [], HOST_URL.'/?go-to-comment&id='.$d['id']]
|
||||
'guid' => [false, [], Cfg::get('HOST_URL').'/?go-to-comment&id='.$d['id']]
|
||||
// 'domain' => [false, [], null]
|
||||
);
|
||||
}
|
||||
@@ -100,10 +100,10 @@ class UtilityPage extends GenericPage
|
||||
// todo (low): preview should be html-formated
|
||||
$this->feedData[] = array(
|
||||
'title' => [true, [], Lang::typeName($d['type']).Lang::main('colon').htmlentities($d['subject'])],
|
||||
'link' => [false, [], HOST_URL.'/?go-to-comment&id='.$d['id']],
|
||||
'link' => [false, [], Cfg::get('HOST_URL').'/?go-to-comment&id='.$d['id']],
|
||||
'description' => [true, [], htmlentities($d['preview'])."<br /><br />".Lang::main('byUser', [$d['user'], '']) . Util::formatTimeDiff($d['date'], true)],
|
||||
'pubDate' => [false, [], date(DATE_RSS, $d['date'])],
|
||||
'guid' => [false, [], HOST_URL.'/?go-to-comment&id='.$d['id']]
|
||||
'guid' => [false, [], Cfg::get('HOST_URL').'/?go-to-comment&id='.$d['id']]
|
||||
// 'domain' => [false, [], null]
|
||||
);
|
||||
}
|
||||
@@ -125,7 +125,7 @@ class UtilityPage extends GenericPage
|
||||
{
|
||||
foreach ($data as $d)
|
||||
{
|
||||
$desc = '<a href="'.HOST_URL.'/?'.Type::getFileString($d['type']).'='.$d['typeId'].'#screenshots:id='.$d['id'].'"><img src="'.STATIC_URL.'/uploads/screenshots/thumb/'.$d['id'].'.jpg" alt="" /></a>';
|
||||
$desc = '<a href="'.Cfg::get('HOST_URL').'/?'.Type::getFileString($d['type']).'='.$d['typeId'].'#screenshots:id='.$d['id'].'"><img src="'.Cfg::get('STATIC_URL').'/uploads/screenshots/thumb/'.$d['id'].'.jpg" alt="" /></a>';
|
||||
if ($d['caption'])
|
||||
$desc .= '<br />'.$d['caption'];
|
||||
$desc .= "<br /><br />".Lang::main('byUser', [$d['user'], '']) . Util::formatTimeDiff($d['date'], true);
|
||||
@@ -133,11 +133,11 @@ class UtilityPage extends GenericPage
|
||||
// enclosure/length => filesize('static/uploads/screenshots/thumb/'.$d['id'].'.jpg') .. always set to this placeholder value though
|
||||
$this->feedData[] = array(
|
||||
'title' => [true, [], Lang::typeName($d['type']).Lang::main('colon').htmlentities($d['subject'])],
|
||||
'link' => [false, [], HOST_URL.'/?'.Type::getFileString($d['type']).'='.$d['typeId'].'#screenshots:id='.$d['id']],
|
||||
'link' => [false, [], Cfg::get('HOST_URL').'/?'.Type::getFileString($d['type']).'='.$d['typeId'].'#screenshots:id='.$d['id']],
|
||||
'description' => [true, [], $desc],
|
||||
'pubDate' => [false, [], date(DATE_RSS, $d['date'])],
|
||||
'enclosure' => [false, ['url' => STATIC_URL.'/uploads/screenshots/thumb/'.$d['id'].'.jpg', 'length' => 12345, 'type' => 'image/jpeg'], null],
|
||||
'guid' => [false, [], HOST_URL.'/?'.Type::getFileString($d['type']).'='.$d['typeId'].'#screenshots:id='.$d['id']],
|
||||
'enclosure' => [false, ['url' => Cfg::get('STATIC_URL').'/uploads/screenshots/thumb/'.$d['id'].'.jpg', 'length' => 12345, 'type' => 'image/jpeg'], null],
|
||||
'guid' => [false, [], Cfg::get('HOST_URL').'/?'.Type::getFileString($d['type']).'='.$d['typeId'].'#screenshots:id='.$d['id']],
|
||||
// 'domain' => [false, [], live|ptr]
|
||||
);
|
||||
}
|
||||
@@ -156,7 +156,7 @@ class UtilityPage extends GenericPage
|
||||
{
|
||||
foreach ($data as $d)
|
||||
{
|
||||
$desc = '<a href="'.HOST_URL.'/?'.Type::getFileString($d['type']).'='.$d['typeId'].'#videos:id='.$d['id'].'"><img src="//i3.ytimg.com/vi/'.$d['videoId'].'/default.jpg" alt="" /></a>';
|
||||
$desc = '<a href="'.Cfg::get('HOST_URL').'/?'.Type::getFileString($d['type']).'='.$d['typeId'].'#videos:id='.$d['id'].'"><img src="//i3.ytimg.com/vi/'.$d['videoId'].'/default.jpg" alt="" /></a>';
|
||||
if ($d['caption'])
|
||||
$desc .= '<br />'.$d['caption'];
|
||||
$desc .= "<br /><br />".Lang::main('byUser', [$d['user'], '']) . Util::formatTimeDiff($d['date'], true);
|
||||
@@ -164,11 +164,11 @@ class UtilityPage extends GenericPage
|
||||
// is enclosure/length .. is this even relevant..?
|
||||
$this->feedData[] = array(
|
||||
'title' => [true, [], Lang::typeName($d['type']).Lang::main('colon').htmlentities($d['subject'])],
|
||||
'link' => [false, [], HOST_URL.'/?'.Type::getFileString($d['type']).'='.$d['typeId'].'#videos:id='.$d['id']],
|
||||
'link' => [false, [], Cfg::get('HOST_URL').'/?'.Type::getFileString($d['type']).'='.$d['typeId'].'#videos:id='.$d['id']],
|
||||
'description' => [true, [], $desc],
|
||||
'pubDate' => [false, [], date(DATE_RSS, $d['date'])],
|
||||
'enclosure' => [false, ['url' => '//i3.ytimg.com/vi/'.$d['videoId'].'/default.jpg', 'length' => 12345, 'type' => 'image/jpeg'], null],
|
||||
'guid' => [false, [], HOST_URL.'/?'.Type::getFileString($d['type']).'='.$d['typeId'].'#videos:id='.$d['id']],
|
||||
'guid' => [false, [], Cfg::get('HOST_URL').'/?'.Type::getFileString($d['type']).'='.$d['typeId'].'#videos:id='.$d['id']],
|
||||
// 'domain' => [false, [], live|ptr]
|
||||
);
|
||||
}
|
||||
@@ -238,7 +238,7 @@ class UtilityPage extends GenericPage
|
||||
$this->feedData[] = array(
|
||||
'title' => [true, [], htmlentities(Type::getFileString($type) == 'item' ? mb_substr($d['name'], 1) : $d['name'])],
|
||||
'type' => [false, [], Type::getFileString($type)],
|
||||
'link' => [false, [], HOST_URL.'/?'.Type::getFileString($type).'='.$d['id']],
|
||||
'link' => [false, [], Cfg::get('HOST_URL').'/?'.Type::getFileString($type).'='.$d['id']],
|
||||
'ncomments' => [false, [], $comments[$typeId]]
|
||||
);
|
||||
}
|
||||
@@ -272,11 +272,11 @@ class UtilityPage extends GenericPage
|
||||
|
||||
$channel = $root->addChild('channel');
|
||||
|
||||
$channel->addChild('title', CFG_NAME_SHORT.' - '.$this->name);
|
||||
$channel->addChild('link', HOST_URL.'/?'.$this->page . ($this->category ? '='.$this->category[0] : null));
|
||||
$channel->addChild('description', CFG_NAME);
|
||||
$channel->addChild('title', Cfg::get('NAME_SHORT').' - '.$this->name);
|
||||
$channel->addChild('link', Cfg::get('HOST_URL').'/?'.$this->page . ($this->category ? '='.$this->category[0] : null));
|
||||
$channel->addChild('description', Cfg::get('NAME'));
|
||||
$channel->addChild('language', implode('-', str_split(User::$localeString, 2)));
|
||||
$channel->addChild('ttl', CFG_TTL_RSS);
|
||||
$channel->addChild('ttl', Cfg::get('TTL_RSS'));
|
||||
$channel->addChild('lastBuildDate', date(DATE_RSS));
|
||||
|
||||
foreach ($this->feedData as $row)
|
||||
|
||||
@@ -177,7 +177,7 @@ class ZonePage extends GenericPage
|
||||
$cSpawns = DB::Aowow()->select('SELECT * FROM ?_spawns WHERE areaId = ?d AND type = ?d', $this->typeId, Type::NPC);
|
||||
$aSpawns = User::isInGroup(U_GROUP_STAFF) ? DB::Aowow()->select('SELECT * FROM ?_spawns WHERE areaId = ?d AND type = ?d', $this->typeId, Type::AREATRIGGER) : [];
|
||||
|
||||
$conditions = [CFG_SQL_LIMIT_NONE, ['s.areaId', $this->typeId]];
|
||||
$conditions = [Cfg::get('SQL_LIMIT_NONE'), ['s.areaId', $this->typeId]];
|
||||
if (!User::isInGroup(U_GROUP_STAFF))
|
||||
$conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
|
||||
|
||||
@@ -522,7 +522,7 @@ class ZonePage extends GenericPage
|
||||
'note' => sprintf(Util::$filterResultString, '?npcs&filter=cr=6;crs='.$this->typeId.';crv=0')
|
||||
);
|
||||
|
||||
if ($creatureSpawns->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($creatureSpawns->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
$tabData['_truncated'] = 1;
|
||||
|
||||
$this->extendGlobalData($creatureSpawns->getJSGlobals(GLOBALINFO_SELF));
|
||||
@@ -538,7 +538,7 @@ class ZonePage extends GenericPage
|
||||
'note' => sprintf(Util::$filterResultString, '?objects&filter=cr=1;crs='.$this->typeId.';crv=0')
|
||||
);
|
||||
|
||||
if ($objectSpawns->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
if ($objectSpawns->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
|
||||
$tabData['_truncated'] = 1;
|
||||
|
||||
$this->extendGlobalData($objectSpawns->getJSGlobals(GLOBALINFO_SELF));
|
||||
|
||||
@@ -31,7 +31,7 @@ class ZonesPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$conditions = [CFG_SQL_LIMIT_NONE];
|
||||
$conditions = [Cfg::get('SQL_LIMIT_NONE')];
|
||||
$visibleCols = [];
|
||||
$hiddenCols = [];
|
||||
$mapFile = 0;
|
||||
|
||||
Reference in New Issue
Block a user