mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Siteconfig/Email
* make hardcoded email configurable
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,6 +12,7 @@
|
|||||||
# generated files
|
# generated files
|
||||||
/static/js/profile_all.js
|
/static/js/profile_all.js
|
||||||
/static/js/locale.js
|
/static/js/locale.js
|
||||||
|
/static/js/Markup.js
|
||||||
/static/widgets/power.js
|
/static/widgets/power.js
|
||||||
/static/widgets/power/demo.html
|
/static/widgets/power/demo.html
|
||||||
/static/widgets/searchbox.js
|
/static/widgets/searchbox.js
|
||||||
|
|||||||
@@ -512,6 +512,9 @@ class AjaxAdmin extends AjaxHandler
|
|||||||
case 'static_host':
|
case 'static_host':
|
||||||
$buildList = 'searchplugin,power,searchboxBody,searchboxScript';
|
$buildList = 'searchplugin,power,searchboxBody,searchboxScript';
|
||||||
break;
|
break;
|
||||||
|
case 'contact_email':
|
||||||
|
$buildList = 'markup';
|
||||||
|
break;
|
||||||
case 'locales':
|
case 'locales':
|
||||||
$buildList = 'locales';
|
$buildList = 'locales';
|
||||||
$msg .= ' * remember to rebuild all static files for the language you just added.<br />';
|
$msg .= ' * remember to rebuild all static files for the language you just added.<br />';
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ function siteconfig() : void
|
|||||||
case 'static_host':
|
case 'static_host':
|
||||||
array_push($updScripts, 'searchplugin', 'power', 'searchboxBody', 'searchboxScript');
|
array_push($updScripts, 'searchplugin', 'power', 'searchboxBody', 'searchboxScript');
|
||||||
break;
|
break;
|
||||||
|
case 'contact_email':
|
||||||
|
array_push($updScripts, 'markup');
|
||||||
|
break;
|
||||||
case 'locales':
|
case 'locales':
|
||||||
array_push($updScripts, 'locales');
|
array_push($updScripts, 'locales');
|
||||||
CLI::write(' * remember to rebuild all static files for the language you just added.', CLI::LOG_INFO);
|
CLI::write(' * remember to rebuild all static files for the language you just added.', CLI::LOG_INFO);
|
||||||
@@ -329,7 +332,8 @@ function siteconfig() : void
|
|||||||
{
|
{
|
||||||
CLI::write();
|
CLI::write();
|
||||||
|
|
||||||
if (!$validate($use ? $use['idx'] : ''))
|
$inp = $use['idx'] ?? '';
|
||||||
|
if (!$validate($inp))
|
||||||
{
|
{
|
||||||
CLI::write("value not in range", CLI::LOG_ERROR);
|
CLI::write("value not in range", CLI::LOG_ERROR);
|
||||||
sleep(1);
|
sleep(1);
|
||||||
@@ -338,10 +342,10 @@ function siteconfig() : void
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$oldVal = DB::Aowow()->selectCell('SELECT `value` FROM ?_config WHERE `key` = ?', $key);
|
$oldVal = DB::Aowow()->selectCell('SELECT `value` FROM ?_config WHERE `key` = ?', $key);
|
||||||
DB::Aowow()->query('UPDATE ?_config SET `value` = ? WHERE `key` = ?', $use['idx'], $key);
|
DB::Aowow()->query('UPDATE ?_config SET `value` = ? WHERE `key` = ?', $inp, $key);
|
||||||
|
|
||||||
// postChange returned false => reset value
|
// postChange returned false => reset value
|
||||||
if (!$onChange($key, $use['idx']))
|
if (!$onChange($key, $inp))
|
||||||
{
|
{
|
||||||
DB::Aowow()->query('UPDATE ?_config SET `value` = ? WHERE `key` = ?', $oldVal, $key);
|
DB::Aowow()->query('UPDATE ?_config SET `value` = ? WHERE `key` = ?', $oldVal, $key);
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class FileGen
|
|||||||
'searchboxBody' => ['searchbox.html', 'static/widgets/searchbox/', []],
|
'searchboxBody' => ['searchbox.html', 'static/widgets/searchbox/', []],
|
||||||
'realmMenu' => ['profile_all.js', 'static/js/', ['realmlist']],
|
'realmMenu' => ['profile_all.js', 'static/js/', ['realmlist']],
|
||||||
'locales' => ['locale.js', 'static/js/', []],
|
'locales' => ['locale.js', 'static/js/', []],
|
||||||
|
'markup' => ['Markup.js', 'static/js/', []],
|
||||||
'itemScaling' => ['item-scaling', 'datasets/', []]
|
'itemScaling' => ['item-scaling', 'datasets/', []]
|
||||||
);
|
);
|
||||||
public static $datasets = array( // name => [AowowDeps, TCDeps, info]
|
public static $datasets = array( // name => [AowowDeps, TCDeps, info]
|
||||||
@@ -59,10 +60,11 @@ class FileGen
|
|||||||
);
|
);
|
||||||
|
|
||||||
private static $txtConstants = array(
|
private static $txtConstants = array(
|
||||||
'CFG_NAME' => '',
|
'CFG_NAME' => '',
|
||||||
'CFG_NAME_SHORT' => '',
|
'CFG_NAME_SHORT' => '',
|
||||||
'HOST_URL' => '',
|
'CFG_CONTACT_EMAIL' => '',
|
||||||
'STATIC_URL' => ''
|
'HOST_URL' => '',
|
||||||
|
'STATIC_URL' => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
public static function init(int $mode = self::MODE_NORMAL, array $updScripts = []) : bool
|
public static function init(int $mode = self::MODE_NORMAL, array $updScripts = []) : bool
|
||||||
|
|||||||
@@ -28,13 +28,13 @@ MarkupSourceMap[MARKUP_SOURCE_PTR] = 'ptr';
|
|||||||
MarkupSourceMap[MARKUP_SOURCE_BETA] = 'beta';
|
MarkupSourceMap[MARKUP_SOURCE_BETA] = 'beta';
|
||||||
|
|
||||||
var MarkupDomainRegexMap = {
|
var MarkupDomainRegexMap = {
|
||||||
betaPtrLang: /^(beta|legion|wod|mop|ptr|www|ko|fr|de|cn|es|ru|pt|it)$/,
|
betaPtrLang: /^(www|fr|de|cn|es|ru)$/, // Aowow - /^(beta|legion|wod|mop|ptr|www|ko|fr|de|cn|es|ru|pt|it)$/
|
||||||
lang: /^(www|fr|de|cn|es|ru)$/ // Aowowo - /^(www|ko|fr|de|cn|es|ru|pt|it)$/
|
lang: /^(www|fr|de|cn|es|ru)$/ // Aowow - /^(www|ko|fr|de|cn|es|ru|pt|it)$/
|
||||||
};
|
};
|
||||||
|
|
||||||
var Markup = {
|
var Markup = {
|
||||||
MODE_COMMENT: MARKUP_MODE_COMMENT,
|
MODE_COMMENT: MARKUP_MODE_COMMENT,
|
||||||
MODE_REPLY: MARKUP_MODE_REPLY,
|
MODE_REPLY: MARKUP_MODE_REPLY,
|
||||||
MODE_ARTICLE: MARKUP_MODE_ARTICLE,
|
MODE_ARTICLE: MARKUP_MODE_ARTICLE,
|
||||||
MODE_QUICKFACTS: MARKUP_MODE_QUICKFACTS,
|
MODE_QUICKFACTS: MARKUP_MODE_QUICKFACTS,
|
||||||
MODE_SIGNATURE: MARKUP_MODE_SIGNATURE,
|
MODE_SIGNATURE: MARKUP_MODE_SIGNATURE,
|
||||||
@@ -70,15 +70,15 @@ var Markup = {
|
|||||||
nameCol: 'name_enus',
|
nameCol: 'name_enus',
|
||||||
domainToLocale: {
|
domainToLocale: {
|
||||||
'www': 'enus',
|
'www': 'enus',
|
||||||
'ptr': 'ptr',
|
// 'ptr': 'ptr',
|
||||||
'beta': 'beta',
|
// 'beta': 'beta',
|
||||||
'mop': 'beta',
|
// 'mop': 'beta',
|
||||||
'fr': 'frfr',
|
'fr': 'frfr',
|
||||||
'de': 'dede',
|
'de': 'dede',
|
||||||
'cn': 'zhcn',
|
'cn': 'zhcn',
|
||||||
'es': 'eses',
|
'es': 'eses',
|
||||||
'ru': 'ruru',
|
'ru': 'ruru',
|
||||||
'pt': 'ptbr'
|
// 'pt': 'ptbr'
|
||||||
},
|
},
|
||||||
maps: [],
|
maps: [],
|
||||||
firstTags: {},
|
firstTags: {},
|
||||||
@@ -775,7 +775,7 @@ var Markup = {
|
|||||||
},
|
},
|
||||||
toHtml: function(attr)
|
toHtml: function(attr)
|
||||||
{
|
{
|
||||||
return '<b><span class="icontiny" style="background-image: url(' + g_staticUrl + '/images/icons/email.gif)"><a href="' + (attr.mailto ? 'mailto:feedback@wowhead.com' : 'javascript:;" onclick="ContactTool.show();') + '">feedback@wowhead.com</a></span></b>';
|
return '<b><span class="icontiny" style="background-image: url(' + g_staticUrl + '/images/icons/email.gif)"><a href="' + (attr.mailto ? 'mailto:CFG_CONTACT_EMAIL' : 'javascript:;" onclick="ContactTool.show();') + '">CFG_CONTACT_EMAIL</a></span></b>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
forumrules:
|
forumrules:
|
||||||
1
setup/updates/1647813287_01.sql
Normal file
1
setup/updates/1647813287_01.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`build`, ''), ' markup');
|
||||||
Reference in New Issue
Block a user