Skip to content

Commit

Permalink
🐞 fix: Start theming #22
Browse files Browse the repository at this point in the history
  • Loading branch information
DNA-styx committed Dec 7, 2024
1 parent 6b344aa commit 045d380
Show file tree
Hide file tree
Showing 16 changed files with 130 additions and 37 deletions.
1 change: 1 addition & 0 deletions web/pages/ingame/accuracy.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@

if ($db->num_rows($result) != 0)
{
display_page_title('Your Weapon Accuracy');
$tblWeaponstats->draw($result, $db->num_rows($result), 100);
}

Expand Down
11 changes: 6 additions & 5 deletions web/pages/ingame/actioninfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
hlstats_Events_PlayerActions.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking<>'1'
GROUP BY
hlstats_Events_PlayerActions.playerId
hlstats_Events_PlayerActions.playerId,
hlstats_Actions.reward_player
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
Expand Down Expand Up @@ -151,7 +152,8 @@
hlstats_Events_TeamBonuses.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking<>'1'
GROUP BY
hlstats_Events_TeamBonuses.playerId
hlstats_Events_TeamBonuses.playerId,
hlstats_Actions.reward_player
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
Expand All @@ -173,8 +175,7 @@
list($numitems, $totalact) = $db->fetch_row($resultCount);

}

?>
<?php
display_page_title('Your Action Statistics');

$table->draw($result, $numitems, 100, 'center');
?>
8 changes: 4 additions & 4 deletions web/pages/ingame/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// Action Statistics

$player = valid_request(intval($_GET['player']), true);
$uniqueid = valid_request(strval($_GET['uniqueid']), false);
// $uniqueid = valid_request(strval($_GET['uniqueid']), false);

$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() < 1) error("No such game '$game'.");
Expand All @@ -56,7 +56,7 @@
new TableColumn(
'description',
'Action',
'width=45&link=' . urlencode("mode=actioninfo&amp;action=%k&amp;game=$game")
'width=45&link=' . urlencode("mode=actioninfo&amp;action=%k&amp;game=$game&player=$player")
),
new TableColumn(
'obj_count',
Expand Down Expand Up @@ -107,8 +107,8 @@
$tblPlayerActions->sort $tblPlayerActions->sortorder,
$tblPlayerActions->sort2 $tblPlayerActions->sortorder
");
?>

<?php
display_page_title('Your Action Statistics');

$tblPlayerActions->draw($result, $db->num_rows($result), 100);
?>
2 changes: 2 additions & 0 deletions web/pages/ingame/bans.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,7 @@

list($numitems) = $db->fetch_row($resultCount);

display_page_title('Server bans');

$table->draw($result, 25, 100);
?>
2 changes: 2 additions & 0 deletions web/pages/ingame/clans.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,7 @@
COUNT(hlstats_Players.playerId) >= $minmembers
");

display_page_title('Clan Statistics');

$table->draw($result, $db->num_rows($resultCount), 100);
?>
82 changes: 74 additions & 8 deletions web/pages/ingame/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,82 @@
die('Do not access this file directly.');
}

