MyBB Community Forums

Full Version: Status Checker
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I found this code for Server status chcker:
<?
$ip = "youriphere";
$port = "yourporthere";
if (! $sock = @fsockopen($ip, $port, $num, $error, 5))
echo '<B><FONT COLOR=red>Offline</b></FONT>';
else{
echo '<B><FONT COLOR=lime>Online</b></FONT>';
fclose($sock);
}
?>
Is there any way to make this code link with another page that I have?
The page I want it to show the status is the Ticket System page.
This system have the offline.php(for offline system) and index.php( for online system) all at ./support
Tell me what information do you need and I'll post it here.

Here is the code that check if the page is online or not:
//Check the status of the HelpDesk.
if(!is_object($cfg) || !$cfg->getId() || $cfg->isHelpDeskOffline()) {
    include('./offline.php');
    exit;
}

And here is the code in the index.php that redirect the user to the offline.php page if the system is closed:
<? 
require_once('client.inc.php');
if($cfg && !$cfg->isHelpDeskOffline()) { 
    @header('Location: index.php'); //Redirect if the system is online.
    include('index.php');
    exit;
}
?>
bump...
Is this anything to do with using MyBB...?? A ticket system and offline.php is not MyBB.