From: CMDR furrycat Date: Tue, 2 Feb 2016 22:59:58 +0000 (-0500) Subject: Hack to highlight best entry for excluded competitor. X-Git-Url: http://git.furryclan.net/?a=commitdiff_plain;h=bb8c5e3a52fbe72952d8da24be5123eb9bad6579;p=furrycat%2Frace-o-matic.git Hack to highlight best entry for excluded competitor. --- diff --git a/lib/race.php b/lib/race.php index d3a61a9..28a4096 100644 --- a/lib/race.php +++ b/lib/race.php @@ -227,7 +227,7 @@ function show_entry($entry, $allotted_time, $position, $rank, $ship_rank, $row, $type, $prizewinners) { $fields = array(); $fields[] = $position; - $fields[] = $rank; + $fields[] = $position ? $rank : ''; $fields[] = $ship_rank; $fields[] = $entry->getEndorsementString(); $ship = $entry->getShip(); @@ -655,12 +655,13 @@ $n = $position = $rank = 1; $ship_entries = array(); $competitor_entries = array(); + $excluded_competitors = array(); foreach ($entries as $entry) { $p = $r = $s = ''; + $competitor = $entry->getShip()->getCompetitor(); + $name = $competitor->getForumName(); + if (! $name) $name = $competitor->getCmdrName(); if (! $entry->isExcluded()) { - $competitor = $entry->getShip()->getCompetitor(); - $name = $competitor->getForumName(); - if (! $name) $name = $competitor->getCmdrName(); if (array_key_exists($name, $competitor_entries)) $competitor_entries[$name]++; else { $competitor_entries[$name] = 1; @@ -674,6 +675,10 @@ $p = $position++; $s = $ship_entries[$hull_id]; } + else { + $r = (array_key_exists($name, $excluded_competitors)) ? 2 : 1; + $excluded_competitors[$name] = 1; + } show_entry($entry, $allotted_time, $p, $r, $s, $n++, $type, $prizewinners); } entry_footer($type);