if (!isset($_GET['hide'])) {

if (!isset($_GET['hide'])) {
if (isset($_GET['player'])){
$player = valid_request(intval($_GET['player']), true);
}

if (isset($_GET['game'])){
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=bans\">Bans</a>";
echo "&nbsp;";
}

echo "<a href=\"ingame.php?mode=help\">Help</a>";
if (isset($_GET['game']) && isset($_GET['player'])){
echo "<b>Your Stats:</b> ";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=statsme&player=" . $player . "\">StatsMe</a>";
echo "&nbsp;";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=maps&player=" . $player . "\">Maps</a>";
echo "&nbsp;";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=kills&player=" . $player . "\">Kills</a>";
echo "&nbsp;";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=accuracy&player=" . $player . "\">Accuracy</a>";
echo "&nbsp;";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=weapons&player=" . $player . "\">Weapons</a>";
echo "&nbsp;";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=targets&player=" . $player . "\">Targets</a>";
echo "&nbsp;";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=actions&player=" . $player . "\">Actions</a>";
echo "&nbsp;";

}

echo "<br>";



if (isset($_GET['game'])){
echo "<b>Server Stats:</b> ";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=motd&player=" . $player . "\">MOTD</a>";
echo "&nbsp;";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=servers&player=" . $player . "\">Servers</a>";
echo "&nbsp;";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=players&player=" . $player . "\">Players</a>";
echo "&nbsp;";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=clans&player=" . $player . "\">Clans</a>";
echo "&nbsp;";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=actions&player=" . $player . "\">Actions</a>";
echo "&nbsp;";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=bans&player=" . $player . "\">Bans</a>";
echo "&nbsp;";
echo "<a href=\"ingame.php?game=" . $_GET['game'] . "&mode=help&player=" . $player . "\">Help</a>";
}


?>
<br><br>
<!-- Start footer bar -->
<div
class="flex items-center justify-between p-4 mb-4 text-sm px-4 py-3 bg-white rounded-lg shadow-md dark:bg-gray-800 text-gray-600 dark:text-gray-400">
<div class="flex items-center">
<span>
<a class="font-semibold" href="https://github.com/startersclan/hlstatsx-community-edition" target="_blank">
HLstatsX Community Edition v<?php echo $g_options['version'] ?>
</a></span>
</div>
<div class="flex items-center">
<span align="right">
<a class="font-semibold" href="https://github.com/DNA-styx/hlstatsx-windmill-theme" target="_blank">
Theme <?php
$theme_version = file_get_contents("assets/theme_version.txt");
echo str_replace(" ", "",str_replace("**", "", $theme_version)) . "\n";
?>
</a>
based on
<a class="font-semibold" href="https://github.com/estevanmaito/windmill-dashboard" target="_blank">
Windmill Dashboard
</a>
</span>
</div>
</div>
<!-- end footer bar -->
<?php
}
?>
</body>
</html>
</html>
7 changes: 5 additions & 2 deletions web/pages/ingame/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@
$server_id = valid_request($_GET['server_id'], true);
}

display_page_title('Help');

