forked from tltneon/lgsl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserbar.php
63 lines (52 loc) · 2.68 KB
/
userbar.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
<?php
//------------------------------------------------------------------------------------------------------------+
# Copyright by http://Play-Z.ru, playzone46@yandex.ru
header("Content-type: image/gif");
require "lgsl_files/lgsl_class.php";
//------------------------------------------------------------------------------------------------------------+
$lookup = lgsl_lookup_id($_GET['s']);
$server = lgsl_query_cached($lookup['type'], $lookup['ip'], $lookup['c_port'], $lookup['q_port'], $lookup['s_port'], "sep");
$server = lgsl_sort_players($server);
$server = lgsl_sort_extras($server);
$misc = lgsl_server_misc($server);
$server = lgsl_server_html($server);
$hour = date("H");
$hourpl = 0;
$hour = $hour + $hourpl;
if($hour>=24) {
$hour-24;
}
$time = date("d.m ".$hour.":i");
$im = @imagecreatefromgif("lgsl_files/other/banner_thin.gif");
$on_id = imagecreatefromgif($misc['icon_status']);
list($width, $height) = getimagesize($misc['icon_status']);
if($width > 16){
$image_p = imagecreatetruecolor(16, 16);
$image = imagecreatefromgif($misc['icon_status']);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, 16, 16, $width, $height);
$on_id = $image_p;
}
$game_id = imagecreatefromgif($misc['icon_game']);
list($width, $height) = getimagesize($misc['icon_game']);
if($width > 16){
$image_p = imagecreatetruecolor(16, 16);
$image = imagecreatefromgif($misc['icon_game']);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, 16, 16, $width, $height);
$game_id = $image_p;
}
$color_pz = imagecolorallocate($im, 128, 0, 0);
$color_ip = imagecolorallocate($im, 255, 0, 0);
$color_map = imagecolorallocate($im, 0, 0, 0);
$color_pl = imagecolorallocate($im, 0, 128, 0);
$color_time = imagecolorallocate($im, 66, 66, 66);
imagecopy($im, $on_id, 8, 2, 0, 0, 16, 16);
imagecopy($im, $game_id, 26, 2, 0, 0, 16, 16);
imagettftext($im, 7, 0, 44, 17, $color_map, "lgsl_files/other/verdana.ttf", $lgsl_config['text']['map'].": ".$server['s']['map']);
imagettftext($im, 7, 0, 44, 9, $color_ip, "lgsl_files/other/verdana.ttf", $server['b']['ip'].":".$server['b']['c_port']);
imagettftext($im, 8, 0, 150, 10, $color_pz, "lgsl_files/other/verdana.ttf", $server['s']['name']);
imagettftext($im, 7, 0, 150, 18, $color_pl, "lgsl_files/other/verdana.ttf", $lgsl_config['text']['plr'].": ".$server['s']['players']."/".$server['s']['playersmax']);
imagettftext($im, 5, 0, 238, 18, $color_time, "lgsl_files/other/verdana.ttf", "upd: ".$time." | ".$server['s']['game']);
imagegif($im);
imagedestroy($im);
//------------------------------------------------------------------------------------------------------------+
?>