query(" SELECT hlstats_Events_Frags.weapon, hlstats_Weapons.name, COUNT(hlstats_Events_Frags.weapon) AS kills, SUM(hlstats_Events_Frags.headshot=1) as headshots FROM hlstats_Events_Frags LEFT JOIN hlstats_Weapons ON hlstats_Weapons.code = hlstats_Events_Frags.weapon WHERE hlstats_Events_Frags.killerId=$player GROUP BY hlstats_Events_Frags.weapon ORDER BY kills desc, headshots desc LIMIT 1 "); while ($rowdata = $db->fetch_row($result)) { $fav_weapon = $rowdata[0]; $weap_name = htmlspecialchars($rowdata[1]); } if ($fav_weapon == '') $fav_weapon = 'Unknown'; $image = getImage("/games/$game/weapons/$fav_weapon"); // Check if image exists $weaponlink = ""; if ($image) { $cellbody = "\t\t\t\t\t
Player Profile

query (" SELECT hlstats_PlayerUniqueIds.uniqueId, CAST(LEFT(hlstats_PlayerUniqueIds.uniqueId,1) AS unsigned) + CAST('76561197960265728' AS unsigned) + CAST(MID(hlstats_PlayerUniqueIds.uniqueId, 3,10)*2 AS unsigned) AS communityId FROM hlstats_PlayerUniqueIds WHERE hlstats_PlayerUniqueIds.playerId = '$player' "); list($uqid, $coid) = $db->fetch_row(); function fetchpage($page) { $domain="steamcommunity.com"; $indata=""; // $data=file_get_contents($page); $fsock=fsockopen($domain, 80, $errno, $errstr,2); if(!$fsock) { echo "Error: $errstr"; } else { $request=sprintf("GET %s HTTP/1.1\r\nHost: %s\r\nConnection: Close\r\n\r\n",$page,$domain); fwrite($fsock, $request); while(!feof($fsock)) { $indata.=fgets($fsock,1024); } fclose($fsock); return $indata; } } $page = "/profiles/$coid?xml=1"; $pagedata=fetchpage($page); if( preg_match('/Location: (.*)/', $pagedata, $location) ) { $page = trim($location[1]) . "?xml=1"; $pagedata = fetchpage($page); } preg_match('/(.*?)<\/onlineState>/', $pagedata, $results); preg_match('/<\/avatarFull>/', $pagedata, $results2); $status = ucwords($results[1]); $avatar_full = $results2[1]; $avimg = getImage("/avatars/$player"); if ($avimg) { $avatar_full = $avimg['url']; } else if ($avatar_full == '' || $playerdata['blockavatar'] == '1') { $avatar_full = IMAGE_PATH."/unknown.jpg"; } if ($status == '') $status = '(Unknown)'; echo("\"Steam"); ?>
 '; echo '' . htmlspecialchars($playerdata['lastName'], ENT_COMPAT) . ' '; ?>
" . $playerdata['country'] . ''; } else { echo 'Location: (Unknown)'; } ?>
$prefix" . "$uqid"; ?>
Status:
Click here to add as friend
Member of Clan: ' . htmlspecialchars($playerdata['clan_name'], ENT_COMPAT) . ''; } else echo '(None)'; ?>
Real Name: ' . htmlspecialchars($playerdata['fullName'], ENT_COMPAT) . ''; } else echo "(Not Specified)'; ?>
E-mail Address: Not Specified)'; ?>
Home Page: Not Specified)'; ?>
Last Connect:* query (" SELECT DATE_FORMAT(eventTime, '%a. %b. %D, %Y @ %T') FROM hlstats_Events_Connects WHERE hlstats_Events_Connects.playerId = '$player' ORDER BY id desc LIMIT 1 "); list($lastevent) = $db->fetch_row(); if ($lastevent) echo $lastevent; else echo '(Unknown)'; ?>
Total Connection Time:
Average Ping:* query (" SELECT ROUND(SUM(hlstats_Events_Latency.ping) / COUNT(hlstats_Events_Latency.ping), 0) AS av_ping, ROUND(ROUND(SUM(hlstats_Events_Latency.ping) / COUNT(ping), 0) / 2, 0) AS av_latency FROM hlstats_Events_Latency WHERE hlstats_Events_Latency.playerId = '$player' "); list($av_ping, $av_latency) = $db->fetch_row(); if ($av_ping) echo $av_ping." ms (Latency: $av_latency ms)"; else echo '-'; ?>
Favorite Server:* query (" SELECT hlstats_Events_Entries.serverId, hlstats_Servers.name, COUNT(hlstats_Events_Entries.serverId) AS cnt FROM hlstats_Events_Entries INNER JOIN hlstats_Servers ON hlstats_Servers.serverId = hlstats_Events_Entries.serverId WHERE hlstats_Events_Entries.playerId = '$player' GROUP BY hlstats_Events_Entries.serverId ORDER BY cnt DESC LIMIT 1 "); list($favServerId, $favServerName) = $db->fetch_row(); echo " $favServerName "; ?>
Favorite Map:* query (" SELECT hlstats_Events_Entries.map, COUNT(map) AS cnt FROM hlstats_Events_Entries WHERE hlstats_Events_Entries.playerId = '$player' GROUP BY hlstats_Events_Entries.map ORDER BY cnt DESC LIMIT 1 "); list($favMap) = $db->fetch_row(); echo " $favMap "; ?>
Favorite Weapon:* $weaponlink\"$weap_name\""; } else { $cellbody = "\t\t\t\t\t $weaponlink$weap_name"; } $cellbody .= ""; echo $cellbody; ?>

