-
Notifications
You must be signed in to change notification settings - Fork 1
/
nplanet.php
118 lines (106 loc) · 3.15 KB
/
nplanet.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
114
115
116
117
118
<!--
# Online NFK planet scanner unit for pff.clan.su
# by boobl, bitnik, coolant
# Updated: 04.01.2010
# <a title="Ïîäêëþ÷èòüñÿ" href="nfk://'.$server["IP"].'"></a>
-->
<html>
<head>
<title>NFK Planet Scanner</title>
<meta charset="utf-8">
<link type="text/css" rel="StyleSheet" href="http://needforkill.ru/_st/my.css" />
<style>
body {background: #ebebeb;}
.eBlock1 {font-size:13px;font-family:Tahoma,Geneva,sans-serif;color:#3a3a3a;background: #ebebeb;}
</style>
<?php /*
<style>
BODY,td,th {
font: 11px Verdana, Arial, Helvetica, sans-serif;
SCROLLBAR-FACE-COLOR:#7284A0;
SCROLLBAR-SHADOW-COLOR:#E8EAED;
SCROLLBAR-HIGHLIGHT-COLOR:#7284A0;
SCROLLBAR-3DLIGHT-COLOR:#E8EAED;
SCROLLBAR-DARKSHADOW-COLOR:#7284A0;
SCROLLBAR-TRACK-COLOR:#B7C0CF;
SCROLLBAR-ARROW-COLOR:#E8EAED;
}
</style>
<BODY BGCOLOR="#E8EAED"
TEXT="#354D73"
LINK="#354D73"
VLINK="#354D73"
ALINK="#354D73"
>
*/
?>
</head>
<BODY>
<?php
require_once("inc/config.inc.php");
require_once("inc/functions.inc.php");
require_once("mods/inc/nfk_planet.inc.php");
function cmpServers($a, $b)
{
if ($a['Players'] == $b['Players']) {
return 0;
}
return ($a['Players'] > $b['Players']) ? -1 : 1;
}
$html = "";
$servers = nfkpl_getServers();
$playersCount = 0;
if (count($servers) == 0)
{
$html .= 'Ïëàíåòà âðåìåííî ïóñòà';
}
else
{
usort($servers, "cmpServers");
$html .= '<table class="eBlock1">'
.'<tr><td width="190"><b>Host</b></td>'
.'<td width="130"><b>Map</b></td>'
.'<td width="120"><b>Type</b></td>'
.'<td width="120"><b>Players</b></td>'
.'<td width="120"><b>IP</b></td></tr>';
foreach ($servers as $key => $server)
{
//preg_replace('/\W/', '', $a);
$hostlink = stripColor($server['Hostname']);
$hostlinkx = $hostlink;
$hostlink = str_replace("#", "%23", $hostlink);
//$link = ((substr($server["Hostname"], 0, 3) == "Rip") or (substr($server["Hostname"], 0, 9) == "[twuo.ru]")) ? ('<a target="_blank" href="/server/'.$hostlink.'">'.$hostlinkx.'</a>'):($hostlinkx);
$link = '<a target="_blank" href="/server/'.$hostlink.'">'.$hostlinkx.'</a>';
$html .= <<<HTML
<tr>
<td>$link</td>
<td>$server[Map]</td>
<td>$server[Gametype]</td>
<td>$server[Players]/$server[Maxplayers]</td>
<td><a href="nfk://$server[IP]:$server[Port]">$server[IP]:$server[Port]</a></td>
</tr>
HTML;
$playersCount += $server["Players"];
}
}
$html .= '</table>';
//print "<b>NFK Planet - ".count($servers)." servers / ".$playersCount." players</b>";
print $html;
// ===============
$Data2 = "+ VISITOR - IP: ".$_SERVER['REMOTE_ADDR']."";
$Data4 = " - DATE: ".date("d.m.y")."";
$Data5 = " - TIME: ".date("H:i:s")."\n";
$File = "nplanet.txt";
//$Handle = fopen($File, 'a');
//fwrite($Handle, $Data2);
//fwrite($Handle, $Data4);
//fwrite($Handle, $Data5);
//fclose($Handle);
//===============
//$maplist = file("maplist.txt");
//foreach($maplist as $key => $row)
// if (substr($row, 0, 2) == '//') unset($maplist[$key]);
//$Vars['MAPLIST'] = implode('<br />', $maplist);
?>
</body>
</html>