Warning : Undefined array key "STEAMID" in
/home/container/public_html/ttt_stats/compare.php on line
16
Warning : Undefined array key "STEAMID2" in
/home/container/public_html/ttt_stats/compare.php on line
17
Warning : Undefined array key "stype" in
/home/container/public_html/ttt_stats/compare.php on line
18
Compare your stats with a friends!
SteamID
Nickname
Playtime (hours, minutes, seconds)
Rounds Played
Times Innocent
Times Detective
Times Traitor
Total Deaths
Total Kills
K/D Ratio
Total Head-Shots
Total Points
Highest Score
First Joined
Last Seen
//start of player1 get data
if(isset($inputPlayer) && isset($inputPlayer2)){
while($playerarray = mysqli_fetch_array( $player )) {
$playerSteamid = $playerarray['steamid'];
$playerNickname = $playerarray['nickname'];
$playerPlaytime = $playerarray['playtime'];
$playerRoundsplayed = $playerarray['roundsplayed'];
$playerInnocenttimes = $playerarray['innocenttimes'];
$playerDetectivetimes = $playerarray['detectivetimes'];
$playerTraitortimes = $playerarray['traitortimes'];
$playerDeaths = $playerarray['deaths'];
$playerKills = $playerarray['kills'];
$playerHeadshots = $playerarray['headshots'];
$playerPoints = $playerarray['points'];
$playerMaxfrags = $playerarray['maxfrags'];
$playerFirstjoined = $playerarray['first_joined'];
$playerLastSeen = $playerarray['last_seen'];
$sb_search_string = $sb_search_build . $playerSteamid . "&Submit=";
if ($playerKills and $playerDeaths != 0){
$playerKDRTrun = $playerKills / $playerDeaths;
$playerKDR = round($playerKDRTrun, 2); //rounding to numbers such as 0.12 rather then 0.1259848797 etc. We don't need that many decimal points in our output, no one cares for that level of accuracy.
}
else {
$playerKDR = "N/A";
}
$seconds = $playerPlaytime;
//start of math for hourse, minues and seconds
$hours = floor($seconds / (60 * 60));
// extract minutes
$divisor_for_minutes = $seconds % (60 * 60);
$minutes = floor($divisor_for_minutes / 60);
// extract the remaining seconds
$divisor_for_seconds = $divisor_for_minutes % 60;
$seconds = ceil($divisor_for_seconds);
if ($sb_enabled == true){
include_once("./includes/config_sb.php");
$banned = mysqli_query($connect, "SELECT * FROM sb_bans WHERE authid = '$playerSteamid'");
$bannedTotal = mysqli_num_rows($banned);
}
echo "";
echo "" . $playerSteamid . " ";
echo "" . $playerNickname . " ";
echo " H:" . $hours . " M:" . $minutes . " S:" . $seconds . " ";
echo "" . $playerRoundsplayed . " ";
echo "" . $playerInnocenttimes . " ";
echo "" . $playerDetectivetimes . " ";
echo "" . $playerTraitortimes . " ";
echo "" . $playerDeaths . " ";
echo "" . $playerKills . " ";
echo "" . $playerKDR . " ";
echo "" . $playerHeadshots . " ";
echo "" . $playerPoints . " ";
echo "" . $playerMaxfrags . " ";
echo "" . $playerFirstjoined . " ";
echo "" . $playerLastSeen . " ";
if ($sb_enabled == true){
echo " " . $bannedTotal . " ";
}
echo " ";
}
}
echo "
";
//end of player 1 get and print of data
?>
SteamID
Nickname
Playtime (hours, minutes, seconds)
Rounds Played
Times Innocent
Times Detective
Times Traitor
Total Deaths
Total Kills
K/D Ratio
Total Head-Shots
Total Points
Highest Score
First Joined
Last Seen
//start of player 2 get and print data
if(isset($inputPlayer) && isset($inputPlayer2)){
while($playerarray = mysqli_fetch_array( $player2 )) {
$playerSteamid2 = $playerarray['steamid'];
$playerNickname2 = $playerarray['nickname'];
$playerPlaytime2 = $playerarray['playtime'];
$playerRoundsplayed2 = $playerarray['roundsplayed'];
$playerInnocenttimes2 = $playerarray['innocenttimes'];
$playerDetectivetimes2 = $playerarray['detectivetimes'];
$playerTraitortimes2 = $playerarray['traitortimes'];
$playerDeaths2 = $playerarray['deaths'];
$playerKills2 = $playerarray['kills'];
$playerHeadshots2 = $playerarray['headshots'];
$playerPoints2 = $playerarray['points'];
$playerMaxfrags2 = $playerarray['maxfrags'];
$playerFirstjoined2 = $playerarray['first_joined'];
$playerLastSeen2 = $playerarray['last_seen'];
if ($sb_enabled == true){
$sb_search_string2 = $sb_search_build . $playerSteamid2 . "&Submit=";
}
if ($playerKills2 and $playerDeaths2 != 0){
$playerKDRTrun2 = $playerKills2 / $playerDeaths2;
$playerKDR2 = round($playerKDRTrun2, 2); //rounding to numbers such as 0.12 rather then 0.1259848797 etc. We don't need that many decimal points in our output, no one cares for that level of accuracy.
}
else {
$playerKDR2 = "N/A";
}
$seconds2 = $playerPlaytime2;
//start of math for hourse, minues and seconds
$hours2 = floor($seconds2 / (60 * 60));
// extract minutes
$divisor_for_minutes2 = $seconds2 % (60 * 60);
$minutes2 = floor($divisor_for_minutes2 / 60);
// extract the remaining seconds
$divisor_for_seconds2 = $divisor_for_minutes2 % 60;
$seconds2 = ceil($divisor_for_seconds2);
if ($sb_enabled == true){
$banned2 = mysqli_query($connect, "SELECT * FROM sb_bans WHERE authid = '$playerSteamid2'");
$bannedTotal2 = mysqli_num_rows($banned2);
}
echo "";
echo "" . $playerSteamid2 . " ";
echo "" . $playerNickname2 . " ";
echo " H:" . $hours2 . " M:" . $minutes2 . " S:" . $seconds2 . " ";
echo "" . $playerRoundsplayed2 . " ";
echo "" . $playerInnocenttimes2 . " ";
echo "" . $playerDetectivetimes2 . " ";
echo "" . $playerTraitortimes2 . " ";
echo "" . $playerDeaths2 . " ";
echo "" . $playerKills2 . " ";
echo "" . $playerKDR2 . " ";
echo "" . $playerHeadshots2 . " ";
echo "" . $playerPoints2 . " ";
echo "" . $playerMaxfrags2 . " ";
echo "" . $playerFirstjoined2 . " ";
echo "" . $playerLastSeen2 . " ";
if ($sb_enabled == true){
echo " " . $bannedTotal2 . " ";
}
echo " ";
}
}
echo "
";
//end of player 2 start and get data
if (isset($player) && isset($player2)){
$multiResult = mysqli_num_rows($player);
$multiResult2 = mysqli_num_rows($player2);
}
if ($multiResult == 0 && isset($inputPlayer) || $multiResult2 == 0 && isset($inputPlayer2)){
echo "
One of more users doesn't exist, please try again.
";
}
?>
include("./includes/footer.php");
?>