Statistics Summary

Activity: 40) $bar_type = "6"; elseif ($playerdata['activity'] > 30) $bar_type = "5"; elseif ($playerdata['activity'] > 20) $bar_type = "4"; elseif ($playerdata['activity'] > 10) $bar_type = "3"; elseif ($playerdata['activity'] > 5) $bar_type = "2"; echo "\"".$playerdata['activity'].'%"'; ?>
Points: ' . number_format($playerdata['skill']) . ''; ?>
Rank: 0) && ($playerdata['hideranking'] == 0)) { $rank = get_player_rank($playerdata); } else { if ($playerdata['hideranking'] == 1) { $rank = "Hidden"; } elseif ($playerdata['hideranking'] == 2) { $rank = "Banned"; } else { $rank = 'Not active'; } } if (is_numeric($rank)) { echo '' . number_format($rank) . ''; } else { echo " $rank"; } ?>
Kills per Minute: 0) { echo sprintf('%.2f', ($playerdata['kills'] / ($playerdata['connection_time'] / 60))); } else { echo '-'; } ?>
Kills per Death: query (" SELECT IFNULL(ROUND(SUM(hlstats_Events_Frags.killerId = '$player') / IF(SUM(hlstats_Events_Frags.victimId = '$player') = 0, 1, SUM(hlstats_Events_Frags.victimId = '$player')), 2), '-') FROM hlstats_Events_Frags WHERE ( hlstats_Events_Frags.killerId = '$player' OR hlstats_Events_Frags.victimId = '$player' ) "); list($realkpd) = $db->fetch_row(); echo $playerdata['kpd']; echo " ($realkpd*)"; ?>
Headshots per Kill: query (" SELECT IFNULL(SUM(hlstats_Events_Frags.headshot=1) / COUNT(*), '-') FROM hlstats_Events_Frags WHERE hlstats_Events_Frags.killerId = '$player' "); list($realhpk) = $db->fetch_row(); echo $playerdata['hpk']; echo " ($realhpk*)"; ?>
Shots per Kill: query (" SELECT IFNULL(ROUND((SUM(hlstats_Events_Statsme.hits) / SUM(hlstats_Events_Statsme.shots) * 100), 2), 0.0) AS accuracy, SUM(hlstats_Events_Statsme.shots) AS shots, SUM(hlstats_Events_Statsme.hits) AS hits, SUM(hlstats_Events_Statsme.kills) AS kills FROM hlstats_Events_Statsme WHERE hlstats_Events_Statsme.playerId='$player' "); list($playerdata['accuracy'], $sm_shots, $sm_hits, $sm_kills) = $db->fetch_row(); if ($sm_kills > 0) { echo sprintf('%.2f', ($sm_shots / $sm_kills)); } else { echo '-'; } ?>
Weapon Accuracy:
Headshots:
Kills:
Deaths:
Longest Kill Streak: query (" SELECT hlstats_Players.kill_streak FROM hlstats_Players WHERE hlstats_Players.playerId = '$player' "); list($kill_streak) = $db->fetch_row(); echo number_format($kill_streak); ?>
Longest Death Streak: query (" SELECT hlstats_Players.death_streak FROM hlstats_Players WHERE hlstats_Players.playerId = '$player' "); list($death_streak) = $db->fetch_row(); echo number_format($death_streak); ?>
Suicides:
Teammate Kills:

 ' . htmlspecialchars($playerdata['lastName'], ENT_COMPAT) . '\'s History:
