Ranking: after a tie the next place follows (1, 1, 2 instead of 1, 1, 3)

The Lumipunkte ranking counted places like a competition, so ten members with the same points were
all #1 and the next one #11. Places are now dense: equal points share a place, the next lower
score gets the next place.

- contributions.php counts the place up by one per new score; the dashboard's "Platz X von Y" is
  1 + the number of distinct higher scores.
- Silver and bronze frames now go to everyone on #2 and #3.
- The note for the limited view says "die besten 24 Mitglieder" instead of "Plätze"; patch notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Maaxxs 2026-09-25 23:03:22 +02:00
parent 0e00f35923
commit d97268f0e9
3 changed files with 16 additions and 5 deletions

View file

@ -20,12 +20,13 @@ $currentUser = current_user();
$balances = contribution_balances(); $balances = contribution_balances();
$myBalance = contribution_user_balance((int) $currentUser['id']); $myBalance = contribution_user_balance((int) $currentUser['id']);
// Rang: gleiche Punktzahl = gleicher Platz. // Rang: gleiche Punktzahl = gleicher Platz, die naechste Punktzahl bekommt den naechsten Platz
// (1, 1, 2 - nicht 1, 1, 3). Genauso zaehlt der Platz im Dashboard.
$rank = 0; $rank = 0;
$lastPoints = null; $lastPoints = null;
foreach ($balances as $index => $member) { foreach ($balances as $index => $member) {
if ($lastPoints === null || (int) $member['points'] !== $lastPoints) { if ($lastPoints === null || (int) $member['points'] !== $lastPoints) {
$rank = $index + 1; $rank++;
$lastPoints = (int) $member['points']; $lastPoints = (int) $member['points'];
} }
$balances[$index]['rank'] = $rank; $balances[$index]['rank'] = $rank;
@ -156,7 +157,7 @@ include __DIR__ . '/includes/header.php';
<?php endif; ?> <?php endif; ?>
<?php if ($hiddenCount > 0): ?> <?php if ($hiddenCount > 0): ?>
<p class="text-muted contribution-limit-note"> <p class="text-muted contribution-limit-note">
Angezeigt werden die besten <?= CONTRIBUTION_PUBLIC_RANKS ?> Plätze. Die vollständige Rangliste Angezeigt werden die besten <?= CONTRIBUTION_PUBLIC_RANKS ?> Mitglieder. Die vollständige Rangliste
(<?= count($balances) ?> Mitglieder) ist der Legionsleitung vorbehalten. (<?= count($balances) ?> Mitglieder) ist der Legionsleitung vorbehalten.
</p> </p>
<?php endif; ?> <?php endif; ?>

View file

@ -53,13 +53,14 @@ if ($canViewRaids) {
} }
$nextRaids = array_slice($upcomingRaids, 0, 3); $nextRaids = array_slice($upcomingRaids, 0, 3);
// Eigene Lumipunkte mit Platz in der Rangliste (gleiche Punktzahl = gleicher Platz). // Eigene Lumipunkte mit Platz in der Rangliste (gleiche Punktzahl = gleicher Platz, danach der naechste -
// wie auf contributions.php): 1 + wie viele verschiedene Punktstaende hoeher sind.
$myPoints = null; $myPoints = null;
$myRank = null; $myRank = null;
if ($canViewContributions) { if ($canViewContributions) {
$myPoints = contribution_user_balance((int) $user['id']); $myPoints = contribution_user_balance((int) $user['id']);
$rankStmt = db()->prepare( $rankStmt = db()->prepare(
"SELECT COUNT(*) + 1 FROM ( "SELECT COUNT(DISTINCT points) + 1 FROM (
SELECT u.id, COALESCE(SUM(e.points), 0) AS points FROM users u SELECT u.id, COALESCE(SUM(e.points), 0) AS points FROM users u
LEFT JOIN contribution_entries e ON e.user_id = u.id LEFT JOIN contribution_entries e ON e.user_id = u.id
WHERE u.status = 'active' GROUP BY u.id WHERE u.status = 'active' GROUP BY u.id

View file

@ -19,6 +19,15 @@ const PATCHNOTE_TYPES = [
]; ];
const PATCHNOTES = [ const PATCHNOTES = [
[
'id' => '2026-09-25-j',
'date' => '2026-09-25',
'title' => 'Plätze in der Rangliste',
'summary' => 'Bei Punktgleichstand geht die Rangliste jetzt mit dem nächsten Platz weiter.',
'changes' => [
['type' => 'behoben', 'area' => 'Lumipunkte', 'text' => 'Teilen sich mehrere Mitglieder einen Platz, kommt danach der nächste: Nach zehnmal Platz 1 folgt Platz 2 statt Platz 11. Dein Platz im Dashboard zählt genauso.'],
],
],
[ [
'id' => '2026-09-25-i', 'id' => '2026-09-25-i',
'date' => '2026-09-25', 'date' => '2026-09-25',