mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 01:39:22 +02:00
Merge branch '0.9' into develop
This commit is contained in:
commit
14c8160020
@ -1387,39 +1387,48 @@ function getChangelogWhere($v)
|
|||||||
|
|
||||||
return 'unknown';
|
return 'unknown';
|
||||||
}
|
}
|
||||||
function getPlayerNameByAccount($id)
|
|
||||||
|
function getPlayerNameByAccountId($id)
|
||||||
{
|
{
|
||||||
global $vowels, $ots, $db;
|
global $db;
|
||||||
if(is_numeric($id))
|
|
||||||
{
|
|
||||||
$player = new OTS_Player();
|
|
||||||
$player->load($id);
|
|
||||||
if($player->isLoaded())
|
|
||||||
return $player->getName();
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$playerQuery = $db->query('SELECT `id` FROM `players` WHERE `account_id` = ' . $id . ' ORDER BY `lastlogin` DESC LIMIT 1;')->fetch();
|
|
||||||
|
|
||||||
$tmp = "*Error*";
|
if (!is_numeric($id)) {
|
||||||
/*
|
return '';
|
||||||
$acco = new OTS_Account();
|
}
|
||||||
$acco->load($id);
|
|
||||||
if(!$acco->isLoaded())
|
|
||||||
return "Unknown name";
|
|
||||||
|
|
||||||
foreach($acco->getPlayersList() as $p)
|
$account = new OTS_Account();
|
||||||
{
|
$account->load($id);
|
||||||
$player= new OTS_Player();
|
if ($account->isLoaded()) {
|
||||||
$player->find($p);*/
|
$query = $db->query('SELECT `name` FROM `players` WHERE `account_id` = ' . $id . ' ORDER BY `lastlogin` DESC LIMIT 1;');
|
||||||
$player->load($playerQuery['id']);
|
|
||||||
//echo 'id gracza = ' . $p . '<br/>';
|
|
||||||
if($player->isLoaded())
|
|
||||||
$tmp = $player->getName();
|
|
||||||
// break;
|
|
||||||
//}
|
|
||||||
|
|
||||||
return $tmp;
|
if (!$query || !$query->rowCount()) {
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $query->fetch(PDO::FETCH_ASSOC)['name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPlayerNameByAccount($account) {
|
||||||
|
if (is_numeric($account)) {
|
||||||
|
return getPlayerNameByAccountId($account);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPlayerNameById($id)
|
||||||
|
{
|
||||||
|
if (!is_numeric($id)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$player = new OTS_Player();
|
||||||
|
$player->load($id);
|
||||||
|
if ($player->isLoaded()) {
|
||||||
|
return $player->getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
@ -1427,13 +1436,13 @@ function getPlayerNameByAccount($id)
|
|||||||
|
|
||||||
function echo_success($message)
|
function echo_success($message)
|
||||||
{
|
{
|
||||||
echo '<div class="col-12 success mb-2">' . $message . '</div>';
|
echo '<div class="col-12 alert alert-success mb-2">' . $message . '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function echo_error($message)
|
function echo_error($message)
|
||||||
{
|
{
|
||||||
global $error;
|
global $error;
|
||||||
echo '<div class="col-12 error mb-2">' . $message . '</div>';
|
echo '<div class="col-12 alert alert-error mb-2">' . $message . '</div>';
|
||||||
$error = true;
|
$error = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,27 +5,27 @@
|
|||||||
<div style="text-align:center"><h2>Ranking for {{ skillName }}{% if vocation is not null %} ({{ vocation }}){% endif %} on {{ config.lua.serverName }}</h2></div><br/>
|
<div style="text-align:center"><h2>Ranking for {{ skillName }}{% if vocation is not null %} ({{ vocation }}){% endif %} on {{ config.lua.serverName }}</h2></div><br/>
|
||||||
<table border="0" cellpadding="4" cellspacing="1" width="100%">
|
<table border="0" cellpadding="4" cellspacing="1" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td>Filters</td>
|
<td>Filters</td>
|
||||||
<td>
|
<td>
|
||||||
<label for="vocationFilter">Choose a Skill</label>
|
<label for="vocationFilter">Choose a Skill</label>
|
||||||
<select onchange="location = this.value;" aria-label="skillFilter" id="skillFilter">
|
<select onchange="location = this.value;" aria-label="skillFilter" id="skillFilter">
|
||||||
{% set i = 0 %}
|
{% set i = 0 %}
|
||||||
{% for link, name in types %}
|
{% for link, name in types %}
|
||||||
<option value="{{ getLink('highscores') }}/{{ link }}{% if vocation is defined %}/{{ vocation }}{% endif %}" class="size_xs">{{ name }}</option>
|
<option value="{{ getLink('highscores') }}/{{ link }}{% if vocation is defined %}/{{ vocation }}{% endif %}" class="size_xs">{{ name }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<label for="vocationFilter">Choose a vocation</label>
|
<label for="vocationFilter">Choose a vocation</label>
|
||||||
<select onchange="location = this.value;" aria-label="vocationFilter" id="vocationFilter">
|
<select onchange="location = this.value;" aria-label="vocationFilter" id="vocationFilter">
|
||||||
<option value="{{ getLink('highscores') }}/{{ list }}" class="size_xs">[ALL]</option>
|
<option value="{{ getLink('highscores') }}/{{ list }}" class="size_xs">[ALL]</option>
|
||||||
{% set i = 0 %}
|
{% set i = 0 %}
|
||||||
{% for i in 1..config.vocations_amount %}
|
{% for i in 1..config.vocations_amount %}
|
||||||
<option value="{{ getLink('highscores') }}/{{ list }}/{{ config.vocations[i]|lower }}" class="size_xs">{{ config.vocations[i]}}</option>
|
<option value="{{ getLink('highscores') }}/{{ list }}/{{ config.vocations[i]|lower }}" class="size_xs">{{ config.vocations[i]}}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table border="0" cellpadding="4" cellspacing="1" width="100%">
|
<table border="0" cellpadding="4" cellspacing="1" width="100%">
|
||||||
<tr bgcolor="{{ config.vdarkborder }}">
|
<tr bgcolor="{{ config.vdarkborder }}">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user