Page 1 of 1

Server status

Posted: 25. April 2011 22:41
by archcry
Hello,

I have been using board3 for a long time now, in combination with some awesome world of warcraft style.
Now I made a private server for my guild, I managed to intergrade a register page but...

I want to add a realm status bar to the center block on the portal.
I have 2 PHP files that are involved to that, but I dont have enough knowledge of PHPBB to implent it.

These are the codes:

Index.php (can be renamed ofc):

Code: Select all

<?php
include 'status.php';
GetStatus(0, "77.249.155.253", 8129, 5000, "My Realm Name");
?>
status.php

Code: Select all

<?php
function GetStatus($type, $host, $world_port, $realmd, $name){
	$err = array('no' => NULL, 'str' => NULL);
	if($type == 0){
		$ArcEmu = @fsockopen($host, $world_port, $err['no'], $err['str'], (float)1.0);
		if(!$ArcEmu){
			echo "<img src='img/down.gif' /><font color='white'> " . $name . "</font> is <font color='red'><strong> OFFLINE</strong></font>";
		}else{
			echo "<img src='img/up.gif' /><font color='white'> " . $name . "</font> is <font color='red'><strong> ONLINE</strong></font>";
			fclose($ArcEmu);
		}
	}else{
		$MaNGOS = @fsockopen($host, $world_port, $err['no'], $err['str'], (float)1.0);
		$RealmD = @fsockopen($host, $realmd, $err['no'], $err['str'], (float)1.0);
		if(!$MaNGOS){
			echo "<font color='white'>World Status: </font><font color='red'><strong>OFFLINE </strong></font><img src='img/down.gif' />";
		}else{
			echo "<font color='white'>World Status: </font><font color='green'><strong>ONLINE </strong></font><img src='img/up.gif' />";
			fclose($MaNGOS);
		}
		echo "<br />";
		if(!$RealmD){
			echo "<font color='white'>Realm Status: </font><font color='red'><strong>OFFLINE </strong></font><img src='img/down.gif' />";
		}else{
			echo "<font color='white'>Realm Status: </font><font color='green'><strong>ONLINE </strong></font><img src='img/up.gif' />";
			fclose($RealmD);
		}
	}
}
?>
I tried including the index.php file in the portal.php, but it shows on the top of the page instead of the center block.
I also makes my page swallow :S.

Does anyone know how to make this possible?

Thanks in advance.

~ Archcry