diff --git a/includes/user.class.php b/includes/user.class.php index 1c88ff9b..5d28aac2 100644 --- a/includes/user.class.php +++ b/includes/user.class.php @@ -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], diff --git a/localization/lang.class.php b/localization/lang.class.php index 56cfa33e..8184cae0 100644 --- a/localization/lang.class.php +++ b/localization/lang.class.php @@ -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; diff --git a/localization/locale_dede.php b/localization/locale_dede.php index b13bf3a1..d9ed493e 100644 --- a/localization/locale_dede.php +++ b/localization/locale_dede.php @@ -105,6 +105,11 @@ $lang = array( // profiler 'realm' => "Realm", 'region' => "Region", + 'viewCharacter' => "Charakter anzeigen", + '_cpHead' => "Charakter-Profiler", + '_cpHint' => "Der Charakter-Profiler 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 Hilfeseite nach.", + '_cpFooter' => "Falls Ihr eine genauere Suche möchtet, probiert unsere erweiterten Suchoptionen. Ihr könnt außerdem ein neues individuelles Profil 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", diff --git a/localization/locale_enus.php b/localization/locale_enus.php index 7ec8382e..9342f2f1 100644 --- a/localization/locale_enus.php +++ b/localization/locale_enus.php @@ -100,6 +100,11 @@ $lang = array( // profiler 'realm' => "Realm", 'region' => "Region", + 'viewCharacter' => "View Character", + '_cpHead' => "Character Profiler", + '_cpHint' => "The Character Profiler 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 help page.", + '_cpFooter' => "If you want a more refined search try out our advanced search options. You can also create a new custom profile.", // 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", diff --git a/localization/locale_eses.php b/localization/locale_eses.php index 48c79dc3..26a88f8e 100644 --- a/localization/locale_eses.php +++ b/localization/locale_eses.php @@ -105,6 +105,11 @@ $lang = array( // profiler 'realm' => "Reino", 'region' => "Región", + 'viewCharacter' => "View Character", + '_cpHead' => "Perfiles de Personaje", + '_cpHint' => "l Gestor de perfiles 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 página de ayuda.", + '_cpFooter' => "Si quieres una búsqueda más refinada, prueba con nuestras opciones de búsqueda avanzada. También puedes crear un perfil nuevo personalizado.", // 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", diff --git a/localization/locale_frfr.php b/localization/locale_frfr.php index 6ea46034..70d5e6a6 100644 --- a/localization/locale_frfr.php +++ b/localization/locale_frfr.php @@ -105,6 +105,11 @@ $lang = array( // profiler 'realm' => "Royaume", 'region' => "Région", + 'viewCharacter' => "Voir Personnage", + '_cpHead' => "Profiler de Personnage", + '_cpHint' => "Le Profiler de Personnage 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 page d'aide détaillée.", + '_cpFooter' => "Si vous voulez une recherche plus raffinée, essayez nos options de recherche avancée. Vous pouvez aussi créer un nouveau profile personnalisé.", // 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", diff --git a/localization/locale_ruru.php b/localization/locale_ruru.php index 70ace67b..15f8ab52 100644 --- a/localization/locale_ruru.php +++ b/localization/locale_ruru.php @@ -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' => "Профили персонажей позволяет вам редактировать своего персонажа, находить улучшения предметов и многое другое!", + '_cpHelp' => "Чтобы начать использовать профили персонажей, следуйте инструкциям ниже. Если вам потребуется помощь, вы можете обратиться к справке.", + '_cpFooter' => "Если вам нужен более точный поиск, вы можете использовать дополнительные опции. Также, вы можете создать новый собственный профиль.", // 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' => "достижение", diff --git a/pages/genericPage.class.php b/pages/genericPage.class.php index 21b9f450..c9eb611e 100644 --- a/pages/genericPage.class.php +++ b/pages/genericPage.class.php @@ -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]; } } diff --git a/pages/profile.php b/pages/profile.php index 0c575c17..9bef44ac 100644 --- a/pages/profile.php +++ b/pages/profile.php @@ -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'])); diff --git a/pages/profiler.php b/pages/profiler.php new file mode 100644 index 00000000..4060fc7a --- /dev/null +++ b/pages/profiler.php @@ -0,0 +1,29 @@ + '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'])); + } +} + +?> diff --git a/pages/search.php b/pages/search.php index efd0b07f..30767a65 100644 --- a/pages/search.php +++ b/pages/search.php @@ -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() { } diff --git a/static/js/global.js b/static/js/global.js index 3ab79e3c..a0ed3612 100644 --- a/static/js/global.js +++ b/static/js/global.js @@ -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) diff --git a/static/js/profile.js b/static/js/profile.js index ed5d49bd..c1daf22a 100644 --- a/static/js/profile.js +++ b/static/js/profile.js @@ -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; } diff --git a/template/pages/profiler.tpl.php b/template/pages/profiler.tpl.php new file mode 100644 index 00000000..21f716fa --- /dev/null +++ b/template/pages/profiler.tpl.php @@ -0,0 +1,59 @@ +brick('header'); ?> + +
+
+
+ +brick('announcement'); + + $this->brick('pageTemplate'); +?> + +
+

+ +

+ +
+ +

+ +
+
+

+ +
+ +
+

+ + +
+ +
+

+ +
+
+ +
+ + +
+
+ +
+ +

+
+ + + +
+
+
+ +brick('footer'); ?> diff --git a/template/pages/search.tpl.php b/template/pages/search.tpl.php index fb37c040..2d74c295 100644 --- a/template/pages/search.tpl.php +++ b/template/pages/search.tpl.php @@ -14,9 +14,9 @@ $this->brick('pageTemplate'); WowheadWowhead lvTabs): - echo '

'.Lang::$search['foundResult'].' '.Util::htmlEscape($this->search).''; + echo '

'.Lang::$main['foundResult'].' '.Util::htmlEscape($this->search).''; if ($this->invalid): - echo ''.sprintf(Lang::$search['ignoredTerms'], implode(', ', $this->invalid)).''; + echo ''.sprintf(Lang::$main['ignoredTerms'], implode(', ', $this->invalid)).''; endif; echo "

\n"; ?> @@ -25,16 +25,16 @@ if ($this->lvTabs): $this->brick('lvTabs'); else: - echo '

'.Lang::$search['noResult'].' '.Util::htmlEscape($this->search).''; + echo '

'.Lang::$main['noResult'].' '.Util::htmlEscape($this->search).''; if ($this->invalid): - echo ''.sprintf(Lang::$search['ignoredTerms'], implode(', ', $this->invalid)).''; + echo ''.sprintf(Lang::$main['ignoredTerms'], implode(', ', $this->invalid)).''; endif; echo "

\n"; ?>