Show highlight key.
authorCMDR furrycat <elite@furrycat.net>
Mon, 1 Feb 2016 12:56:26 +0000 (07:56 -0500)
committerCMDR furrycat <elite@furrycat.net>
Mon, 1 Feb 2016 13:01:47 +0000 (08:01 -0500)
lib/race.php
style.css

index 19af106..8d0eb20 100644 (file)
   }
 
   function entry_footer($type) {
+    $keys = array(
+      'winner' => 'Race winner',
+      'runnerup' => 'Runner-up',
+      'BySpeed' => 'Best single lap speed',
+      'ByAverageSpeed' => 'Best average speed',
+      'ByFastestLap' => 'Fastest single lap',
+      'ByAverageLap' => 'Fastest average lap',
+    );
+    $rows = array(
+      'orange' => "Non-prizewinning competitor's best entry",
+      'blue' => "Competitor's other entries"
+    );
+
     if ($type == 'html') {
       echo "</table>\n";
+
+      echo "<table>\n";
+      echo "<tr><td><strong class=\"header\">Highlight key</strong></td></tr>\n";
+      foreach ($keys as $key => $description) {
+        echo "<tr><td style=\"background-color: " . colour($key)[0] . "; color: " . entry_fgcolor(0, 0) . "\">$description</td></tr>\n";
+      }
+      foreach ($rows as $key => $description) {
+        echo "<tr><td style=\"background-color: " . entry_bgcolor(1, 0) . "; color: " . colour($key)[0] . "\">$description</td></tr>\n";
+      }
+      echo "</table>\n";
     }
     else if ($type == 'bbcode') {
       echo "[/table]\n";
+
+      echo "[table]\n";
+      echo "[tr]";
+      echo "[td]";
+      echo "[b]Highlight key[/b]";
+      echo "[/td]";
+      echo "[/tr]\n";
+      foreach ($keys as $key => $description) {
+        echo "[tr]";
+        echo "[td\"bgcolor: " . colour($key)[0] . "\"][color=" . entry_fgcolor(0, 0) . "]";
+        echo $description;
+        echo "[/color][/td]";
+        echo "[/tr]\n";
+      }
+      foreach ($rows as $key => $description) {
+        echo "[tr]";
+        echo "[td\"bgcolor: " . entry_bgcolor(1, 0) . "\"][color=" . colour($key)[0] . "]";
+        echo $description;
+        echo "[/color][/td]";
+        echo "[/tr]\n";
+      }
+      echo "[/table]\n";
       echo "</pre>\n";
     }
   }
     if ($entry->usedDockingComputer()) $formatting[] = 'i';
     if ($entry->usedJoker()) $formatting[] = 'b';
 
+    $foreground = ($rank) ? 1 : 2;
     if ($type == 'html') {
       echo "<tr>\n";
       $column = 0;
       foreach ($fields as $field) {
         $bgcolor = entry_bgcolor($row, $column, $prize_entry);
-        $fgcolor = entry_fgcolor($row, $column, $prize_entry);
+        $fgcolor = entry_fgcolor($foreground, $column, $prize_entry);
         if (is_array($field)) $display = $field[1];
         else $display = $field;
         $text = entry_formatting($display, $formatting, $type);
       $column = 0;
       foreach ($fields as $field) {
         $bgcolor = entry_bgcolor($row, $column, $prize_entry);
-        $fgcolor = entry_fgcolor($row, $column, $prize_entry);
+        $fgcolor = entry_fgcolor($foreground, $column, $prize_entry);
         $display = (is_array($field)) ? $field[0] : $field;
         $text = entry_formatting($display, $formatting, $type);
         echo "[td=\"bgcolor: $bgcolor\"][color=$fgcolor]";
index 47288a7..7f566dd 100644 (file)
--- a/style.css
+++ b/style.css
@@ -2,7 +2,7 @@ body { font-family: 'Sintony'; font-weight: 400; }
 #header { clear: both; overflow: auto; vertical-align: center; }
 #header { font-weight: 500; }
 #header a { text-decoration: none; }
-#header, h1,h2,h3,h4 { font-family: 'Orbitron'; }
+#header, .header, h1,h2,h3,h4 { font-family: 'Orbitron'; }
 #header strong { font-weight: 700; }
 #laps { overflow-x: auto; }
 #laps table { background-color: rgba(20, 50, 100, 0.2); }