Calculate rank when filtering prizewinners only.
authorCMDR furrycat <elite@furrycat.net>
Fri, 12 Feb 2016 11:26:21 +0000 (06:26 -0500)
committerCMDR furrycat <elite@furrycat.net>
Fri, 12 Feb 2016 11:26:21 +0000 (06:26 -0500)
lib/race.php

index 2386383..d9ee633 100644 (file)
         $competitor_hull_entries = array();
         $excluded_competitors = array();
         $filter = (! count($filtered_entries));
+        if ($format == "prizes") {
+          $format = "competitors";
+          $prizewinners_only = true;
+        }
         foreach ($entries as $entry) {
           $entry_id = $entry->getId();
           $p = $r = $s = '';
 
           if (! $entry->isExcluded()) {
             if (! $prize_name) {
-              if (filtered("prizes", $format, $formats)) continue;
               /* Exclude if there's also a prize. */
               if ($prize_entry) {
                 if (filtered("competitors", $format, $formats)) continue;
             $r = (array_key_exists($name, $excluded_competitors)) ? 2 : 1;
             $excluded_competitors[$name] = 1;
           }
+          if ($prizewinners_only && ! $prize_name) continue;
           show_entry($sort, $format, $entry, $allotted_time, $p, $r, $s, $n++, $type, $prize_name, count($blue_fields), count($white_fields));
           if ($filter) $filtered_entries[] = $entry;
         }