Skip to content

Commit

Permalink
fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel committed Sep 5, 2024
1 parent b3360da commit b3248df
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 18 deletions.
6 changes: 3 additions & 3 deletions system/pages/highscores.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
}

if (!empty($world)) {
if (!$world = $db->query("SELECT * FROM `worlds` WHERE `name` = {$db->quote($world)}")->fetch() ?? null) {
if (!$world = $db->query("SELECT `id`, `name` FROM `worlds` WHERE `name` = {$db->quote(urldecode($world))}")->fetch() ?? null) {
header('Location: ' . "?highscores");
return;
}
Expand Down Expand Up @@ -436,7 +436,7 @@
<tr>
<td colspan="2" width="100%" align="right" valign="bottom">
<a
href="<?= getLink('highscores') . '/' . $list . ($world ? '/' . $world : '') . (isset($vocation) ? '/' . $vocation : '') . '/' . ($_page - 1) ?>"
href="<?= getLink('highscores') . '/' . $list . ($world ? '/' . $world['name'] : '') . (isset($vocation) ? '/' . $vocation : '') . '/' . ($_page - 1) ?>"
class="size_xxs">Previous Page</a>
</td>
</tr>
Expand All @@ -448,7 +448,7 @@ class="size_xxs">Previous Page</a>
<tr>
<td colspan="2" width="100%" align="right" valign="bottom">
<a
href="<?= getLink('highscores') . '/' . $list . ($world ? '/' . $world : '') . (isset($vocation) ? '/' . $vocation : '') . '/' . ($_page + 1) ?>"
href="<?= getLink('highscores') . '/' . $list . ($world ? '/' . $world['name'] : '') . (isset($vocation) ? '/' . $vocation : '') . '/' . ($_page + 1) ?>"
class="size_xxs">Next Page</a>
</td>
</TR>
Expand Down
2 changes: 1 addition & 1 deletion system/pages/lastkills.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}

if ($world = $_GET['world'] ?? null) {
$world = $db->query("SELECT `id`, `name` FROM `worlds` WHERE `name` = {$db->quote($world)}")->fetch() ?? null;
$world = $db->query("SELECT `id`, `name` FROM `worlds` WHERE `name` = {$db->quote(urldecode($world))}")->fetch() ?? null;
} else {
$world = count(WORLDS) == 1 ? WORLDS[0] : $world;
}
Expand Down
3 changes: 2 additions & 1 deletion system/pages/online.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}

if ($world = $_GET['world'] ?? null) {
$world = $db->query("SELECT * FROM `worlds` WHERE `name` = {$db->quote($world)}")->fetch() ?? null;
$world = $db->query("SELECT * FROM `worlds` WHERE `name` = {$db->quote(urldecode($world))}")->fetch() ?? null;
} else {
$world = count(WORLDS) == 1 ? WORLDS[0] : $world;
}
Expand Down Expand Up @@ -102,6 +102,7 @@
$query = $db->query("SELECT `timestamp`, `value` as `record` FROM `server_config` WHERE `config` = {$db->quote('players_record')} {$w_sql}");
}

$record = 'not online yet';
if ($query && $query->rowCount() > 0) {
$result = $query->fetch();
$d = date('M d Y, H:i:s', strtotime($result['timestamp']));
Expand Down
12 changes: 10 additions & 2 deletions system/templates/characters.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@
<td>{{ achievementPoints }}</td>
</tr>

{% set rows = rows + 1 %}
<tr bgcolor="{{ getStyle(rows) }}">
<td class="LabelV175">World:</td>
<td>{{ getWorldName(player.getWorldId()) }}</td>
</tr>

{% set rows = rows + 1 %}
<tr bgcolor="{{ getStyle(rows) }}">
<td class="LabelV175">Residence:</td>
Expand Down Expand Up @@ -1016,10 +1022,11 @@
<table class="TableContent" width="100%">
<tbody>
<tr bgcolor="{{ config.darkborder }}">
<td width="40%"><B>Name</b></td>
<td width="30%"><B>Name</b></td>
<td width="20%"><B>World</b></td>
<td width="15%"><B>Level</b></td>
<td width="20%"><B>Vocation</b></td>
<td width="25%"><b>Status</b></td>
<td width="15%"><b>Status</b></td>
<td><b>&#160;</b></td>
</tr>
{% set i = 0 %}
Expand All @@ -1031,6 +1038,7 @@
<nobr>{{ i }}.&#160;{{ player.getName() }}{% if player.isDeleted() %}<span
style="color: red"> [DELETED]</span>{% endif %}</nobr>
</td>
<td>{{ getWorldName(player.getWorldId()) }}</td>
<td>{{ player.getLevel() }}</td>
<td>{{ player.getVocationName() }}</td>
<td>{% if player.isOnline() %}<img src="{{ template_path }}/images/on.gif"
Expand Down
4 changes: 2 additions & 2 deletions system/templates/online.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
<td width="25%" class="LabelV150">Status:</td>
<td>
{{ world.name }} World is {% if status.online %}<strong
class="text-green">Online</strong>{% else %} <strong
class="text-red">Offline</strong>{% endif %}
class="green">Online</strong>{% else %} <strong
class="red">Offline</strong>{% endif %}
</td>
</tr>
{% if status.online %}
Expand Down
2 changes: 1 addition & 1 deletion system/templates/serverinfo.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<table class="TableContent" width="100%">
<tbody>
<tr bgcolor="#D4C0A1">
<td><b>IP:</b> {{ serverIp }} (Port: {{ config.lua.loginPort }})</td>
<td><b>IP:</b> {{ serverIp }} (Port: {{ config.lua.loginProtocolPort }})</td>
</tr>
<tr bgcolor="#F1E0C6">
<td><b>Client: </b> {{ clientVersion }}</td>
Expand Down
8 changes: 0 additions & 8 deletions tools/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -898,11 +898,3 @@
.stronger {
font-weight: bold !important;
}

.text-green {
color: #00a65a !important;
}

.text-red {
color: #dd4b39 !important;
}

0 comments on commit b3248df

Please sign in to comment.