mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-17 03:03:26 +02:00
feat: Rewrite of the core: avoid globals where possible
Create services for: login, status, router, database, AnonymousStatistics Drop gesior.backward_support Drop compat/pages.php Drop part of compat/classes.php Move signature to routes
This commit is contained in:
@@ -15,9 +15,9 @@ defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Characters';
|
||||
|
||||
$groups = new OTS_Groups_List();
|
||||
function generate_search_form($autofocus = false)
|
||||
function generate_search_form($autofocus = false): string
|
||||
{
|
||||
global $config, $twig;
|
||||
$twig = app()->get('twig');
|
||||
return $twig->render('characters.form.html.twig', array(
|
||||
'link' => getLink('characters'),
|
||||
'autofocus' => $autofocus
|
||||
@@ -26,7 +26,9 @@ function generate_search_form($autofocus = false)
|
||||
|
||||
function retrieve_former_name($name)
|
||||
{
|
||||
global $oldName, $db;
|
||||
global $oldName;
|
||||
|
||||
$db = app()->get('db');
|
||||
|
||||
if($db->hasTable('player_namelocks') && $db->hasColumn('player_namelocks', 'name')) {
|
||||
$newNameSql = $db->query('SELECT `name`, `new_name` FROM `player_namelocks` WHERE `name` = ' . $db->quote($name));
|
||||
@@ -42,8 +44,9 @@ function retrieve_former_name($name)
|
||||
}
|
||||
|
||||
$name = '';
|
||||
if(isset($_REQUEST['name']))
|
||||
if(isset($_REQUEST['name'])) {
|
||||
$name = urldecode(stripslashes(ucwords(strtolower($_REQUEST['name']))));
|
||||
}
|
||||
|
||||
if(empty($name))
|
||||
{
|
||||
@@ -63,14 +66,14 @@ if(!$player->isLoaded())
|
||||
{
|
||||
$tmp_zmienna = "";
|
||||
$tmp_name = retrieve_former_name($name);
|
||||
while(!empty($tmp_name))
|
||||
{
|
||||
while(!empty($tmp_name)) {
|
||||
$tmp_zmienna = $tmp_name;
|
||||
$tmp_name = retrieve_former_name($tmp_zmienna);
|
||||
}
|
||||
|
||||
if(!empty($tmp_zmienna))
|
||||
if(!empty($tmp_zmienna)) {
|
||||
$player->find($tmp_zmienna);
|
||||
}
|
||||
}
|
||||
|
||||
if($player->isLoaded() && !$player->isDeleted())
|
||||
|
Reference in New Issue
Block a user