forked from nineteeneleven/SteamFunctions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
113 lines (91 loc) · 2.82 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<html>
<header>
<title>Steam ID Finder by NineteenEleven</title>
<style type="text/css">
*{
list-style: none;
}
.PlayerHeader{
margin-top: 40px;
}
.PlayerName{
text-decoration: none;
font-size: 30px;
color: #333;
margin-left: 10px;
margin-right: 40px;
vertical-align: top;
}
.PlayerAvatar{
border: 1px solid #333;
border-radius: 10px;
vertical-align: top;
display: inline-block;
position: relative;
margin-top: -20px;
}
.GamesPlayed{
margin-top: 30px;
padding: 20px;
}
.GamesPlayed li{
display: inline-block;
margin-right: 15px;
position: relative;
font-size: 14px;
}
</style>
</header>
<form id="SteamIDFinder" method="POST" action="index.php">
<input name="SteamID" type="text" id="SteamID" style="width:400;"></td>
<input type="submit" name="SteamIDFinder" value="FIND EM!" form='SteamIDFinder' />
<br />
<?php
include_once 'includes/class_lib.php';
if (isset($_POST['SteamID'])) {
$SteamID = $_POST['SteamID'];
$SteamQuery = new SteamQuery;
$SteamIDConvert = new SteamIDConvert;
$SteamArray = $SteamIDConvert->SteamIDCheck($SteamID);
if (empty($SteamArray)) {
exit("<h1>No Such User Found</h1>");
}
$Query = $SteamQuery->GetPlayerSummaries($SteamArray['steamID64']);
echo "Steam ID: " . $SteamArray['steamid'] . "<br />";
echo "Steam ID 64: " . $SteamArray['steamID64'] . "<br />";
echo "Steam Link: " . $SteamArray['steam_link'] . "<br />";
foreach ($Query->response->players as $player) {
echo "<li>";
echo "<div class='PlayerHeader'>";
if(!empty($player->gameid)){
echo "<a href='". $player->profileurl . "' target='_blank'><img src='" . $player->avatarmedium . "' class=PlayerAvatar style='border: 5px solid #8bc53f;'/></a>";
}else{
echo "<a href='". $player->profileurl . "' target='_blank'><img src='" . $player->avatarmedium . "' class=PlayerAvatar style='border: 5px solid #62a7e3;'/></a>";
}
echo "<a href='". $player->profileurl . "' target='_blank' class='PlayerName'>". $player->personaname . "</a>";
echo "<a href='steam://friends/add/". $player->steamid . "' style='font-size:8px;'> Add to Friends</a>";
echo "</div>";
echo "<br />";
$recentGames = @$SteamQuery->GetRecentlyPlayedGames($player->steamid);
if ($recentGames->response->total_count > 0) {
echo "<ul class='GamesPlayed'>";
foreach ($recentGames->response->games as $games) {
echo "<li>";
echo "<img src='http://media.steampowered.com/steamcommunity/public/images/apps/". $games->appid . "/" . $games->img_icon_url .".jpg' />";
echo " ";
echo $games->name;
echo "<br />";
echo convertToHoursMins($games->playtime_2weeks,'%d hours %d minutes') . " played in the last 2 weeks.";
echo "<br />";
echo convertToHoursMins($games->playtime_forever,'%d hours %d minutes'). " played total.";
echo "</li>";
}
echo "</ul>";
}else{
echo "<br />No Recently played games";
}
echo "<hr />";
echo "</li>";
}
}
?>