OSDN Git Service

[modify]スコアランキング表の表示を調整- 折り返しが適当な所になるようにする- 2段組にして死因を2段目に表示する
authorHabu <habu@users.sourceforge.jp>
Mon, 16 Apr 2018 12:06:35 +0000 (21:06 +0900)
committerHabu <habu@users.sourceforge.jp>
Mon, 16 Apr 2018 12:21:25 +0000 (21:21 +0900)
score/css/score-table.css
score/score_ranking.php

index 85a9a92..3a71b2d 100644 (file)
@@ -19,7 +19,36 @@ table.score tbody td
          vertical-align: top;
 }
 
-table.score tbody tr:nth-child(odd) td
+table.score tbody td.rank
+{
+       text-align: center;
+       vertical-align: middle;
+}
+
+table.score tbody td.player_name a span
+{
+       text-decoration: underline;
+}
+
+table.score tbody td.player_name span,
+table.score tbody td.class_name span
+{
+       white-space: nowrap;
+       display: inline-block;
+}
+
+table.score tbody td.race_name
+{
+       white-space: nowrap;
+}
+
+table.score tbody td.sex
+{
+       text-align: center;
+}
+
+table.score tbody tr:nth-child(4n+1) td,
+table.score tbody tr:nth-child(4n+2) td
 {
          background-color: #f9b69a;
 }
index 32107cc..74ee09b 100644 (file)
@@ -101,14 +101,17 @@ function print_score_table($fp, $scores, $rank_start)
 <table class="score">
 <thead>
 <tr>
-<th>順位</th>
+<th rowspan="2">順位</th>
 <th>スコア</th>
 <th>日付</th>
 <th>名前</th>
 <th>種族</th>
 <th>職業</th>
 <th>性別</th>
-<th>死因</th>
+<th><nobr>バージョン</nobr></th>
+</tr>
+<tr>
+<th colspan="7">死因</th>
 </tr>
 </thead>
 
@@ -122,8 +125,9 @@ EOM
         $sex_str = $score['sex'] ? "男" : "女";
         $realms = isset($score['realms_name']) ? "(".$score['realms_name'].")" : "";
         $dumpfile = new DumpFile($score['score_id']);
+        $version = trim(str_replace("変愚蛮怒", "", h($score['version'])));
 
-        $name = h("{$score['personality_name']}{$score['name']}");
+        $name = "<span>".h("{$score['personality_name']}")."</span><span>".h("{$score['name']}")."</span>";
         if ($dumpfile->exists('dumps', 'txt')) {
             $name = "<a href=\"show_dump.php?score_id={$score['score_id']}\">{$name}</a>";
         }
@@ -131,24 +135,27 @@ EOM
             $fp,
             <<<EOM
 <tr>
-<td>$rank</td>
+<td class="rank" rowspan="2">$rank</td>
 <td class="number">{$score['score']}</td>
 <td><nobr>$date</nobr></td>
-<td>$name</td>
-<td>{$score['race_name']}</td>
-<td>{$score['class_name']}$realms</td>
-<td>$sex_str</td>
+<td class="player_name">$name</td>
+<td class="race_name">{$score['race_name']}</td>
+<td class="class_name"><span>{$score['class_name']}</span> <span>$realms</span></td>
+<td class="sex">$sex_str</td>
+<td>$version</td>
+</tr>
+<tr>
 
 EOM
         );
         $death_reason = h($score['death_reason']);
+        fwrite($fp, "<td colspan=\"7\">");
         if ($dumpfile->exists('screens', 'html')) {
-            fwrite($fp, "<td><a href=\"show_screen.php?score_id={$score['score_id']}\">{$death_reason}</a>");
+            fwrite($fp, "<a href=\"show_screen.php?score_id={$score['score_id']}\">{$death_reason}</a>");
         } else {
-            fwrite($fp, "<td>{$death_reason}");
+            fwrite($fp, "{$death_reason}");
         }
-        fwrite($fp, "<br>(".h($score['version']).")</td>\n".
-               "</tr>\n");
+        fwrite($fp, "</td>\n</tr>\n");
     }
     fwrite($fp, "</tbody>\n");
     fwrite($fp, "</table>\n");