mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Localization: remove search-group and move strings to main
Profiler: implemented frontpage (?profiler) Announcements: parse for STATIC_URL and HOST_URL
This commit is contained in:
@@ -346,6 +346,7 @@ class User
|
||||
// existing chars on realm(s)
|
||||
$characters = array(
|
||||
array(
|
||||
'id' => $character['id'],
|
||||
'name' => $character['name'],
|
||||
'realmname' => $character['realm'][1],
|
||||
'region' => $character['region'][0],
|
||||
|
||||
@@ -8,9 +8,6 @@ class Lang
|
||||
public static $mail;
|
||||
public static $game;
|
||||
|
||||
public static $search;
|
||||
public static $profiler;
|
||||
|
||||
public static $achievement;
|
||||
public static $class;
|
||||
public static $currency;
|
||||
|
||||
@@ -105,6 +105,11 @@ $lang = array(
|
||||
// profiler
|
||||
'realm' => "Realm",
|
||||
'region' => "Region",
|
||||
'viewCharacter' => "Charakter anzeigen",
|
||||
'_cpHead' => "Charakter-Profiler",
|
||||
'_cpHint' => "Der <b>Charakter-Profiler</b> gibt Euch die Möglichkeit, Euren Charakter zu editieren, bessere Ausrüstung zu finden, Eure Gearscore zu überprüfen, und mehr!",
|
||||
'_cpHelp' => "Um loszulegen, folgt einfach den untenstehenden Schritten. Falls Ihr mehr Informationen benötigt, schaut auf unserer ausführlichen <a href=\"?help=profiler\">Hilfeseite</a> nach.",
|
||||
'_cpFooter' => "Falls Ihr eine genauere Suche möchtet, probiert unsere <a href=\"?profiles\">erweiterten Suchoptionen</a>. Ihr könnt außerdem ein <a href=\"?profile&new\">neues individuelles Profil</a> erstellen.",
|
||||
|
||||
// help
|
||||
'help' => "Hilfe",
|
||||
@@ -113,17 +118,17 @@ $lang = array(
|
||||
"Talentrechner", "Gegenstandsvergleich", "Profiler"
|
||||
),
|
||||
|
||||
// formating
|
||||
'colon' => ': ',
|
||||
'dateFmtShort' => "d.m.Y",
|
||||
'dateFmtLong' => "d.m.Y \u\m H:i"
|
||||
),
|
||||
'search' => array(
|
||||
// search
|
||||
'search' => "Suche",
|
||||
'foundResult' => "Suchergebnisse für",
|
||||
'noResult' => "Keine Ergebnisse für",
|
||||
'tryAgain' => "Bitte versucht es mit anderen Suchbegriffen oder überprüft deren Schreibweise.",
|
||||
'ignoredTerms' => "Die folgenden Wörter wurden in Eurer Suche ignoriert: %s"
|
||||
'ignoredTerms' => "Die folgenden Wörter wurden in Eurer Suche ignoriert: %s",
|
||||
|
||||
// formating
|
||||
'colon' => ': ',
|
||||
'dateFmtShort' => "d.m.Y",
|
||||
'dateFmtLong' => "d.m.Y \u\m H:i"
|
||||
),
|
||||
'game' => array(
|
||||
'achievement' => "Erfolg",
|
||||
|
||||
@@ -100,6 +100,11 @@ $lang = array(
|
||||
// profiler
|
||||
'realm' => "Realm",
|
||||
'region' => "Region",
|
||||
'viewCharacter' => "View Character",
|
||||
'_cpHead' => "Character Profiler",
|
||||
'_cpHint' => "The <b>Character Profiler</b> lets you edit your character, find gear upgrades, check your gearscore and more!",
|
||||
'_cpHelp' => "To get started, just follow the steps below. If you'd like more information, check out our extensive <a href=\"?help=profiler\">help page</a>.",
|
||||
'_cpFooter' => "If you want a more refined search try out our <a href=\"?profiles\">advanced search</a> options. You can also create a <a href=\"?profile&new\">new custom profile</a>.",
|
||||
|
||||
// help
|
||||
'help' => "Help",
|
||||
@@ -108,17 +113,17 @@ $lang = array(
|
||||
"Talent Calculator", "Item Comparison", "Profiler"
|
||||
),
|
||||
|
||||
// formating
|
||||
'colon' => ': ',
|
||||
'dateFmtShort' => "Y/m/d",
|
||||
'dateFmtLong' => "Y/m/d \a\\t H:i"
|
||||
),
|
||||
'search' => array(
|
||||
// search
|
||||
'search' => "Search",
|
||||
'foundResult' => "Search Results for",
|
||||
'noResult' => "No Results for",
|
||||
'tryAgain' => "Please try some different keywords or check your spelling.",
|
||||
'ignoredTerms' => "The following words were ignored in your search: %s"
|
||||
'ignoredTerms' => "The following words were ignored in your search: %s",
|
||||
|
||||
// formating
|
||||
'colon' => ': ',
|
||||
'dateFmtShort' => "Y/m/d",
|
||||
'dateFmtLong' => "Y/m/d \a\\t H:i"
|
||||
),
|
||||
'game' => array(
|
||||
'achievement' => "achievement",
|
||||
|
||||
@@ -105,6 +105,11 @@ $lang = array(
|
||||
// profiler
|
||||
'realm' => "Reino",
|
||||
'region' => "Región",
|
||||
'viewCharacter' => "View Character",
|
||||
'_cpHead' => "Perfiles de Personaje",
|
||||
'_cpHint' => "l <b>Gestor de perfiles</b> te permite editar tu personaje, encontrar mejoras de equipo, comprobar tu gearscore, ¡y más!",
|
||||
'_cpHelp' => "Para comenzar, sigue los pasos abajo indicados. Si quieres más información, revisa nuestra amplia <a href=\"?help=profiler\">página de ayuda</a>.",
|
||||
'_cpFooter' => "Si quieres una búsqueda más refinada, prueba con nuestras opciones de <a href=\"?profiles\">búsqueda avanzada</a>. También puedes crear un <a href=\"?profile&new\">perfil nuevo personalizado</a>.",
|
||||
|
||||
// help
|
||||
'help' => "Ayuda",
|
||||
@@ -113,17 +118,17 @@ $lang = array(
|
||||
"Calculadora de talentos", "Comparación de objetos", "Perfiles"
|
||||
),
|
||||
|
||||
// formating
|
||||
'colon' => ': ',
|
||||
'dateFmtShort' => "d/m/Y",
|
||||
'dateFmtLong' => "d/m/Y \a \l\a\s H:i"
|
||||
),
|
||||
'search' => array(
|
||||
// search
|
||||
'search' => "Búsqueda",
|
||||
'foundResult' => "Resultados de busqueda para",
|
||||
'noResult' => "Ningún resultado para",
|
||||
'tryAgain' => "Por favor, introduzca otras palabras claves o verifique el término ingresado.",
|
||||
'ignoredTerms' => "Las siguientes palabras fueron ignoradas en tu búsqueda: %s"
|
||||
'ignoredTerms' => "Las siguientes palabras fueron ignoradas en tu búsqueda: %s",
|
||||
|
||||
// formating
|
||||
'colon' => ': ',
|
||||
'dateFmtShort' => "d/m/Y",
|
||||
'dateFmtLong' => "d/m/Y \a \l\a\s H:i"
|
||||
),
|
||||
'game' => array(
|
||||
'achievement' => "logro",
|
||||
|
||||
@@ -105,6 +105,11 @@ $lang = array(
|
||||
// profiler
|
||||
'realm' => "Royaume",
|
||||
'region' => "Région",
|
||||
'viewCharacter' => "Voir Personnage",
|
||||
'_cpHead' => "Profiler de Personnage",
|
||||
'_cpHint' => "Le <b>Profiler de Personnage</b> vous permets de modifier votre personnage, trouver des améliorations d'équipement, vérifier votre score d'équipement et plus!",
|
||||
'_cpHelp' => "Pour débuter, suivez simplement les étapes ci-dessous. Si vous voulez plus d'information, lisez notre <a href=\"?help=profiler\">page d'aide</a> détaillée.",
|
||||
'_cpFooter' => "Si vous voulez une recherche plus raffinée, essayez nos options de <a href=\"?profiles\">recherche avancée</a>. Vous pouvez aussi créer un <a href=\"?profile&new\">nouveau profile personnalisé</a>.",
|
||||
|
||||
// help
|
||||
'help' => "Aide",
|
||||
@@ -113,17 +118,17 @@ $lang = array(
|
||||
"Calculateur de talents", "Comparaison d'objets", "Profiler"
|
||||
),
|
||||
|
||||
// formating
|
||||
'colon' => ' : ',
|
||||
'dateFmtShort' => "Y-m-d",
|
||||
'dateFmtLong' => "Y-m-d à H:i"
|
||||
),
|
||||
'search' => array(
|
||||
// search
|
||||
'search' => "Recherche",
|
||||
'foundResult' => "Résultats de recherche pour",
|
||||
'noResult' => "Aucun résultat pour malordawsne",
|
||||
'tryAgain' => "Veuillez essayer d'autres mots ou vérifiez l'orthographe des termes de recherche.",
|
||||
'ignoredTerms' => "Les mots suivants ont été ignorés dans votre recherches : %s"
|
||||
'ignoredTerms' => "Les mots suivants ont été ignorés dans votre recherches : %s",
|
||||
|
||||
// formating
|
||||
'colon' => ' : ',
|
||||
'dateFmtShort' => "Y-m-d",
|
||||
'dateFmtLong' => "Y-m-d à H:i"
|
||||
),
|
||||
'game' => array (
|
||||
'achievement' => "haut fait",
|
||||
|
||||
@@ -21,7 +21,7 @@ $lang = array(
|
||||
'link' => "Ссылка",
|
||||
'signIn' => "Вход / Регистрация",
|
||||
'jsError' => "Для работы этого сайта необходим JavaScript.",
|
||||
'searchButton' => "Искать",
|
||||
'searchButton' => "Поиск",
|
||||
'language' => "Язык",
|
||||
'feedback' => "Отзыв",
|
||||
'numSQL' => "Количество MySQL запросов",
|
||||
@@ -105,6 +105,11 @@ $lang = array(
|
||||
// profiler
|
||||
'realm' => "Игровой мир",
|
||||
'region' => "Регион",
|
||||
'viewCharacter' => "Открыть персонажа",
|
||||
'_cpHead' => "Профили персонажей",
|
||||
'_cpHint' => "<b>Профили персонажей</b> позволяет вам редактировать своего персонажа, находить улучшения предметов и многое другое!",
|
||||
'_cpHelp' => "Чтобы начать использовать профили персонажей, следуйте инструкциям ниже. Если вам потребуется помощь, вы можете обратиться к <a href=\"?help=profiler\">справке</a>.",
|
||||
'_cpFooter' => "Если вам нужен более точный поиск, вы можете использовать <a href=\"?profiles\">дополнительные опции</a>. Также, вы можете создать <a href=\"?profile&new\">новый собственный профиль</a>.",
|
||||
|
||||
// help
|
||||
'help' => "Справка",
|
||||
@@ -113,17 +118,17 @@ $lang = array(
|
||||
"Расчёт талантов", "Сравнение предметов", "Профили персонажей"
|
||||
),
|
||||
|
||||
// formating
|
||||
'colon' => ": ",
|
||||
'dateFmtShort' => "Y-m-d",
|
||||
'dateFmtLong' => "Y-m-d в H:i"
|
||||
),
|
||||
'search' => array(
|
||||
// search
|
||||
'search' => "Поиск",
|
||||
'foundResult' => "Результаты поиска для",
|
||||
'noResult' => "Ничего не найдено для",
|
||||
'tryAgain' => "Пожалуйста, попробуйте другие ключевые слова или проверьте правильность запроса.",
|
||||
'ignoredTerms' => "[Следующие слова были проигнорированы в вашему запросу]: %s"
|
||||
'ignoredTerms' => "[Следующие слова были проигнорированы в вашему запросу]: %s",
|
||||
|
||||
// formating
|
||||
'colon' => ": ",
|
||||
'dateFmtShort' => "Y-m-d",
|
||||
'dateFmtLong' => "Y-m-d в H:i"
|
||||
),
|
||||
'game' => array(
|
||||
'achievement' => "достижение",
|
||||
|
||||
@@ -288,7 +288,7 @@ class GenericPage
|
||||
'mode' => 1,
|
||||
'status' => 1,
|
||||
'name' => 'internal error',
|
||||
'style' => 'padding-left: 40px; background-image: url(static/images/announcements/warn-small.png); background-size: 15px 15px; background-position: 12px center; border: dashed 2px #C03030;',
|
||||
'style' => '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;',
|
||||
'text' => '[span id=inputbox-error]'.implode("[br]", $_).'[/span]',
|
||||
);
|
||||
}
|
||||
@@ -301,7 +301,13 @@ class GenericPage
|
||||
{
|
||||
if ($t = Util::localizedString($v, 'text'))
|
||||
{
|
||||
$ann[$k]['text'] = $t;
|
||||
$replace = array(
|
||||
'HOST_URL' => HOST_URL,
|
||||
'STATIC_URL' => STATIC_URL
|
||||
);
|
||||
|
||||
$ann[$k]['text'] = strtr($t, $replace);
|
||||
$ann[$k]['style'] = strtr($ann[$k]['style'], $replace);
|
||||
$this->announcements[] = $ann[$k];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,8 +37,9 @@ class ProfilePage extends GenericPage
|
||||
|
||||
if (count($_) == 1 && intVal($_[0]))
|
||||
{
|
||||
if ($_ = DB::Aowow()->selectCell('SELECT 2161862')) // some query to validate existence of char
|
||||
$this->profileId = $_;
|
||||
// todo: some query to validate existence of char
|
||||
if ($foo = DB::Aowow()->selectCell('SELECT 2161862'))
|
||||
$this->profileId = $foo;
|
||||
else
|
||||
$this->notFound(Util::ucFirst(Lang::$game['profile']));
|
||||
|
||||
@@ -47,7 +48,8 @@ class ProfilePage extends GenericPage
|
||||
}
|
||||
else if (count($_) == 3)
|
||||
{
|
||||
if ($foo = DB::Aowow()->selectCell('SELECT 2161862')) // some query to validate existence of char
|
||||
// todo: some query to validate existence of char
|
||||
if ($foo = DB::Aowow()->selectCell('SELECT 2161862'))
|
||||
$this->profileId = $foo;
|
||||
else
|
||||
$this->notFound(Util::ucFirst(Lang::$game['profile']));
|
||||
|
||||
29
pages/profiler.php
Normal file
29
pages/profiler.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class ProfilerPage extends GenericPage
|
||||
{
|
||||
protected $path = [1, 5];
|
||||
protected $tabId = 1;
|
||||
protected $tpl = 'profiler';
|
||||
protected $gDataKey = true;
|
||||
protected $js = ['profile_all.js', 'profile.js'];
|
||||
protected $css = [['path' => 'Profiler.css']];
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addJS('?data=realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
||||
}
|
||||
|
||||
protected function generatePath() { }
|
||||
|
||||
protected function generateTitle()
|
||||
{
|
||||
array_unshift($this->title, Util::ucFirst(Lang::$main['_cpHead']));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -179,7 +179,7 @@ class SearchPage extends GenericPage
|
||||
|
||||
protected function generateTitle()
|
||||
{
|
||||
array_unshift($this->title, $this->search, Lang::$search['search']);
|
||||
array_unshift($this->title, $this->search, Lang::$main['search']);
|
||||
}
|
||||
|
||||
protected function generatePath() { }
|
||||
|
||||
@@ -586,7 +586,7 @@ var PageTemplate = new function()
|
||||
locale.description,
|
||||
g_host + '?locale=' + locale.id, // sarjuuk: edited for unsupported subdomains # linkBefore + locale.domain + linkAfter
|
||||
null, // more custom
|
||||
{rel: linkBefore + linkAfter + " domain=" + locale.domain} // also custom
|
||||
{rel: location.href + " domain=" + locale.domain} // also custom
|
||||
];
|
||||
|
||||
if(locale.id == localeId)
|
||||
|
||||
@@ -638,7 +638,7 @@ function pr_DirectLookup(form, browse)
|
||||
if(browse)
|
||||
{
|
||||
if(region.val() || server.val() || name.val())
|
||||
location.href = '/profiles' + (region.val() ? '=' + region.val() + (server.val() ? '.' + g_urlize(server.val(), false, true) : '') : '') + (name.val() ? '?filter=na=' + name.val() + ';ex=on' : '');
|
||||
location.href = '?profiles' + (region.val() ? '=' + region.val() + (server.val() ? '.' + g_urlize(server.val(), false, true) : '') : '') + (name.val() ? '?filter=na=' + name.val() + ';ex=on' : '');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -673,7 +673,7 @@ function pr_DirectLookup(form, browse)
|
||||
if(region.val() && server.val())
|
||||
usePath = false;
|
||||
|
||||
location.href = (usePath ? menuItem[2].replace('profiles', 'profile') : '/profile=' + region.val() + '.' + g_urlize(server.val(), false, true)) + '.' + g_cleanCharacterName(name.val());
|
||||
location.href = (usePath ? menuItem[2].replace('profiles', 'profile') : '?profile=' + region.val() + '.' + g_urlize(server.val(), false, true)) + '.' + g_cleanCharacterName(name.val());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
59
template/pages/profiler.tpl.php
Normal file
59
template/pages/profiler.tpl.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php $this->brick('header'); ?>
|
||||
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
|
||||
<?php
|
||||
$this->brick('announcement');
|
||||
|
||||
$this->brick('pageTemplate');
|
||||
?>
|
||||
|
||||
<div class="text">
|
||||
<h1><?php echo Lang::$main['_cpHead']; ?></h1>
|
||||
|
||||
<p><?php echo Lang::$main['_cpHint']; ?></p>
|
||||
|
||||
<div class="pad"></div>
|
||||
|
||||
<p><?php echo Lang::$main['_cpHelp']; ?></p>
|
||||
|
||||
<div class="profiler-home">
|
||||
<div>
|
||||
<h2><?php echo Util::ucFirst(Lang::$main['name']).Lang::$main['colon']; ?></h2>
|
||||
<input type="text" name="na" value="" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2><?php echo Lang::$main['region'].Lang::$main['colon']; ?></h2>
|
||||
<input type="radio" name="rg" value="us" id="rg-1" checked="checked" /><label for="rg-1" class="profiler-button profiler-option-left selected"><em><i>US & Oceanic</i></em></label>
|
||||
<input type="radio" name="rg" value="eu" id="rg-2" /><label for="rg-2" class="profiler-button profiler-option-right"><em><i>Europe</i></em></label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2><?php echo Lang::$main['realm'].Lang::$main['colon']; ?></h2>
|
||||
<input type="text" name="sv" autocomplete="off" />
|
||||
<div class="profiler-autocomplete"></div>
|
||||
</div>
|
||||
|
||||
<div class="profiler-buttons">
|
||||
<a href="javascript:;" class="profiler-button" id="profiler-lookup"><em><?php echo Lang::$main['viewCharacter']; ?></em></a>
|
||||
<a href="javascript:;" class="profiler-button" id="profiler-search"><em><?php echo Lang::$main['searchButton']; ?></em></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clear pad3"></div>
|
||||
|
||||
<p><?php echo Lang::$main['_cpFooter']; ?></p>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
pr_initProfilerHome();
|
||||
//]]></script>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div><!-- main-contents -->
|
||||
</div><!-- main -->
|
||||
|
||||
<?php $this->brick('footer'); ?>
|
||||
@@ -14,9 +14,9 @@ $this->brick('pageTemplate');
|
||||
<a href="<?php echo Util::$wowheadLink; ?>" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
|
||||
<?php
|
||||
if ($this->lvTabs):
|
||||
echo ' <h1>'.Lang::$search['foundResult'].' <i>'.Util::htmlEscape($this->search).'</i>';
|
||||
echo ' <h1>'.Lang::$main['foundResult'].' <i>'.Util::htmlEscape($this->search).'</i>';
|
||||
if ($this->invalid):
|
||||
echo '<span class="sub">'.sprintf(Lang::$search['ignoredTerms'], implode(', ', $this->invalid)).'</span>';
|
||||
echo '<span class="sub">'.sprintf(Lang::$main['ignoredTerms'], implode(', ', $this->invalid)).'</span>';
|
||||
endif;
|
||||
echo "</h1>\n";
|
||||
?>
|
||||
@@ -25,16 +25,16 @@ if ($this->lvTabs):
|
||||
$this->brick('lvTabs');
|
||||
|
||||
else:
|
||||
echo ' <h1>'.Lang::$search['noResult'].' <i>'.Util::htmlEscape($this->search).'</i>';
|
||||
echo ' <h1>'.Lang::$main['noResult'].' <i>'.Util::htmlEscape($this->search).'</i>';
|
||||
if ($this->invalid):
|
||||
echo '<span class="sub">'.sprintf(Lang::$search['ignoredTerms'], implode(', ', $this->invalid)).'</span>';
|
||||
echo '<span class="sub">'.sprintf(Lang::$main['ignoredTerms'], implode(', ', $this->invalid)).'</span>';
|
||||
endif;
|
||||
echo "</h1>\n";
|
||||
?>
|
||||
<div class="search-noresults"></div>
|
||||
|
||||
<?php
|
||||
echo ' '.Lang::$search['tryAgain']."\n";
|
||||
echo ' '.Lang::$main['tryAgain']."\n";
|
||||
endif;
|
||||
?>
|
||||
<div class="clear"></div>
|
||||
|
||||
Reference in New Issue
Block a user