-
Notifications
You must be signed in to change notification settings - Fork 4
/
psn.php
46 lines (41 loc) · 1.38 KB
/
psn.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
<?php
require_once 'libs/gamer/import.php';
require_once 'libs/psn/import.php';
$psnId = $_GET['psnId'];
if (empty($psnId))
{
die('Please type your psnId in url: psn.php?psnId=guicamillo');
}
$psnUser = new PSNUser($psnId);
$profileData = $psnUser->getPSNID();
$gamesList = $psnUser->getGames();
?>
<h4><?php echo $profileData['id']; ?></h4>
<img src="<?php echo $profileData['avatarSmall']; ?>" />
<br />
Level <?php echo $profileData['level']; ?><?php if ($profileData['aboutme']): ?>
<br />
Status <?php echo $profileData['status']['online'] ? 'Online' : $profileData['status']['away'] ? 'Away' : '' ; ?>
<br />
Bio: <?php echo $profileData['aboutme']; ?>
<?php endif; ?>
<br />
<strong><?php echo $profileData['levelData']['points']; ?></strong>/<?php echo $profileData['levelData']['ceiling']; ?>
<br />
<br />
<h4>Trophies</h4>
<?php foreach ($profileData['trophies'] as $trophieKey => $trophieValue): ?>
<?php echo ucfirst($trophieKey); ?> <?php echo $trophieValue; ?><br />
<?php endforeach; ?>
<br />
<h4>Games List</h4>
<?php foreach ($gamesList['games'] as $game): ?>
<img src="<?php echo $game['image']; ?>" />
<br />
<?php echo $game['title']; ?>
<br />
Points <strong><?php echo $game['userPoints']; ?></strong>/<?php echo $game['totalPoints']; ?>
<br />
Tropies <strong><?php echo $game['trophiesCount']['total']; ?></strong>/<?php echo $game['totalTrophies']; ?>
<br />
<?php endforeach; ?>