1
Pingr - Simplifying xPaw, One letter at a time.
Hello PMC,
When I didn't know much about xPaw's Minecraft pinger... i failed to find a lot of support on it.
Now, I want to help anyone who is seeing this thread.
I know that xPaw's Minecraft Pinger isnt that easy... so i created Pingr to simplify it a little bit.
Pinger consists of 2 files:
pingr.php
xpaw.php
Download:
http://tentencraft.net/pingr/pingr.zip
Demo:
http://tentencraft.net/pingr/view.php
Wanna try the demo on your server? navigate to http://tentencraft.net/pingr/view.php?i ... er.ip.here
Now, to call this function in PHP... would be something like this:
PHP:
<?php
include_once 'pingr.php';
$status = Pingr::getStats('play.tentencraft.net');
?>
It also supports ports...
PHP:
<?php
include_once 'pingr.php';
$status = Pingr::getStats('play.tentencraft.net:25565');
?>
Now to the basics... How to use it:
Variables:
$status['version'] Is the minecraft version number of the server.
$status['players'] Is the players that are currently online.
$status['maxplayers'] Is the max player count.
$status['favicon'] Is the favicon, it can be used in the SRC tag of an image.
$status['motd'] Is the MOTD, fixed up for display purposes.
$status['motd_raw'] Is the raw MOTD, including all special characters.
$status['ping'] Is the time in milliseconds that the server info was retrieved in.
$status['pnames'] Is the players online. This does not work for all servers.
$status['online'] Returns true if online or false if offline
Example Code:
PHP:
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<div class="container">
<?php
include_once 'pingr.php';
$status = Pingr::getStats('endcraft.net');
if($status['online'] == true) {
echo "<br>"; echo "<hr>";
echo "The server is running on minecraft version ".$status['version'].".";
echo "<br>"; echo "<hr>";
echo "Players Online:";
echo "<br>";
echo $status['players']." out of ".$status['maxplayers'];
echo "<br>"; echo "<hr>";
echo "Favicon: ";
echo '<img src="'.$status['favicon'].'"></img>';
echo "<br>"; echo "<hr>";
echo "Motd:";
echo "<br>";
echo $status['motd'];
When I didn't know much about xPaw's Minecraft pinger... i failed to find a lot of support on it.
Now, I want to help anyone who is seeing this thread.
I know that xPaw's Minecraft Pinger isnt that easy... so i created Pingr to simplify it a little bit.
Pinger consists of 2 files:
pingr.php
xpaw.php
Download:
http://tentencraft.net/pingr/pingr.zip
Demo:
http://tentencraft.net/pingr/view.php
Wanna try the demo on your server? navigate to http://tentencraft.net/pingr/view.php?i ... er.ip.here
Now, to call this function in PHP... would be something like this:
PHP:
<?php
include_once 'pingr.php';
$status = Pingr::getStats('play.tentencraft.net');
?>
It also supports ports...
PHP:
<?php
include_once 'pingr.php';
$status = Pingr::getStats('play.tentencraft.net:25565');
?>
Now to the basics... How to use it:
Variables:
$status['version'] Is the minecraft version number of the server.
$status['players'] Is the players that are currently online.
$status['maxplayers'] Is the max player count.
$status['favicon'] Is the favicon, it can be used in the SRC tag of an image.
$status['motd'] Is the MOTD, fixed up for display purposes.
$status['motd_raw'] Is the raw MOTD, including all special characters.
$status['ping'] Is the time in milliseconds that the server info was retrieved in.
$status['pnames'] Is the players online. This does not work for all servers.
$status['online'] Returns true if online or false if offline
Example Code:
PHP:
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<div class="container">
<?php
include_once 'pingr.php';
$status = Pingr::getStats('endcraft.net');
if($status['online'] == true) {
echo "<br>"; echo "<hr>";
echo "The server is running on minecraft version ".$status['version'].".";
echo "<br>"; echo "<hr>";
echo "Players Online:";
echo "<br>";
echo $status['players']." out of ".$status['maxplayers'];
echo "<br>"; echo "<hr>";
echo "Favicon: ";
echo '<img src="'.$status['favicon'].'"></img>';
echo "<br>"; echo "<hr>";
echo "Motd:";
echo "<br>";
echo $status['motd'];
Create an account or sign in to comment.
1
1
ok