Template/Update (Cleanup)

* smush leftover changes into a commit
 * create fresh db dump, without dbc placeholders
 * version bump

 ... all done
This commit is contained in:
Sarjuuk
2025-08-23 17:33:57 +02:00
parent 6557e70d5c
commit 92c1c59d3a
15 changed files with 1298 additions and 1591 deletions

2
.gitignore vendored
View File

@@ -49,4 +49,4 @@
/static/uploads/screenshots/* /static/uploads/screenshots/*
/static/uploads/signatures/* /static/uploads/signatures/*
/static/uploads/temp/* /static/uploads/temp/*
/static/uploads/guide/images/*

View File

@@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION'))
class InfoboxMarkup extends Markup class InfoboxMarkup extends Markup
{ {
public function __construct(private array $items = [], array $opts, string $parent = '') public function __construct(private array $items, array $opts, string $parent = '')
{ {
parent::__construct('', $opts, $parent); parent::__construct('', $opts, $parent);
} }

View File

@@ -108,6 +108,9 @@ class Markup implements \JsonSerializable
else if ($match[1] == 'icondb') else if ($match[1] == 'icondb')
$match[1] = 'icon'; $match[1] = 'icon';
// todo - respecte forced locale
// match[0] => [achievement=3579 domain=ru], [spell=40120 site=fr]
if ($match[1] == 'money') if ($match[1] == 'money')
{ {
if (stripos($match[0], 'items')) if (stripos($match[0], 'items'))

View File

@@ -54,6 +54,10 @@ define ('SC_FLAG_NO_TIMESTAMP', 0x02);
define ('SC_FLAG_APPEND_LOCALE', 0x04); define ('SC_FLAG_APPEND_LOCALE', 0x04);
define ('SC_FLAG_LOCALIZED', 0x08); define ('SC_FLAG_LOCALIZED', 0x08);
define('ICON_SIZE_TINY', 15);
define('ICON_SIZE_SMALL', 18);
define('ICON_SIZE_MEDIUM', 36);
define('ICON_SIZE_LARGE', 56);
// Databases // Databases
define('DB_AOWOW', 0); define('DB_AOWOW', 0);

View File

@@ -6,7 +6,7 @@ mb_internal_encoding('UTF-8');
error_reporting(E_ALL); error_reporting(E_ALL);
mysqli_report(MYSQLI_REPORT_ERROR); mysqli_report(MYSQLI_REPORT_ERROR);
define('AOWOW_REVISION', 40); define('AOWOW_REVISION', 41);
define('OS_WIN', substr(PHP_OS, 0, 3) == 'WIN'); // OS_WIN as per compile info of php define('OS_WIN', substr(PHP_OS, 0, 3) == 'WIN'); // OS_WIN as per compile info of php
define('CLI', PHP_SAPI === 'cli'); define('CLI', PHP_SAPI === 'cli');
define('CLI_HAS_E', CLI && // WIN10 and later usually support ANSI escape sequences define('CLI_HAS_E', CLI && // WIN10 and later usually support ANSI escape sequences
@@ -184,7 +184,7 @@ register_shutdown_function(function() : void
{ {
// defer undisplayed error/exception notes // defer undisplayed error/exception notes
if (!CLI && ($n = Util::getNotes())) if (!CLI && ($n = Util::getNotes()))
$_SESSION['notes'][] = [$n[0], $n[1], 'Defered issues from previous request']; $_SESSION['notes'][] = [$n[0], $n[1], 'Deferred issues from previous request'];
if ($e = error_get_last()) if ($e = error_get_last())
{ {

View File

@@ -140,9 +140,9 @@ class Lang
if ($arg !== false || $concat == self::CONCAT_NONE) if ($arg !== false || $concat == self::CONCAT_NONE)
$buff .= ', '.$item; $buff .= ', '.$item;
else if ($concat == self::CONCAT_AND) else if ($concat == self::CONCAT_AND)
$buff .= self::main('and').' '.$item; $buff .= self::main('and').$item;
else else
$buff .= self::main('or').' '.$item; $buff .= self::main('or').$item;
} }
while ($arg !== false); while ($arg !== false);

View File

@@ -823,7 +823,7 @@ $lang = array(
'targetUNK' => '[span class=q10]unbekanntes Ziel#[b class=q1]%d[/b][/span]', 'targetUNK' => '[span class=q10]unbekanntes Ziel#[b class=q1]%d[/b][/span]',
'targetTT' => '[b class=q1]TargetType %d[/b][br][table][tr][td]Param1[/td][td=header]%d[/td][/tr][tr][td]Param2[/td][td=header]%d[/td][/tr][tr][td]Param3[/td][td=header]%d[/td][/tr][tr][td]Param4[/td][td=header]%d[/td][/tr][tr][td]X[/td][td=header]%17$.2f[/td][/tr][tr][td]Y[/td][td=header]%18$.2f[/td][/tr][tr][td]Z[/td][td=header]%19$.2f[/td][/tr][tr][td]O[/td][td=header]%20$.2f[/td][/tr][/table]', 'targetTT' => '[b class=q1]TargetType %d[/b][br][table][tr][td]Param1[/td][td=header]%d[/td][/tr][tr][td]Param2[/td][td=header]%d[/td][/tr][tr][td]Param3[/td][td=header]%d[/td][/tr][tr][td]Param4[/td][td=header]%d[/td][/tr][tr][td]X[/td][td=header]%17$.2f[/td][/tr][tr][td]Y[/td][td=header]%18$.2f[/td][/tr][tr][td]Z[/td][td=header]%19$.2f[/td][/tr][tr][td]O[/td][td=header]%20$.2f[/td][/tr][/table]',
'targets' => array( 'targets' => array(
SmartTarget::TARGET_NONE => '', SmartTarget::TARGET_NONE => '[span class=q0]<Nichts>[/span]',
SmartTarget::TARGET_SELF => 'selbst', SmartTarget::TARGET_SELF => 'selbst',
SmartTarget::TARGET_VICTIM => 'Gegner', SmartTarget::TARGET_VICTIM => 'Gegner',
SmartTarget::TARGET_HOSTILE_SECOND_AGGRO => '(%2$d)?Spieler:Einheit;(%11$s)? mit %11$s:;(%1$d)? innerhalb von %1$dm:; an 2. Stelle in Aggro', SmartTarget::TARGET_HOSTILE_SECOND_AGGRO => '(%2$d)?Spieler:Einheit;(%11$s)? mit %11$s:;(%1$d)? innerhalb von %1$dm:; an 2. Stelle in Aggro',

View File

@@ -823,7 +823,7 @@ $lang = array(
'targetUNK' => '[span class=q10]unknown target #[b class=q1]%d[/b][/span]', 'targetUNK' => '[span class=q10]unknown target #[b class=q1]%d[/b][/span]',
'targetTT' => '[b class=q1]TargetType %d[/b][br][table][tr][td]Param1[/td][td=header]%d[/td][/tr][tr][td]Param2[/td][td=header]%d[/td][/tr][tr][td]Param3[/td][td=header]%d[/td][/tr][tr][td]Param4[/td][td=header]%d[/td][/tr][tr][td]X[/td][td=header]%17$.2f[/td][/tr][tr][td]Y[/td][td=header]%18$.2f[/td][/tr][tr][td]Z[/td][td=header]%19$.2f[/td][/tr][tr][td]O[/td][td=header]%20$.2f[/td][/tr][/table]', 'targetTT' => '[b class=q1]TargetType %d[/b][br][table][tr][td]Param1[/td][td=header]%d[/td][/tr][tr][td]Param2[/td][td=header]%d[/td][/tr][tr][td]Param3[/td][td=header]%d[/td][/tr][tr][td]Param4[/td][td=header]%d[/td][/tr][tr][td]X[/td][td=header]%17$.2f[/td][/tr][tr][td]Y[/td][td=header]%18$.2f[/td][/tr][tr][td]Z[/td][td=header]%19$.2f[/td][/tr][tr][td]O[/td][td=header]%20$.2f[/td][/tr][/table]',
'targets' => array( 'targets' => array(
SmartTarget::TARGET_NONE => '', SmartTarget::TARGET_NONE => '[span class=q0]<None>[/span]',
SmartTarget::TARGET_SELF => 'self', SmartTarget::TARGET_SELF => 'self',
SmartTarget::TARGET_VICTIM => 'Opponent', SmartTarget::TARGET_VICTIM => 'Opponent',
SmartTarget::TARGET_HOSTILE_SECOND_AGGRO => '2nd (%2$d)?player:unit;(%1$d)? within %1$dm:; in threat list(%11$s)? using %11$s:;', SmartTarget::TARGET_HOSTILE_SECOND_AGGRO => '2nd (%2$d)?player:unit;(%1$d)? within %1$dm:; in threat list(%11$s)? using %11$s:;',

View File

@@ -823,7 +823,7 @@ $lang = array(
'targetUNK' => '[span class=q10]objetivo desconocido #[b class=q1]%d[/b][/span]', 'targetUNK' => '[span class=q10]objetivo desconocido #[b class=q1]%d[/b][/span]',
'targetTT' => '[b class=q1]Tipo de Objetivo %d[/b][br][table][tr][td]Parámetro1[/td][td=header]%d[/td][/tr][tr][td]Parámetro2[/td][td=header]%d[/td][/tr][tr][td]Parámetro3[/td][td=header]%d[/td][/tr][tr][td]Parámetro4[/td][td=header]%d[/td][/tr][tr][td]X[/td][td=header]%17$.2f[/td][/tr][tr][td]Y[/td][td=header]%18$.2f[/td][/tr][tr][td]Z[/td][td=header]%19$.2f[/td][/tr][tr][td]O[/td][td=header]%20$.2f[/td][/tr][/table]', 'targetTT' => '[b class=q1]Tipo de Objetivo %d[/b][br][table][tr][td]Parámetro1[/td][td=header]%d[/td][/tr][tr][td]Parámetro2[/td][td=header]%d[/td][/tr][tr][td]Parámetro3[/td][td=header]%d[/td][/tr][tr][td]Parámetro4[/td][td=header]%d[/td][/tr][tr][td]X[/td][td=header]%17$.2f[/td][/tr][tr][td]Y[/td][td=header]%18$.2f[/td][/tr][tr][td]Z[/td][td=header]%19$.2f[/td][/tr][tr][td]O[/td][td=header]%20$.2f[/td][/tr][/table]',
'targets' => array( 'targets' => array(
SmartTarget::TARGET_NONE => '', SmartTarget::TARGET_NONE => '[span class=q0]<Ninguno>[/span]',
SmartTarget::TARGET_SELF => 'uno mismo', SmartTarget::TARGET_SELF => 'uno mismo',
SmartTarget::TARGET_VICTIM => 'Oponente', SmartTarget::TARGET_VICTIM => 'Oponente',
SmartTarget::TARGET_HOSTILE_SECOND_AGGRO => '2º (%2$d)?jugador:unidad;(%1$d)? dentro de %1$dm:; en la lista de amenaza(%11$s)? usando %11$s:;', SmartTarget::TARGET_HOSTILE_SECOND_AGGRO => '2º (%2$d)?jugador:unidad;(%1$d)? dentro de %1$dm:; en la lista de amenaza(%11$s)? usando %11$s:;',

View File

@@ -823,7 +823,7 @@ $lang = array(
'targetUNK' => '[span class=q10]unknown target #[b class=q1]%d[/b][/span]', 'targetUNK' => '[span class=q10]unknown target #[b class=q1]%d[/b][/span]',
'targetTT' => '[b class=q1]TargetType %d[/b][br][table][tr][td]Param1[/td][td=header]%d[/td][/tr][tr][td]Param2[/td][td=header]%d[/td][/tr][tr][td]Param3[/td][td=header]%d[/td][/tr][tr][td]Param4[/td][td=header]%d[/td][/tr][tr][td]X[/td][td=header]%17$.2f[/td][/tr][tr][td]Y[/td][td=header]%18$.2f[/td][/tr][tr][td]Z[/td][td=header]%19$.2f[/td][/tr][tr][td]O[/td][td=header]%20$.2f[/td][/tr][/table]', 'targetTT' => '[b class=q1]TargetType %d[/b][br][table][tr][td]Param1[/td][td=header]%d[/td][/tr][tr][td]Param2[/td][td=header]%d[/td][/tr][tr][td]Param3[/td][td=header]%d[/td][/tr][tr][td]Param4[/td][td=header]%d[/td][/tr][tr][td]X[/td][td=header]%17$.2f[/td][/tr][tr][td]Y[/td][td=header]%18$.2f[/td][/tr][tr][td]Z[/td][td=header]%19$.2f[/td][/tr][tr][td]O[/td][td=header]%20$.2f[/td][/tr][/table]',
'targets' => array( 'targets' => array(
SmartTarget::TARGET_NONE => '', SmartTarget::TARGET_NONE => '[span class=q0]<Aucun>[/span]',
SmartTarget::TARGET_SELF => 'self', SmartTarget::TARGET_SELF => 'self',
SmartTarget::TARGET_VICTIM => 'Opponent', SmartTarget::TARGET_VICTIM => 'Opponent',
SmartTarget::TARGET_HOSTILE_SECOND_AGGRO => '2nd (%2$d)?player:unit;(%1$d)? within %1$dm:; in threat list(%11$s)? using %11$s:;', SmartTarget::TARGET_HOSTILE_SECOND_AGGRO => '2nd (%2$d)?player:unit;(%1$d)? within %1$dm:; in threat list(%11$s)? using %11$s:;',

View File

@@ -823,7 +823,7 @@ $lang = array(
'targetUNK' => '[span class=q10]unknown target #[b class=q1]%d[/b][/span]', 'targetUNK' => '[span class=q10]unknown target #[b class=q1]%d[/b][/span]',
'targetTT' => '[b class=q1]TargetType %d[/b][br][table][tr][td]Param1[/td][td=header]%d[/td][/tr][tr][td]Param2[/td][td=header]%d[/td][/tr][tr][td]Param3[/td][td=header]%d[/td][/tr][tr][td]Param4[/td][td=header]%d[/td][/tr][tr][td]X[/td][td=header]%17$.2f[/td][/tr][tr][td]Y[/td][td=header]%18$.2f[/td][/tr][tr][td]Z[/td][td=header]%19$.2f[/td][/tr][tr][td]O[/td][td=header]%20$.2f[/td][/tr][/table]', 'targetTT' => '[b class=q1]TargetType %d[/b][br][table][tr][td]Param1[/td][td=header]%d[/td][/tr][tr][td]Param2[/td][td=header]%d[/td][/tr][tr][td]Param3[/td][td=header]%d[/td][/tr][tr][td]Param4[/td][td=header]%d[/td][/tr][tr][td]X[/td][td=header]%17$.2f[/td][/tr][tr][td]Y[/td][td=header]%18$.2f[/td][/tr][tr][td]Z[/td][td=header]%19$.2f[/td][/tr][tr][td]O[/td][td=header]%20$.2f[/td][/tr][/table]',
'targets' => array( 'targets' => array(
SmartTarget::TARGET_NONE => '', SmartTarget::TARGET_NONE => '[span class=q0]<Нет>[/span]',
SmartTarget::TARGET_SELF => 'self', SmartTarget::TARGET_SELF => 'self',
SmartTarget::TARGET_VICTIM => 'Opponent', SmartTarget::TARGET_VICTIM => 'Opponent',
SmartTarget::TARGET_HOSTILE_SECOND_AGGRO => '2nd (%2$d)?player:unit;(%1$d)? within %1$dm:; in threat list(%11$s)? using %11$s:;', SmartTarget::TARGET_HOSTILE_SECOND_AGGRO => '2nd (%2$d)?player:unit;(%1$d)? within %1$dm:; in threat list(%11$s)? using %11$s:;',

View File

@@ -823,7 +823,7 @@ $lang = array(
'targetUNK' => '[span class=q10]unknown target #[b class=q1]%d[/b][/span]', 'targetUNK' => '[span class=q10]unknown target #[b class=q1]%d[/b][/span]',
'targetTT' => '[b class=q1]TargetType %d[/b][br][table][tr][td]Param1[/td][td=header]%d[/td][/tr][tr][td]Param2[/td][td=header]%d[/td][/tr][tr][td]Param3[/td][td=header]%d[/td][/tr][tr][td]Param4[/td][td=header]%d[/td][/tr][tr][td]X[/td][td=header]%17$.2f[/td][/tr][tr][td]Y[/td][td=header]%18$.2f[/td][/tr][tr][td]Z[/td][td=header]%19$.2f[/td][/tr][tr][td]O[/td][td=header]%20$.2f[/td][/tr][/table]', 'targetTT' => '[b class=q1]TargetType %d[/b][br][table][tr][td]Param1[/td][td=header]%d[/td][/tr][tr][td]Param2[/td][td=header]%d[/td][/tr][tr][td]Param3[/td][td=header]%d[/td][/tr][tr][td]Param4[/td][td=header]%d[/td][/tr][tr][td]X[/td][td=header]%17$.2f[/td][/tr][tr][td]Y[/td][td=header]%18$.2f[/td][/tr][tr][td]Z[/td][td=header]%19$.2f[/td][/tr][tr][td]O[/td][td=header]%20$.2f[/td][/tr][/table]',
'targets' => array( 'targets' => array(
SmartTarget::TARGET_NONE => '', SmartTarget::TARGET_NONE => '[span class=q0]<无>[/span]',
SmartTarget::TARGET_SELF => 'self', SmartTarget::TARGET_SELF => 'self',
SmartTarget::TARGET_VICTIM => 'Opponent', SmartTarget::TARGET_VICTIM => 'Opponent',
SmartTarget::TARGET_HOSTILE_SECOND_AGGRO => '2nd (%2$d)?player:unit;(%1$d)? within %1$dm:; in threat list(%11$s)? using %11$s:;', SmartTarget::TARGET_HOSTILE_SECOND_AGGRO => '2nd (%2$d)?player:unit;(%1$d)? within %1$dm:; in threat list(%11$s)? using %11$s:;',

File diff suppressed because one or more lines are too long

View File

@@ -93,7 +93,7 @@ CLISetup::registerUtility(new class extends UtilityScript
return true; return true;
} }
if (DB::Aowow()->SelectCell('SELECT 1 FROM ?_account WHERE `username` = ? AND (`status` <> ?d OR (`status` = ?d AND `statusTimer` > UNIX_TIMESTAMP()))', $name, ACC_STATUS_NEW, ACC_STATUS_NEW)) if (DB::Aowow()->SelectCell('SELECT 1 FROM ?_account WHERE LOWER(`username`) = LOWER(?) AND (`status` <> ?d OR (`status` = ?d AND `statusTimer` > UNIX_TIMESTAMP()))', $name, ACC_STATUS_NEW, ACC_STATUS_NEW))
{ {
CLI::write('[account] ' . Lang::account('nameInUse'), CLI::LOG_ERROR); CLI::write('[account] ' . Lang::account('nameInUse'), CLI::LOG_ERROR);
CLI::write(); CLI::write();
@@ -106,7 +106,7 @@ CLISetup::registerUtility(new class extends UtilityScript
if (DB::Aowow()->query('REPLACE INTO ?_account (`login`, `passHash`, `username`, `joindate`, `email`, `userGroups`, `userPerms`) VALUES (?, ?, ?, UNIX_TIMESTAMP(), ?, ?d, 1)', if (DB::Aowow()->query('REPLACE INTO ?_account (`login`, `passHash`, `username`, `joindate`, `email`, `userGroups`, `userPerms`) VALUES (?, ?, ?, UNIX_TIMESTAMP(), ?, ?d, 1)',
$name, User::hashCrypt($passw), $name, $email ?: Cfg::get('CONTACT_EMAIL'), U_GROUP_ADMIN)) $name, User::hashCrypt($passw), $name, $email ?: Cfg::get('CONTACT_EMAIL'), U_GROUP_ADMIN))
{ {
$newId = DB::Aowow()->selectCell('SELECT `id` FROM ?_account WHERE `username` = ?', $name); $newId = DB::Aowow()->selectCell('SELECT `id` FROM ?_account WHERE LOWER(`username`) = LOWER(?)', $name);
Util::gainSiteReputation($newId, SITEREP_ACTION_REGISTER); Util::gainSiteReputation($newId, SITEREP_ACTION_REGISTER);
CLI::write("[account] admin ".$name." created successfully", CLI::LOG_OK); CLI::write("[account] admin ".$name." created successfully", CLI::LOG_OK);

View File

@@ -29,10 +29,10 @@ CLISetup::registerSetup("build", new class extends SetupScript
protected $setupAfter = [['icons'], []]; protected $setupAfter = [['icons'], []];
private const ICON_DIRS = array( private const ICON_DIRS = array(
['static/images/wow/icons/large/', 'jpg', 0, 56, 4], ['static/images/wow/icons/large/', 'jpg', 0, ICON_SIZE_LARGE, 4],
['static/images/wow/icons/medium/', 'jpg', 0, 36, 4], ['static/images/wow/icons/medium/', 'jpg', 0, ICON_SIZE_MEDIUM, 4],
['static/images/wow/icons/small/', 'jpg', 0, 18, 4], ['static/images/wow/icons/small/', 'jpg', 0, ICON_SIZE_SMALL, 4],
['static/images/wow/icons/tiny/', 'gif', 0, 15, 4] ['static/images/wow/icons/tiny/', 'gif', 0, ICON_SIZE_TINY, 4]
); );
private $genSteps = array( private $genSteps = array(