Added API hide/show javascript as test

This commit is contained in:
alopexc0de 2012-09-29 04:18:44 -04:00
parent 0e440851c3
commit 537cae0d53

View File

@ -1,23 +1,53 @@
<title>UnPS MC Checker</title>
<script language="javascript" type="text/javascript">
function showHide(shID) {
if (document.getElementById(shID)) {
if (document.getElementById(shID+'-show').style.display != 'none') {
document.getElementById(shID+'-show').style.display = 'none';
document.getElementById(shID).style.display = 'block';
}
else {
document.getElementById(shID+'-show').style.display = 'inline';
document.getElementById(shID).style.display = 'none';
}
}
}
</script>
<style type="text/css">
.api {
display: none;
border-top: 1px solid #666;
border-bottom: 1px solid #666; }
a.showApi, a.hideApi {
text-decoration: none;
color: #36f;
padding-left: 8px; }
a.showApi:hover, a.hideApi:hover {
border-bottom: 1px dotted #36f; }
</style>
<body background="https://si0.twimg.com/profile_background_images/468495900/bg.gif" text="white">
<div align="center">
<img src="http://unps-gama.tk/upload/Pictures/header.png"><br>
<a href="#" id="api-show" class="showApi" onclick="showHide('api');return false;">API Here</a>
<div id="api" class="api">
<table align="center">
<tr><td>If you want to parse this information for yourself, just give the script an $ip and $port (default assumed)</td></tr>
<tr><td>then pull an arraylist for $srvinfo from 0-2 to get motd, players online, and max players. </td></tr>
<tr><td>Server and port are just echoed $ip and $port. To check online status, use testserver.php. </td></tr>
<tr><td>Call testserver.php and use the GetServerStatus($ip, $port); function - echo that and done :3</td></tr>
<tr><td>Example: (remove spaces in color) <pre>
<tr><td>Example: (remove spaces in color) <code><pre>
include('http://unps-gama.tk/mcping.php?ip=$ip&port=$port')
echo "Server:<font colo r='red'> " . $ip . "</font> on port:<font colo r='yellow'> " . $port . " </font> is: ";
echo "Server:&#60font color='red'> " . $ip . "&#60/font> on port:&#60font color='yellow'> " . $port . " &#60/font> is: ";
include('http://unps-gama.tk/testserver.php');
$status = GetServerStatus($ip, $port);
if ($status=="ONLINE") echo "<font colo r='green'>" . $status . "</font>\n";
if ($status=="OFFLINE") echo "<font colo r='red'>" . $status . "</font>\n";
if ($status=="ONLINE") echo "&#60font color='green'>" . $status . "&#60/font>\n";
if ($status=="OFFLINE") echo "&#60font color='red'>" . $status . "&#60/font>\n";
echo "motd: " . $srvinfo[0] . "\n";
echo "players online: " . $srvinfo[1] . "\n";
echo "max players: " . $srvinfo[2] . "\n";</pre></td></tr>
</table><br><hr><br><table align="center">
echo "max players: " . $srvinfo[2] . "\n";</pre></code></td></tr>
</table>
<a href="#" id="api-hide" class="hideApi" onclick="showHide('api');return false;">Close API</a>
</div><br><table align="center">
<?php
$ip = $_GET["ip"];
$port = $_GET["port"];