From 790d93b495ecc375ea0518a5f43f2944daa9720b Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Mon, 8 Jan 2018 01:16:20 +0100 Subject: Main pages markup --- html/pages/watchlist.php | 191 +++++++++++++++++++++++++---------------------- 1 file changed, 102 insertions(+), 89 deletions(-) (limited to 'html/pages/watchlist.php') diff --git a/html/pages/watchlist.php b/html/pages/watchlist.php index bfc8512..4f4cf1b 100755 --- a/html/pages/watchlist.php +++ b/html/pages/watchlist.php @@ -1,106 +1,119 @@ - - Your Watchlist + + + + -
Your Watchlist
'; -echo '


'; - + + +
+
+ + + + +
'; $watchlist = GetCurrentWatchlist(); + if (count($watchlist) > 25) $watchlist = array_slice($watchlist, 0, 25); + if (count($watchlist) == 0) { - echo "

Your watchlist is empty!

You can add players to your watchlist by clicking the appropriate icon on the header of their career summary page.

"; - return; + echo ' + + +

+ Your watchlist is empty! +

+ You can add players to your watchlist by clicking the appropriate icon on the header of their career summary page. +

+ + + '; + return; } echo ' - - - - - - - - - - - - - - - - '; + + + + + + + + + + + + + +'; +$i = 0; -$i = 0; -foreach($watchlist as $pid) { - $sql_players = "SELECT pi.id AS pid, - pi.name, - pi.country, - m.time, - m.id AS mid - FROM uts_pinfo pi, - uts_match m, - uts_player p - WHERE pi.id = '$pid' - AND p.matchid = m.id - AND p.pid = pi.id - ORDER BY m.time DESC - LIMIT 0,1 - "; - - $sql_pinfo = " SELECT COUNT(*) AS games, - SUM(p.gamescore) as gamescore, - SUM(p.frags) AS frags, - SUM(p.kills) AS kills, - SUM(p.deaths) AS deaths, - SUM(p.suicides) as suicides, - AVG(p.eff) AS eff, - AVG(p.accuracy) AS accuracy, - AVG(p.ttl) AS ttl, - SUM(gametime) as gametime - FROM uts_player AS p - WHERE p.pid = '$pid' - GROUP BY p.pid"; - $r_pinfo = small_query($sql_pinfo); - - $q_players = mysql_query($sql_players) or die(mysql_error()); - - - while ($r_players = mysql_fetch_array($q_players)) { - $i++; - $new = (mtimestamp($r_players['time']) > $s_lastvisit) ? true : false; - $class = ($i % 2) ? 'grey' : 'grey2'; - echo ''; - echo ''; - echo ''; - - echo ' - - - - - - - - - - '; - - echo ''; - } -} +foreach ($watchlist as $pid) { + $sql_players = "SELECT pi.id AS pid, + pi.name, + pi.country, + m.time, + m.id AS mid + FROM uts_pinfo pi, + uts_match m, + uts_player p + WHERE pi.id = '$pid' + AND p.matchid = m.id + AND p.pid = pi.id + ORDER BY m.time DESC + LIMIT 0,1"; -echo '
Player NameLast MatchMatchesScoreFragsKillsDeathsSuicidesEffAccTTLHours
Player NameLast MatchMatchesScoreFragsKillsDeathsSuicidesEffAccTTLHours
'; - echo FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name']); - echo '';; - if ($new) echo ""; - echo date("Y-m-d H:i", mtimestamp($r_players['time'])); - if ($new) echo ""; - echo ''.$r_pinfo['games'].''.$r_pinfo['gamescore'].''.$r_pinfo['frags'].''.$r_pinfo['kills'].''.$r_pinfo['deaths'].''.$r_pinfo['suicides'].''.get_dp($r_pinfo['eff']).''.get_dp($r_pinfo['accuracy']).''.GetMinutes($r_pinfo['ttl']).''.sec2hour($r_pinfo['gametime']).'
'; + $sql_pinfo = " SELECT COUNT(*) AS games, + SUM(p.gamescore) as gamescore, + SUM(p.frags) AS frags, + SUM(p.kills) AS kills, + SUM(p.deaths) AS deaths, + SUM(p.suicides) as suicides, + AVG(p.eff) AS eff, + AVG(p.accuracy) AS accuracy, + AVG(p.ttl) AS ttl, + SUM(gametime) as gametime + FROM uts_player AS p + WHERE p.pid = '$pid' + GROUP BY p.pid"; + $r_pinfo = small_query($sql_pinfo); + $q_players = mysql_query($sql_players) or die(mysql_error()); + + while ($r_players = mysql_fetch_array($q_players)) { + $i++; + $new = (mtimestamp($r_players['time']) > $s_lastvisit) ? true : false; + $class = ($i % 2) ? 'grey' : 'grey2'; + echo ''; + echo ''; + echo FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name']); + echo ''; + echo '';; + if ($new) echo ""; + echo date("Y-m-d H:i", mtimestamp($r_players['time'])); + if ($new) echo ""; + echo ' + + '.$r_pinfo['games'].' + '.$r_pinfo['gamescore'].' + '.$r_pinfo['frags'].' + '.$r_pinfo['kills'].' + '.$r_pinfo['deaths'].' + '.$r_pinfo['suicides'].' + '.get_dp($r_pinfo['eff']).' + '.get_dp($r_pinfo['accuracy']).' + '.GetMinutes($r_pinfo['ttl']).' + '.sec2hour($r_pinfo['gametime']).' + '; + } +} + +echo ''; ?> -- cgit