From 40dfa7d5c0dc8e4cb2c95e403b6b4b2c4bf70644 Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Sat, 4 Feb 2017 16:05:45 +0100 Subject: Original UTStats beta 4.2.8 --- html/pages/players_info.php | 442 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 442 insertions(+) create mode 100755 html/pages/players_info.php (limited to 'html/pages/players_info.php') diff --git a/html/pages/players_info.php b/html/pages/players_info.php new file mode 100755 index 0000000..11064dc --- /dev/null +++ b/html/pages/players_info.php @@ -0,0 +1,442 @@ +"; + } else { + echo "Sorry, this player has been banned!"; + include("includes/footer.php"); + exit; + } +} + +$playername = $r_info['name']; + +if (isset($_GET['togglewatch'])) { + $status = ToggleWatchStatus($pid); + include('includes/header.php'); + if ($status == 1) { + echo htmlentities($playername) ." has been added to your watchlist"; + } else { + echo htmlentities($playername) ." has been removed from your watchlist"; + } + echo "
"; + $target = $PHP_SELF .'?p=pinfo&pid='. $pid; + echo 'You will be taken back to the '. htmlentities($playername) .'\'s page in a moment.'; + echo ''; + return; +} + + +if (isset($_GET['pics'])) { + $gid = $_GET['gid']; + $gid = preg_replace("/\D/", "", $gid); + if (!$pic_enable) { + echo "Sorry, pictures are disabled by the administrator"; + return; + } + $oururl = $_SERVER["HTTP_HOST"].$_SERVER["PHP_SELF"]; + $oururl = str_replace("index.php", "", $oururl); + + echo '
'; + require('includes/config_pic.php'); + $disp = false; + foreach($pic as $num => $options) { + if (!$options['enabled']) continue; + if ($options['gidrequired'] and empty($gid)) continue; + $disp = true; + $pinfourl = "http://${oururl}?p=pinfo&pid=$pid"; + $lgid = ($options['gidrequired']) ? $gid : 0; + $imgurl = "http://${oururl}pic.php/$num/$pid/$lgid/.".$options['output']['type']; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
BB Code:
HTML Code:


'; + } + if (!$disp) echo "Sorry, no pictures in this category"; + echo '
'; + return; +} + + + + + +echo' + + + + + + + + + + + + + + + + + + '; + +$sql_plist = "SELECT g.name AS gamename, 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, SUM(p.teamkills) AS teamkills, SUM(kills+deaths+suicides+teamkills) AS sumeff, AVG(p.accuracy) AS accuracy, AVG(p.ttl) AS ttl, +COUNT(p.id) AS games, SUM(p.gametime) as gametime +FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id AND p.pid = '$pid' GROUP BY p.gid"; + +$q_plist = mysql_query($sql_plist) or die(mysql_error()); +while ($r_plist = mysql_fetch_array($q_plist)) { + + $gametime = sec2hour($r_plist[gametime]); + $eff = get_dp($r_plist[kills]/$r_plist[sumeff]*100); + $acc = get_dp($r_plist[accuracy]); + $ttl = GetMinutes($r_plist[ttl]); + + echo' + + + + + + + + + + + + + '; +} + +$r_sumplist = small_query("SELECT SUM(gamescore) AS gamescore, SUM(frags) AS frags, SUM(kills) AS kills, SUM(deaths) AS deaths, +SUM(suicides) AS suicides, SUM(teamkills) AS teamkills, SUM(kills+deaths+suicides+teamkills) AS sumeff, +AVG(accuracy) AS accuracy, AVG(ttl) AS ttl, COUNT(id) AS games, SUM(gametime) as gametime +FROM uts_player WHERE pid = '$pid'"); + +$gametime = sec2hour($r_sumplist[gametime]); +$eff = get_dp($r_sumplist[kills]/$r_sumplist[sumeff]*100); +$acc = get_dp($r_sumplist[accuracy]); +$ttl = GetMinutes($r_sumplist[ttl]); + + echo' + + + + + + + + + + + + + + +
Career Summary for '.FlagImage($r_info['country'], false).' '.htmlentities($playername).' '; + +if (PlayerOnWatchlist($pid)) { + echo ''; +} else { + echo ''; +} + +echo ' +
Match TypeScoreFKDSTKEff.Acc.Avg TTLMatchesHours
'.$r_plist[gamename].''.$r_plist[gamescore].''.$r_plist[frags].''.$r_plist[kills].''.$r_plist[deaths].''.$r_plist[suicides].''.$r_plist[teamkills].''.$eff.''.$acc.''.$ttl.''.$r_plist[games].''.$gametime.'
Totals'.$r_sumplist[gamescore].''.$r_sumplist[frags].''.$r_sumplist[kills].''.$r_sumplist[deaths].''.$r_sumplist[suicides].''.$r_sumplist[teamkills].''.$eff.''.$acc.''.$ttl.''.$r_sumplist[games].''.$gametime.'
+
'; + +$q_assgids = mysql_query("SELECT id FROM uts_games WHERE gamename LIKE '%Assault%';") or die(mysql_error()); +$assgids = array(); +while ($r_assgids = mysql_fetch_array($q_assgids)) { + $assgids[] = $r_assgids['id']; +} +$assquery = (count($assgids) > 0) ? 'SUM(IF (gid IN ('. implode(',', $assgids) .'), ass_obj, 0)) AS ass_obj' : '0 AS ass_obj'; + $sql_cdatot = zero_out(small_query("SELECT SUM(dom_cp) AS dom_cp, $assquery, SUM(flag_taken) AS flag_taken, +SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, +SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, +SUM(flag_return) AS flag_return FROM uts_player WHERE pid = '$pid'")); + +if ($sql_cdatot[ass_obj] || $sql_cdatot[dom_cp] || $sql_cdatot[flag_taken] || $sql_cdatot[flag_pickedup] || $sql_cdatot[flag_dropped] || $sql_cdatot[flag_assist] || $sql_cdatot[flag_cover] || $sql_cdatot[flag_seal] || $sql_cdatot[flag_capture] || $sql_cdatot[flag_kill] || $sql_cdatot[flag_return]) { + echo ' + + + + + + + + + + + + + + + + + + + + '; + + echo' + + + + + + + + + + + + + +
Assault, Domination and CTF Events Summary
Assault ObjectivesControl Point CapturesCapture The Flag
Flag TakesFlag PickupsFlag DropsFlag AssistsFlag CoversFlag SealsFlag CapturesFlag KillsFlag Returns
'.$sql_cdatot[ass_obj].''.$sql_cdatot[dom_cp].''.$sql_cdatot[flag_taken].''.$sql_cdatot[flag_pickedup].''.$sql_cdatot[flag_dropped].''.$sql_cdatot[flag_assist].''.$sql_cdatot[flag_cover].''.$sql_cdatot[flag_seal].''.$sql_cdatot[flag_capture].''.$sql_cdatot[flag_kill].''.$sql_cdatot[flag_return].'
+
'; +} + +$sql_firstblood = zero_out(small_query("SELECT COUNT(id) AS fbcount FROM uts_match WHERE firstblood = '$pid'")); +$sql_multis = zero_out(small_query("SELECT SUM(spree_double) AS spree_double, SUM(spree_multi) AS spree_multi, +SUM(spree_ultra) AS spree_ultra, SUM(spree_monster) AS spree_monster, +SUM(spree_kill) AS spree_kill, SUM(spree_rampage) AS spree_rampage, SUM(spree_dom) AS spree_dom, +SUM(spree_uns) AS spree_uns, SUM(spree_god) AS spree_god +FROM uts_player WHERE pid = '$pid'")); + +if ($sql_firstblood[fbcount] || $sql_multis[spree_double] || $sql_multis[spree_multi] || $sql_multis[spree_ultra] || $sql_multis[spree_monster] || $sql_multis[spree_kill] || $sql_multis[spree_rampage] || $sql_multis[spree_dom] || $sql_multis[spree_uns] || $sql_multis[spree_god] ) { + echo ' + + + + + + + + + + + + + + + + + + + + '; + + echo' + + + + + + + + + + + + +
Special Events
First BloodMultisSprees
DblMultiUltraMonsKillRamDomUnsGod
'.$sql_firstblood[fbcount].''.$sql_multis[spree_double].''.$sql_multis[spree_multi].''.$sql_multis[spree_ultra].''.$sql_multis[spree_monster].''.$sql_multis[spree_kill].''.$sql_multis[spree_rampage].''.$sql_multis[spree_dom].''.$sql_multis[spree_uns].''.$sql_multis[spree_god].'
+
'; +} + +$r_pickups = zero_out(small_query("SELECT SUM(pu_pads) AS pu_pads, SUM(pu_armour) AS pu_armour, SUM(pu_keg) AS pu_keg, +SUM(pu_invis) AS pu_invis, SUM(pu_belt) AS pu_belt, SUM(pu_amp) AS pu_amp +FROM uts_player WHERE pid = '$pid'")); + +if ($r_pickups[pu_pads] || $r_pickups[pu_armour] || $r_pickups[pu_keg] || $r_pickups[pu_invis] || $r_pickups[pu_belt] || $r_pickups[pu_amp] ) { + echo ' + + + + + + + + + + + + + + + + + + + + +
Pickups Summary
PadsArmourKegInvisibilityShield BeltDamage Amp
'.$r_pickups[pu_pads].''.$r_pickups[pu_armour].''.$r_pickups[pu_keg].''.$r_pickups[pu_invis].''.$r_pickups[pu_belt].''.$r_pickups[pu_amp].'
+
'; +} + +include('includes/weaponstats.php'); +weaponstats(0, $pid); + +echo '
'; + +// bt records +$sql_btrecords = " +SELECT + m.mapfile AS map, + e.col3 AS time, + e.col4 AS date +FROM + uts_match AS m, + uts_events AS e, + uts_player AS p +WHERE + p.pid = $pid AND + p.playerid = e.playerid AND + e.matchid = p.matchid AND + m.id = p.matchid AND + e.col1 = 'btcap' +GROUP BY + m.mapfile +ORDER BY + m.mapfile, + 0 + e.col3 ASC"; + +$q_btrecords = mysql_query($sql_btrecords) or die (mysql_error()); +if (mysql_num_rows($q_btrecords) > 0) { + echo ' + + + + + + + + + + '; + while ($r_btrecords = mysql_fetch_array($q_btrecords)) { + $map = un_ut($r_btrecords['map']); + $myurl = urlencode($map); + $maprank = 1 + small_count("SELECT DISTINCT p.pid AS rank FROM uts_player as p, uts_events AS e, uts_match as m WHERE (m.mapfile = '" . addslashes($map) . "' OR m.mapfile = '" . addslashes($map) . ".unr') AND m.id = e.matchid AND e.matchid = p.matchid AND e.playerid = p.playerid AND e.col3 < ".$r_btrecords['time'] . " AND e.col1 = 'btcap'"); + echo ' + + + + '; + } + echo ' +
Bunny Track Personal Records
MapN°TimeDate
 '.htmlentities($map).'', $maprank, '', btcaptime($r_btrecords['time']), '', gmdate('d-m-Y h:i a', $r_btrecords['date']), '
