From 537cae0d535ab2979aaca2cc7af13fcfd1d2e8e9 Mon Sep 17 00:00:00 2001 From: alopexc0de Date: Sat, 29 Sep 2012 04:18:44 -0400 Subject: [PATCH] Added API hide/show javascript as test --- mcping.php | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/mcping.php b/mcping.php index 0309774..5805e74 100755 --- a/mcping.php +++ b/mcping.php @@ -1,23 +1,53 @@ UnPS MC Checker + +

+API Here +
- -
If you want to parse this information for yourself, just give the script an $ip and $port (default assumed)
then pull an arraylist for $srvinfo from 0-2 to get motd, players online, and max players.
Server and port are just echoed $ip and $port. To check online status, use testserver.php.
Call testserver.php and use the GetServerStatus($ip, $port); function - echo that and done :3
Example: (remove spaces in color)
+
Example: (remove spaces in color)
 include('http://unps-gama.tk/mcping.php?ip=$ip&port=$port')
-	echo "Server: " . $ip . " on port: " . $port . "  is: ";
+	echo "Server:<font color='red'> " . $ip . "</font> on port:<font color='yellow'> " . $port . " </font> is: ";
 	include('http://unps-gama.tk/testserver.php');
 		$status = GetServerStatus($ip, $port);
-			if ($status=="ONLINE") echo "" . $status . "\n";
-			if ($status=="OFFLINE") echo "" . $status . "\n";
+			if ($status=="ONLINE") echo "<font color='green'>" . $status . "</font>\n";
+			if ($status=="OFFLINE") echo "<font color='red'>" . $status . "</font>\n";
 		echo "motd: " . $srvinfo[0] . "\n";
 		echo "players online: " . $srvinfo[1] . "\n";
-		echo "max players: " . $srvinfo[2] . "\n";



+ echo "max players: " . $srvinfo[2] . "\n"; +
+Close API +