Add None vocation to highscores (can be changed to RookStayer in Admin Panel)

This commit is contained in:
slawkens 2024-11-12 20:51:45 +01:00
parent ddced132cf
commit a4a2480995
2 changed files with 8 additions and 6 deletions

View File

@ -41,11 +41,13 @@ if($vocation !== 'all') {
$vocationId = $id; $vocationId = $id;
$add_vocs = [$id]; $add_vocs = [$id];
if ($id !== 0) {
$i = $id + $configVocationsAmount; $i = $id + $configVocationsAmount;
while (isset($configVocations[$i])) { while (isset($configVocations[$i])) {
$add_vocs[] = $i; $add_vocs[] = $i;
$i += $configVocationsAmount; $i += $configVocationsAmount;
} }
}
$query->whereIn('players.vocation', $add_vocs); $query->whereIn('players.vocation', $add_vocs);
break; break;

View File

@ -20,7 +20,7 @@
<select onchange="location = this.value;" id="vocationFilter"> <select onchange="location = this.value;" 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 0..config.vocations_amount %}
<option value="{{ getLink('highscores') }}/{{ list }}/{{ config.vocations[i]|lower }}" class="size_xs" {% if vocationId is not null and vocationId == i %}selected{% endif %}>{{ config.vocations[i]}}</option> <option value="{{ getLink('highscores') }}/{{ list }}/{{ config.vocations[i]|lower }}" class="size_xs" {% if vocationId is not null and vocationId == i %}selected{% endif %}>{{ config.vocations[i]}}</option>
{% endfor %} {% endfor %}
</select> </select>
@ -119,7 +119,7 @@
<tr bgcolor="{{ config.lightborder }}"> <tr bgcolor="{{ config.lightborder }}">
<td> <td>
<a href="{{ getLink('highscores') }}/{{ list }}" class="size_xs">[ALL]</a><br/> <a href="{{ getLink('highscores') }}/{{ list }}" class="size_xs">[ALL]</a><br/>
{% for i in 1..config.vocations_amount %} {% for i in 0..config.vocations_amount %}
<a href="{{ getLink('highscores') }}/{{ list }}/{{ config.vocations[i]|lower }}" class="size_xs">{{ config.vocations[i]}}</a><br/> <a href="{{ getLink('highscores') }}/{{ list }}/{{ config.vocations[i]|lower }}" class="size_xs">{{ config.vocations[i]}}</a><br/>
{% endfor %} {% endfor %}
</td> </td>