View Single Post
Old 02-03-2006, 08:39 PM   #3 (permalink)
mordero
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
Default

Ok, well first off, your site needs to support php of course, and you need to be able to edit the php to add this in (or if your CMS allows you to add php into blocks). Anyways, you could add this anywhere on your page that you want. Ill give you an example of what you could do.

First checkserver.php needs to be in the same directory for this example to work...

Example page (ill use where i play as an example):
PHP Code:
<?php
include "checkserver.php";
$defaults = array('host'=> "shadowsofsunder.game-host.org",//the IP/Host of the server
'link'=> "7E51EA873A8989EA32F1742DA37CEE31",//this is the UOGateway ID of the server);
$checkserver = new checkserver($defaults);
?>
<html>
<head>
<title>Server Status</title>
</head>
<body>
Status:
<?php
$status 
$checkserver->statusCheck;
//this returns the string "STATUS [PLAYERS ONLINE] ---Ex. Online [5]
print $status;//print it
?>
</body>
</html>
This is the most basic page for it, so if you want to include the status on your main page or some such, you just need to do this:

Near the beginning of the index
PHP Code:
<?php
include "checkserver.php";
$defaults = array('host'=> "shadowsofsunder.game-host.org",//the IP/Host of the server
'link'=> "7E51EA873A8989EA32F1742DA37CEE31",//this is the UOGateway ID of the server);
$checkserver = new checkserver($defaults);
?>
Insert this where ever you want to print the status
PHP Code:
print $checkserver->statusCheck
Oh and I guess there is kind of one bug with the script, that ill check out someday. Sometimes, the page will load before it is finished pinging and all that, so the user will have to refresh. Its not really that big of deal though.

If you need anymore help, just ask
mordero is offline   Reply With Quote