mirror of
https://github.com/c0de-archive/GAMA-Site.git
synced 2024-12-22 17:42:40 +00:00
Added API hide/show javascript as test
This commit is contained in:
parent
0e440851c3
commit
537cae0d53
42
mcping.php
42
mcping.php
@ -1,23 +1,53 @@
|
|||||||
<title>UnPS MC Checker</title>
|
<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">
|
<body background="https://si0.twimg.com/profile_background_images/468495900/bg.gif" text="white">
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="http://unps-gama.tk/upload/Pictures/header.png"><br>
|
<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">
|
<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>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>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>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>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')
|
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:<font color='red'> " . $ip . "</font> on port:<font color='yellow'> " . $port . " </font> is: ";
|
||||||
include('http://unps-gama.tk/testserver.php');
|
include('http://unps-gama.tk/testserver.php');
|
||||||
$status = GetServerStatus($ip, $port);
|
$status = GetServerStatus($ip, $port);
|
||||||
if ($status=="ONLINE") echo "<font colo r='green'>" . $status . "</font>\n";
|
if ($status=="ONLINE") echo "<font color='green'>" . $status . "</font>\n";
|
||||||
if ($status=="OFFLINE") echo "<font colo r='red'>" . $status . "</font>\n";
|
if ($status=="OFFLINE") echo "<font color='red'>" . $status . "</font>\n";
|
||||||
echo "motd: " . $srvinfo[0] . "\n";
|
echo "motd: " . $srvinfo[0] . "\n";
|
||||||
echo "players online: " . $srvinfo[1] . "\n";
|
echo "players online: " . $srvinfo[1] . "\n";
|
||||||
echo "max players: " . $srvinfo[2] . "\n";</pre></td></tr>
|
echo "max players: " . $srvinfo[2] . "\n";</pre></code></td></tr>
|
||||||
</table><br><hr><br><table align="center">
|
</table>
|
||||||
|
<a href="#" id="api-hide" class="hideApi" onclick="showHide('api');return false;">Close API</a>
|
||||||
|
</div><br><table align="center">
|
||||||
<?php
|
<?php
|
||||||
$ip = $_GET["ip"];
|
$ip = $_GET["ip"];
|
||||||
$port = $_GET["port"];
|
$port = $_GET["port"];
|
||||||
|
Loading…
Reference in New Issue
Block a user