'; echo '  
Events | "; echo 'Sessions | "; $resultCount = $db->query (" SELECT COUNT(*) FROM hlstats_Players_Awards WHERE hlstats_Players_Awards.playerId = $player "); list($numawards) = $db->fetch_row($resultCount); echo "Awards ($numawards) | "; if ($g_options["nav_globalchat"] == 1) { echo "Chat"; } ?>
  Search Find other players with the same name


Player Trend
"; ?>
Forum Signature


"; $script_path = (isset($_SERVER['SSL']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on")) ? 'https://' : 'http://'; $script_path .= $_SERVER['HTTP_HOST']; $script_path .= str_replace('\\','/',dirname($_SERVER['PHP_SELF'])); $script_path = preg_replace('/\/$/','',$script_path); ?>

bbCode 1 (phpBB, SMF) | bbCode 2 (IPB) | Direct Image [url='."$script_path/hlstats.php?mode=playerinfo&player=$player"."][img]$imglink".'[/img][/url]'; ?>


query (" SELECT hlstats_Ranks.rankName, hlstats_Ranks.image, hlstats_Ranks.minKills FROM hlstats_Ranks WHERE hlstats_Ranks.minKills <= ".$playerdata['kills']." AND hlstats_Ranks.game = '$game' ORDER BY hlstats_Ranks.minKills DESC LIMIT 1 "); $result = $db->fetch_array(); $rankimage = getImage('/ranks/'.$result['image']); $rankName = $result['rankName']; $rankCurMinKills = $result['minKills']; $db->query (" SELECT hlstats_Ranks.rankName, hlstats_Ranks.minKills FROM hlstats_Ranks WHERE hlstats_Ranks.minKills > ".$playerdata['kills']." AND hlstats_Ranks.game = '$game' ORDER BY hlstats_Ranks.minKills LIMIT 1 "); if ($db->num_rows() == 0) { $rankKillsNeeded = 0; $rankPercent = 0; } else { $result = $db->fetch_array(); $rankKillsNeeded = $result['minKills'] - $playerdata['kills']; $rankPercent = ($playerdata['kills'] - $rankCurMinKills) * 100 / ($result['minKills'] - $rankCurMinKills); } $db->query (" SELECT hlstats_Ranks.rankName, hlstats_Ranks.image FROM hlstats_Ranks WHERE hlstats_Ranks.minKills <= ".$playerdata['kills']." AND hlstats_Ranks.game = '$game' ORDER BY hlstats_Ranks.minKills "); for ($i=1;$i<($db->num_rows());$i++) { $result = $db->fetch_array(); $histimage = getImage('/ranks/'.$result['image'].'_small'); $rankHistory .= ''.$result['rankName'].' '; } ?>
Current rank:
"; ?>
100) $cellbody .= '100%'; else $cellbody .= sprintf('%d%%', $rankPercent + 0.5); $cellbody .= "\" style=\"height:10px;border:0;\" alt=\"$rankPercent%\" />"; echo $cellbody; ?> Kills needed: %)
Rank history