+
'; +} + +// Do graph stuff +$bgwhere = "pid = '$pid'"; +include("pages/graph_pbreakdown.php"); + + +// Player's ranks +echo' + + + + + + + + + '; + if ($pic_enable and basename($_SERVER['PATH_TRANSLATED']) != 'admin.php') echo ''; +echo ''; + +$sql_rank = "SELECT g.name AS gamename, r.rank, r.prevrank, r.matches, r.gid, r.pid FROM uts_rank AS r, uts_games AS g WHERE r.gid = g.id AND r.pid = '$pid';"; +$q_rank = mysql_query($sql_rank) or die(mysql_error()); +while ($r_rank = mysql_fetch_array($q_rank)) { + $r_no = small_query("SELECT (COUNT(*) + 1) AS no FROM uts_rank WHERE gid= '${r_rank['gid']}' and rank > ". get_dp($r_rank['rank']) ."9"); + echo' + + + + '; + echo ''; + if ($pic_enable and basename($_SERVER['PATH_TRANSLATED']) != 'admin.php') echo ''; + echo ''; +} + +echo '
Ranking
N°Match TypeRankMatchesExplainPics
'.RankImageOrText($r_rank['pid'], $name, $r_no['no'], $r_rank['gid'], $r_rank['gamename'], false, '%IT%').''.$r_rank['gamename'].''.get_dp($r_rank['rank']) .' '. RankMovement($r_rank['rank'] - $r_rank['prevrank']) . ''.$r_rank['matches'].'(Click)(Click)
'; + + +$r_pings = small_query("SELECT MIN(lowping * 1) AS lowping, AVG(avgping * 1) AS avgping, MAX(highping * 1) AS highping FROM uts_player WHERE pid = $pid and lowping > 0"); +if ($r_pings and $r_pings['lowping']) { +echo ' +
+ + + + + + + + + + + + + + +
Pings
MinAvgMax
'.ceil($r_pings['lowping']).''.ceil($r_pings['avgping']).''.ceil($r_pings['highping']).'
'; +} + + + + +echo'
+ + + + + + + + '; + if (isset($is_admin) and $is_admin) echo ''; + echo''; + +$sql_recent = "SELECT m.id, m.time, g.name AS gamename, m.mapfile, INET_NTOA(p.ip) AS ip FROM uts_match m, uts_player p, uts_games g +WHERE p.pid = '$pid' AND m.id = p.matchid AND m.gid = g.id ORDER BY time DESC LIMIT 0,50"; +$q_recent = mysql_query($sql_recent) or die(mysql_error()); +while ($r_recent = mysql_fetch_array($q_recent)) { + + $r_time = mdate($r_recent[time]); + $r_mapfile = un_ut($r_recent[mapfile]); + + echo' + + + + + '; + if (isset($is_admin) and $is_admin) echo ''; + + echo ''; +} + +echo' +
Last 50 Games
Match IDDate/TimeMatch TypeMapIP Used
'.$r_recent[id].''.$r_time.''.$r_recent[gamename].''.$r_mapfile.''. $r_recent[ip].'
+'; +?> -- cgit