Page 1 of 1

Display more information

Posted: Sat Aug 18, 2012 5:38 pm
by Fuzzynuts
Hi,

I have this PHP that displays server status -
<html>
<head>
	<style>
		body{
			width: 255px;
			height: 45px;
		}
	</style>
</head>
<body>
<?php
/*
#####################################
# PlayerCraft - Server status check #
#####################################
*/

//Change this settings to your servers
$server = array(
	"ip" => "109.70.149.244",
	"port" => "25565",
);

     //This is what does the checking, don't care about this code.
     $check = @fsockopen($server['ip'], $server['port'], $errno, $errstr, 2.5);
     if (!$check) {
     	//Server was offline :(
          echo '<h2 style="color: #ff0000; text-align: center; font-family: arial; font-weight: bold;">OFFLINE</h2>';
        } else{
        //Server was online :)
        	echo '<h2 style="color: #008000; text-align: center; font-family: arial; font-weight: bold;">ONLINE</h2>';

        } 
        
        
        
?>
</body>
</html>
I also have the PHP taken from this websites tutorials, however I was wondering if someone could tell me what i would need to add to the above, to display the player counter?

Re: Display more information

Posted: Sat Aug 18, 2012 5:53 pm
by Temor
I believe you need to use Minequery or something similar if I'm not mistaken.
Jacek has a series on Minequery which shows how to fetch the player list.

http://betterphp.co.uk/video.html?vid=aDRMCsAF8OM

Re: Display more information

Posted: Sat Aug 18, 2012 6:01 pm
by Fuzzynuts
Temor wrote:I believe you need to use Minequery or something similar if I'm not mistaken.
Jacek has a series on Minequery which shows how to fetch the player list.

http://betterphp.co.uk/video.html?vid=aDRMCsAF8OM
Thanks, for that.

He also has a tutorial where he writes his own php that pulls the information, was just wondering if anyone could tell me how to get the information I needed :/

Re: Display more information

Posted: Sat Aug 18, 2012 6:37 pm
by Temor
I have no idea how to do this without Minequery. Sorry.

I'll leave this to someone more qualified.

Re: Display more information

Posted: Mon Aug 20, 2012 6:04 pm
by jacek
You can get a bit more information http://betterphp.co.uk/video.html?vid=CSSVBBZ8rrE but it's pretty limited.