query (" SELECT hlstats_Ribbons.awardCode, hlstats_Ribbons.image FROM hlstats_Ribbons WHERE hlstats_Ribbons.game = '$game' AND ( hlstats_Ribbons.special = 0 OR hlstats_Ribbons.special = 2 ) GROUP BY hlstats_Ribbons.awardCode "); $res = $db->query (" SELECT hlstats_Ribbons.awardCode AS ribbonCode, hlstats_Ribbons.ribbonName AS ribbonName, IF(ISNULL(hlstats_Players_Ribbons.playerId), 'noaward.png', hlstats_Ribbons.image) AS image, hlstats_Ribbons.special, hlstats_Ribbons.image AS imagefile, hlstats_Ribbons.awardCount FROM hlstats_Ribbons LEFT JOIN ( SELECT hlstats_Players_Ribbons.playerId, hlstats_Ribbons.awardCode, hlstats_Players_Ribbons.ribbonId FROM hlstats_Players_Ribbons INNER JOIN hlstats_Ribbons ON hlstats_Ribbons.ribbonId = hlstats_Players_Ribbons.ribbonId AND hlstats_Ribbons.game = hlstats_Players_Ribbons.game WHERE hlstats_Players_Ribbons.playerId = ".$playerdata['playerId']." AND hlstats_Players_Ribbons.game = '$game' ORDER BY hlstats_Ribbons.awardCount DESC ) AS hlstats_Players_Ribbons ON hlstats_Players_Ribbons.ribbonId = hlstats_Ribbons.ribbonId WHERE hlstats_Ribbons.game = '$game' AND ( ISNULL(hlstats_Players_Ribbons.playerId) OR hlstats_Players_Ribbons.playerId = ".$playerdata['playerId']." ) ORDER BY hlstats_Ribbons.awardCode, hlstats_Players_Ribbons.playerId DESC, hlstats_Ribbons.special, hlstats_Ribbons.awardCount DESC "); $ribbonList = ''; $lastImage = ''; $awards_done = array (); while ($result = $db->fetch_array($res)) { $ribbonCode=$result['ribbonCode']; $ribbonName=$result['ribbonName']; if(!isset($awards_done[$ribbonCode])) { if (file_exists(IMAGE_PATH."/games/$game/ribbons/".$result['image'])) { $image = IMAGE_PATH."/games/$game/ribbons/".$result['image']; } elseif (file_exists(IMAGE_PATH."/games/$realgame/ribbons/".$result['image'])) { $image = IMAGE_PATH."/games/$realgame/ribbons/".$result['image']; } else { $image = IMAGE_PATH."/award.png"; } $ribbonList .= ''.$result['ribbonName'].' '; $awards_done[$ribbonCode]=$ribbonCode; } } $awards = array (); $res = $db->query (" SELECT hlstats_Awards.awardType, hlstats_Awards.code, hlstats_Awards.name FROM hlstats_Awards WHERE hlstats_Awards.game = '$game' AND hlstats_Awards.g_winner_id = $player ORDER BY hlstats_Awards.name; "); while ($r1=$db->fetch_array()) { unset($tmp); $tmp->aType = $r1['awardType']; $tmp->code = $r1['code']; $tmp->ribbonName = $r1['name']; if ($id == 0) { $tmp->playerName = $r1['lastname']; $tmp->flag = $r1['flag']; $tmp->playerId = $r1['g_winner_id']; $tmp->kills = $r1['g_winner_count']; $tmp->verb = $r1['verb']; } array_push($awards,$tmp); } $GlobalAwardsList = ''; foreach ($awards as $a) { if ($image = getImage("/games/$game/gawards/".strtolower($a->aType."_$a->code"))) { $image = $image['url']; } elseif ($image = getImage("/games/$realgame/gawards/".strtolower($a->aType."_$a->code"))) { $image = $image['url']; } else { $image = IMAGE_PATH."/award.png"; } $GlobalAwardsList .= "\"$a-ribbonName\" title=\"$a->ribbonName\" /> "; } if ($ribbonList != '' || $GlobalAwardsList != '') { ?>
Ribbons
Global Awards