PDA

View Full Version : help with a addon on


dep
08-02-2004, 07:46 AM
Hello i am trying to make a addon for my users i have got the php code, but am not sure how i go about converting to make it work with vbadvance.

any help would be much welcomed.

<?php
error_reporting(1);

echo "Status obtained on the </p>";
$offset = 3600*1;
$date = gmdate("jS F Y, h:i A", time() + $offset);
echo $date, "<br><br>\n";

function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}

function testServer ($address, $port, $serverName) {

$time_start = getmicrotime();

$fp = fsockopen ($address, $port, $errno, $errstr, 5);
if (!$fp) {
echo "<font color=red>$serverName is Down. </font><br>\n";
} else {

$time_end = getmicrotime();
$time = $time_end - $time_start;
$time = round($time*1000,2);

echo "<font color=green>$serverName is Up.</font><br>\n";

fclose ($fp);
}
return;
}

testServer("www.legendofmir.net", 80, "Offical Web Site");
testServer("forum.legendofmir.net", 80, "Offical Forum");
testServer("patch.legendofmir.net", 21, "AutoUpdate");
testServer("217.65.66.20", 80, "Game Server");
?>

Brian
08-02-2004, 12:58 PM
First, please take a look at the 'Creating New Modules' section in the User's Manual.
Secondly, since your script was not designed for vBulletin, you'll have to make some small changes. Either this post (http://www.vbadvanced.com/forum/showpost.php?p=6658&postcount=3), or this post (http://www.vbadvanced.com/forum/showpost.php?p=6704&postcount=3) will help you with that.

Our Sponsors
 

dep
08-02-2004, 01:29 PM
thanks just noticed it and got it working ty

Laz
08-16-2005, 06:19 PM
Dep,

Many thanks for this base code. I run an Eve-Online website and have managed to adapt your code and use it in CMPS V2.

The changes show a sites status for the game servers with graphics and also it shows web pages. When a web page is offline the link to it disappears.

Just wanted to thank you for your work here that helped me come up with something I needed on my site.

Cheers.