?>
<strong>&nbsp;<a href="http://www.hlxcommunity.com">HLstatsX Community Edition</a> <?php echo $g_options['version']; ?></strong><br /><br />
<table style="width:100%;border:0;padding:1px;border-spacing:0;">
<tr class="data-table-head">
<td class="fSmall data-table" colspan="3">&nbsp;Commands display the results ingame</td>
Expand Down Expand Up @@ -168,7 +169,8 @@
<td class="fNormal">(Type in chat, not console) Makes you invisible on player rankings, unranked.</td>
</tr>
</table>
<table class="data-table">
<br><br>
<table class="data-table">
<tr class="data-table-head">
<td style="width:55%;" class="fSmall">&nbsp;Participating Servers</td>
<td style="width:23%;" class="fSmall">&nbsp;Address</td>
Expand Down Expand Up @@ -246,3 +248,4 @@
</tr>
<?php } ?>
</table>
<br>
5 changes: 4 additions & 1 deletion web/pages/ingame/kills.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@
new TableColumn(
'name',
'Victim',
'width=32&flag=1&link=' . urlencode('mode=statsme&player=%k')
'width=32&flag=1)'
// Remove player link for now as it breaks the 'Your Stats' menu
//'width=32&flag=1&link=' . urlencode('mode=statsme&player=%k')
),
new TableColumn(
'kills',
Expand Down Expand Up @@ -297,6 +299,7 @@

if ($numitems > 0)
{
display_page_title('Your Kill Statistics');
$tblPlayerKillStats->draw($result, $numitems, 100);
}
?>
Expand Down
9 changes: 5 additions & 4 deletions web/pages/ingame/mapinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@
new TableColumn(
'killerName',
'Player',
'width=60&align=left&flag=1&link=' . urlencode('mode=statsme&amp;player=%k')
'width=60&align=left&flag=1'
// Remove player link for now as it breaks the 'Your Stats' menu
//'width=60&align=left&flag=1&link=' . urlencode('mode=statsme&amp;player=%k&game=' . $game)
),
new TableColumn(
'frags',
'Kills on $map',
'Kills on ' . $map,
'width=15&align=right'
),
new TableColumn(
Expand Down Expand Up @@ -119,9 +121,8 @@
");

list($numitems, $totalkills) = $db->fetch_row($resultCount);
?>

display_page_title('Your Map Statistics');

<?php
$table->draw($result, $numitems, 100, 'center');
?>
4 changes: 3 additions & 1 deletion web/pages/ingame/maps.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
new TableColumn(
'map',
'Map Name',
'width=18&align=left&link=' . urlencode("mode=mapinfo&map=%k&game=$game")
'width=18&align=left&link=' . urlencode("mode=mapinfo&map=%k&game=$game&player=$player")
),
new TableColumn(
'kills',
Expand Down Expand Up @@ -227,5 +227,7 @@
$tblMaps->sort2 $tblMaps->sortorder
");

display_page_title('Maps Played');

$tblMaps->draw($result, $db->num_rows($result), 100);
?>
8 changes: 6 additions & 2 deletions web/pages/ingame/motd.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
//
// Message of the day
//

if (!isset($_GET['hide'])) {
display_page_title($g_options['sitename'] . ' Statistics');
}
//
// General
//
Expand Down Expand Up @@ -90,7 +92,9 @@
new TableColumn(
'lastName',
'Playername',
'width=50&flag=1&link=' . urlencode('mode=statsme&amp;player=%k')
'width=50&flag=1'
// Remove player link for now as it breaks the 'Your Stats' menu
//'width=50&flag=1&link=' . urlencode('mode=statsme&amp;player=%k')
),
new TableColumn(
'skill',
Expand Down
4 changes: 3 additions & 1 deletion web/pages/ingame/players.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@
");

list($numitems) = $db->fetch_row($resultCount);


display_page_title('Player Statistics');

$table->draw($result, 25, 100);
?>
5 changes: 4 additions & 1 deletion web/pages/ingame/servers.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@
$server_id = valid_request($_GET['server_id'], true);
}
?>
<?php display_page_title('Participating Servers'); ?>

<table class="data-table">
<tr class="data-table-head">
<td style="width:55%;" class="fSmall">&nbsp;Participating Servers</td>
<td style="width:55%;" class="fSmall">&nbsp;Server Name</td>
<td style="width:23%;" class="fSmall">&nbsp;Address</td>
<td style="width:6%;text-align:center;" class="fSmall">&nbsp;Map</td>
<td style="width:6%;text-align:center;" class="fSmall">&nbsp;Played</td>
Expand Down Expand Up @@ -124,3 +126,4 @@
</tr>
<?php } ?>
</table>
<br>
10 changes: 5 additions & 5 deletions web/pages/ingame/statsme.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,12 @@
}

?>
<table class="data-table">
<tr class="data-table-head">
<td colspan="3" class="fSmall">Statistics Summary</td>
</tr>
<?php display_page_title('Player Statistics Summary'); ?>

<table class="data-table">
<tr class="bg1">
<td class="fSmall">Name:</td>
<td colspan="2" class="fSmall"><?php
<td colspan="2" class="flex px-4 py-3 items-center"><?php
if ($g_options['countrydata'] == 1)
echo '<img src="'.getFlag($playerdata['flag']).'" alt="'.strtolower($playerdata['country']).'" title="'.strtolower($playerdata['country']).'">&nbsp;';
echo '<strong>' . htmlspecialchars($playerdata['lastName'], ENT_COMPAT) . '</strong>';
Expand Down Expand Up @@ -339,3 +338,4 @@
?></td>
</tr>
</table>
<br>
3 changes: 2 additions & 1 deletion web/pages/ingame/targets.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@

if ($db->num_rows($result) != 0)
{
$tblWeaponstats2->draw($result, $db->num_rows($result), 100);
display_page_title('Your Kill Statistics');
$tblWeaponstats2->draw($result, $db->num_rows($result), 100);
}
?>
6 changes: 4 additions & 2 deletions web/pages/ingame/weapons.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,13 @@
hlstats_Servers.game='$game' AND hlstats_Events_Frags.killerId=$player
AND (hlstats_Weapons.game='$game' OR hlstats_Weapons.weaponId IS NULL)
GROUP BY
hlstats_Events_Frags.weapon
hlstats_Events_Frags.weapon,
hlstats_Weapons.modifier
ORDER BY
$tblWeapons->sort $tblWeapons->sortorder,
$tblWeapons->sort2 $tblWeapons->sortorder
");

$tblWeapons->draw($result, $db->num_rows($result), 100);
display_page_title('Your Weapon Statistics');
$tblWeapons->draw($result, $db->num_rows($result), 100);
?>

0 comments on commit 045d380

Please sign in to comment.