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,10 +41,12 @@ if($vocation !== 'all') {
$vocationId = $id;
$add_vocs = [$id];
$i = $id + $configVocationsAmount;
while(isset($configVocations[$i])) {
$add_vocs[] = $i;
$i += $configVocationsAmount;
if ($id !== 0) {
$i = $id + $configVocationsAmount;
while (isset($configVocations[$i])) {
$add_vocs[] = $i;
$i += $configVocationsAmount;
}
}
$query->whereIn('players.vocation', $add_vocs);

View File

@ -20,7 +20,7 @@
<select onchange="location = this.value;" id="vocationFilter">
<option value="{{ getLink('highscores') }}/{{ list }}" class="size_xs">[ALL]</option>
{% 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>
{% endfor %}
</select>
@ -119,7 +119,7 @@
<tr bgcolor="{{ config.lightborder }}">
<td>
<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/>
{% endfor %}
</td>