-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
123 lines (104 loc) · 4.87 KB
/
Copy pathindex.php
File metadata and controls
123 lines (104 loc) · 4.87 KB
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
114
115
116
117
118
119
120
121
122
123
<?php
/*
Author : LoveHoly
*/
class SteamProfile
{
public $Image;
public $GetCustomURL;
public $GetImage;
public $GetProfile;
public $FileImage;
public $AvatarImage;
// init class
public function __construct()
{
$this->GetCustomURL = urlencode($_GET['id']);
if(!$this->GetCustomURL) $this->GetCustomURL = "LoveHoly";
switch($_GET['image'])
{
case 0:
$this->GetImage="base";
break;
case 1:
$this->GetImage="base";
break;
default:
$this->GetImage="base";
break;
}
$this->GetProfile = simplexml_load_string(file_get_contents("http://steamcommunity.com/id/".$this->GetCustomURL."/?xml=1"));
$this->FileImage = ImageCreateFromPNG("images/".$this->GetImage.".png");
$this->AvatarImage = ImageCreateFromJPEG($this->GetProfile->avatarMedium);
$ColorGrayBorder = imagecolorallocate($this->FileImage, 0, 0, 0);
$ColorGray = imagecolorallocate($this->FileImage, 255, 255, 255);
$ColorOnline = imagecolorallocate($this->FileImage, 128, 181, 223);
$ColorInGame = imagecolorallocate($this->FileImage, 167, 212, 105);
$ColorpOnline = imagecolorallocate($this->FileImage, 255-128, 255-181, 255-223);
$ColorpInGame = imagecolorallocate($this->FileImage, 255-167, 255-212, 255-105);
@imagecopymerge($this->FileImage, $this->AvatarImage, 10, 10, 0, 0, 64, 64, 100);
$this->ImageTTFStrokeText($this->FileImage, 12, 0, 84, 24, $ColorGray,$ColorGrayBorder, "NanumGothic.ttf", $this->GetProfile->realname,1);
if($this->GetProfile->onlineState == "in-game")
{
$ColorStatus = $ColorInGame; $ColorpStatus = $ColorpInGame; $TextStatus = "게임 중";
}
elseif($this->GetProfile->onlineState == "online")
{
$ColorStatus = $ColorOnline; $ColorpStatus = $ColorpOnline; $TextStatus = "온라인";
}
elseif($this->GetProfile->onlineState == "offline")
{
$ColorStatus = $ColorGray;$ColorpStatus = $ColorGrayBorder; $TextStatus = "오프라인";
}
else
{
$ColorStatus = $ColorOnline; $ColorpStatus = $ColorpOnline; $TextStatus = $GetProfile->stateMessage;
}
$this->ImageTTFStrokeText($this->FileImage, 9, 0, 84, 44, $ColorStatus,$ColorpStatus, "NanumGothic.ttf", $TextStatus,1);
$this->ImageTTFStrokeText($this->FileImage, 9, 0, 84, 62, $ColorGray,$ColorGrayBorder, "NanumGothic.ttf", $this->GetProfile->location,1);
$this->ImageTTFStrokeText($this->FileImage, 8, 0, 14, 102, $ColorGray,$ColorGrayBorder, "NanumGothic.ttf", "많이 플레이한 게임",1);
$this->ImageTTFStrokeText($this->FileImage, 8, 0, 244, 102, $ColorGray,$ColorGrayBorder, "NanumGothic.ttf", "자주 하는 게임",1);
$TmpImage = @ImageCreateFromJPEG($this->GetProfile->mostPlayedGames->mostPlayedGame[0]->gameIcon);
@imagecopymerge($this->FileImage, $TmpImage, 14, 112, 0, 0, 32, 32, 100);
@ImageDestroy($TmpImage);
$this->ImageTTFStrokeText($this->FileImage, 8, 0, 54, 122, $ColorGray,$ColorGrayBorder, "NanumGothic.ttf", $this->GetProfile->mostPlayedGames->mostPlayedGame[0]->gameName,1);
///@imagettftext($FileImage, 8, 0, 254, 40, $ColorGray, "NanumGothic.ttf", $GetProfile->mostPlayedGames->mostPlayedGame[0]->gameName);
$this->ImageTTFStrokeText($this->FileImage, 8, 0, 54, 140, $ColorGray, $ColorGrayBorder, "NanumGothic.ttf", "총 ".$this->GetProfile->mostPlayedGames->mostPlayedGame[0]->hoursOnRecord."시간 플레이",1);
if($this->GetProfile->mostPlayedGames->mostPlayedGame[1]->gameIcon)
{
$TmpImage = @ImageCreateFromJPEG($this->GetProfile->mostPlayedGames->mostPlayedGame[1]->gameIcon);
@imagecopymerge($this->FileImage, $TmpImage, 244, 112, 0, 0, 32, 32, 100);
@ImageDestroy($TmpImage);
}
if($this->GetProfile->mostPlayedGames->mostPlayedGame[2]->gameIcon)
{
$TmpImage = @ImageCreateFromJPEG($this->GetProfile->mostPlayedGames->mostPlayedGame[2]->gameIcon);
@imagecopymerge($this->FileImage, $TmpImage, 284, 112, 0, 0, 32, 32, 100);
@ImageDestroy($TmpImage);
}
if($this->GetProfile->mostPlayedGames->mostPlayedGame[3]->gameIcon)
{
$TmpImage = @ImageCreateFromJPEG($this->GetProfile->mostPlayedGames->mostPlayedGame[3]->gameIcon);
@imagecopymerge($this->FileImage, $TmpImage, 324, 112, 0, 0, 32, 32, 100);
@ImageDestroy($TmpImage);
}
}
public function __destruct(){
imagePng($this->FileImage);
ImageDestroy($this->AvatarImage);
ImageDestroy($this->FileImage);
}
function ImageTTFStrokeText(&$image, $size, $angle, $x, $y, &$textcolor, &$strokecolor, $fontfile, $text, $px) {
$AbsCache = abs($px);
for($c1 = ($x-$AbsCache); $c1 <= ($x+$AbsCache); $c1++)
for($c2 = ($y-$AbsCache); $c2 <= ($y+$AbsCache); $c2++)
$bg = imagettftext($image, $size, $angle, $c1, $c2, $strokecolor, $fontfile, $text);
return imagettftext($image, $size, $angle, $x, $y, $textcolor, $fontfile, $text);
}
function ImageColorAllocatieReverse($a,$b,$c,$d)
{
return imagecolorallocate($a, 255-$b, 255-$c, 255-$d);
}
}
Header("Content-Type: image/png");
$SP = new SteamProfile();