Skip to content

Commit

Permalink
✨ feat:Add details link to server's graphs page
Browse files Browse the repository at this point in the history
  • Loading branch information
DNA-styx committed Jan 12, 2025
1 parent 7cd777f commit 22f9cb9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
22 changes: 8 additions & 14 deletions web/pages/game.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,31 +246,25 @@
$map_teama_wins = $rowdata['map_ct_wins'];
$map_teamb_wins = $rowdata['map_ts_wins'];


?>
<tr style="cursor: pointer;" class="handle text-sm font-semibold text-gray-700 dark:text-gray-400">
<td colspan="5">&nbsp;&nbsp;<?php
echo $rowdata['name'] . " <span class=\"windmill-text-link\"><a href=\"steam://connect/$addr\">(Join)</a></span>";
?></td>
<td style="text-align:center;"><?php
echo $rowdata['act_map'];
echo $rowdata['name'] . "\n";
echo " <span class=\"windmill-text-link\"><a href=\"hlstats.php?game=$game&mode=servers&server_id=$server_id\">(Details)</a></span>\n";
echo " <span class=\"windmill-text-link\"><a href=\"steam://connect/$addr\">(Join)</a></span>\n";

?></td>
<td style="text-align:center;"><?php echo $rowdata['act_map']; ?></td>
<td style="text-align:center;"><?php
$stamp = $rowdata['map_started']==0?0:time() - $rowdata['map_started'];
$hours = sprintf("%02d", floor($stamp / 3600));
$min = sprintf("%02d", floor(($stamp % 3600) / 60));
$sec = sprintf("%02d", floor($stamp % 60));
echo $hours . ":" . $min . ":" . $sec;
?></td>
<td style="text-align:center;"><?php
echo $player_string;
?></td>
<td style="text-align:center;"><?php
echo number_format($kills);
?></td>
<td style="text-align:center;"><?php
echo number_format($headshots);
?></td>
<td style="text-align:center;"><?php echo $player_string; ?></td>
<td style="text-align:center;"><?php echo number_format($kills); ?></td>
<td style="text-align:center;"><?php echo number_format($headshots); ?></td>
<td style="text-align:center;"><?php
if ($kills > 0)
echo sprintf("%.2f", ($headshots / $kills));
Expand Down
10 changes: 5 additions & 5 deletions web/pages/servers.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
else
echo IMAGE_PATH . '/game.gif';
echo "\" alt=\"$game\">\n ";
echo htmlspecialchars($rowdata['name']) . "<span class=\"windmill-text-link\"><a href=\"steam://connect/$addr\">(Join)</a></span>\n";
echo htmlspecialchars($rowdata['name']) . " <span class=\"windmill-text-link\"><a href=\"steam://connect/$addr\">(Join)</a></span>\n";
?>
</td>
<td class="px-4 py-3" style="text-align:center;"><?php echo $rowdata['act_map']; ?></td>
Expand Down Expand Up @@ -187,13 +187,13 @@

<div class="grid gap-6 mb-8 md:grid-cols-2">
<div class="min-w-0 p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">24h View</h4>
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">24hrs</h4>
<a href="show_graph.php?type=0&amp;game=<?php echo $game; ?>&amp;width=870&amp;height=200&amp;server_id=<?php echo $server_id ?>&amp;bgcolor=<?php echo $g_options['graphbg_load']; ?>&amp;color=<?php echo $g_options['graphtxt_load']; ?>&amp;range=1">
<img src="show_graph.php?type=0&amp;game=<?php echo $game; ?>&amp;width=870&amp;height=200&amp;server_id=<?php echo $server_id ?>&amp;bgcolor=<?php echo $g_options['graphbg_load']; ?>&amp;color=<?php echo $g_options['graphtxt_load']; ?>&amp;range=1" alt="24h View">
</a>
</div>
<div class="min-w-0 p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">Last Week</h4>
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">7 Days</h4>
<a href="show_graph.php?type=0&amp;game=<?php echo $game; ?>&amp;width=870&amp;height=200&amp;server_id=<?php echo $server_id ?>&amp;bgcolor=<?php echo $g_options['graphbg_load']; ?>&amp;color=<?php echo $g_options['graphtxt_load']; ?>&amp;range=2">
<img src="show_graph.php?type=0&amp;game=<?php echo $game; ?>&amp;width=870&amp;height=200&amp;server_id=<?php echo $server_id ?>&amp;bgcolor=<?php echo $g_options['graphbg_load']; ?>&amp;color=<?php echo $g_options['graphtxt_load']; ?>&amp;range=2" alt="Last Week">
</a>
Expand All @@ -202,13 +202,13 @@

<div class="grid gap-6 mb-8 md:grid-cols-2">
<div class="min-w-0 p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">Last Month</h4>
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">30 Days</h4>
<a href="show_graph.php?type=0&amp;game=<?php echo $game; ?>&amp;width=870&amp;height=200&amp;server_id=<?php echo $server_id ?>&amp;bgcolor=<?php echo $g_options['graphbg_load']; ?>&amp;color=<?php echo $g_options['graphtxt_load']; ?>&amp;range=3">
<img src="show_graph.php?type=0&amp;game=<?php echo $game; ?>&amp;width=870&amp;height=200&amp;server_id=<?php echo $server_id ?>&amp;bgcolor=<?php echo $g_options['graphbg_load']; ?>&amp;color=<?php echo $g_options['graphtxt_load']; ?>&amp;range=3" alt="Last Month">
</a>
</div>
<div class="min-w-0 p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">Last Year</h4>
<h4 class="mb-4 font-semibold text-gray-600 dark:text-gray-300">12 Months</h4>
<a href="show_graph.php?type=0&amp;game=<?php echo $game; ?>&amp;width=870&amp;height=200&amp;server_id=<?php echo $server_id ?>&amp;bgcolor=<?php echo $g_options['graphbg_load']; ?>&amp;color=<?php echo $g_options['graphtxt_load']; ?>&amp;range=4">
<img src="show_graph.php?type=0&amp;game=<?php echo $game; ?>&amp;width=870&amp;height=200&amp;server_id=<?php echo $server_id ?>&amp;bgcolor=<?php echo $g_options['graphbg_load']; ?>&amp;color=<?php echo $g_options['graphtxt_load']; ?>&amp;range=4" alt="Last Year">
</a>
Expand Down

0 comments on commit 22f9cb9

Please sign in to comment.