Display more information

Ask about a PHP problem here.
Post Reply
Fuzzynuts
Posts: 2
Joined: Sat Aug 18, 2012 5:35 pm

Display more information

Post by Fuzzynuts »

Hi,

I have this PHP that displays server status -

[syntax=php]<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>[/syntax]

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?
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Display more information

Post 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
Fuzzynuts
Posts: 2
Joined: Sat Aug 18, 2012 5:35 pm

Re: Display more information

Post 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 :/
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Display more information

Post by Temor »

I have no idea how to do this without Minequery. Sorry.

I'll leave this to someone more qualified.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Display more information

Post by jacek »

You can get a bit more information http://betterphp.co.uk/video.html?vid=CSSVBBZ8rrE but it's pretty limited.
Image
Post Reply