Server Status

shadow-xx

New Member
I added the red part to the header to show the server status above the header but this wont work for some reason..

is there any mod to show the server status in the header?

Note : Im using VB 3.7.0 Beta 5

Code:
<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
</tr>
<tr>
	<td style="background:#000000" width="100%" height="124" valign="top" align="$stylevar[align=left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
<td align="$stylevar[align=right]" id="header_right_cell">
        <if condition="$ad_location['ad_header_logo']">$ad_location[ad_header_logo]<else />&nbsp;</if>
    </td>
</tr>[COLOR="Red"]

<?
$ip = "skygamerz.no-ip.biz";
$port = "6000";
if (! $sock = @fsockopen($ip, $port, $num, $error, 5))
echo 'Server Status : <B><FONT COLOR=red>Offline</b></FONT>';
else{
echo 'Server Status : <B><FONT COLOR=lime>Online</b></FONT>';
fclose($sock);
}
?> 

[/COLOR]</table>
<!-- /logo -->
 
You can't put PHP in templates that's why, you will need to place your code in a separate php file say serverstat.php and create a plug-in for global_start with

ob_start();
include('path/to/this/file/myfile.php');
$serverstat = ob_get_contents();
ob_end_clean();

This will store your code as the variable $serverstat and then you add this variable in your template where you want it to appear. Just like how vBulletin calls $footer and so on.

Why don't you grab status2k from GYSN, and use that? Much more stats, and it displays images that are easy to include in vBulletin. Just Google "status2k demo".
 
Back
Top