Show server online/offline in left menu

Current Version: 2.1.0
Released: 2015-10-26
Forum rules
Before creating a new support thread, please take a look at the board3 Portal FAQ and use the search!
Many questions have already been answered.
Locked

Topic author
Jumpman
Active Member
Posts: 5
Joined: 21. January 2016 19:42

Show server online/offline in left menu

Post by Jumpman »

Your Portal Version: 2.1.0
Your phpBB Type: Standard phpBB3
MODs installed: No
Your knowledge: Beginner
Boardlink: http://venskabsklanerne.dk/

PHP Version: PHP Version 5.4.45-0+deb7u2

What have you done before the problem was there?
Read in my questions

What have you already tryed to solve the problem?
Yes read in my questions

Description and Message
Hi

I want to have my servers show online/offline on my portal front page http://venskabsklanerne.dk/ in the left menu at the bottom but it not like echo form my code

I try to include serverinfo.php in block with iframe it work but that i not like make a black box around my script

I use Extensions pages 1.0.3 i try to add my code to that to but it look like shit http://venskabsklanerne.dk/app.php/page ... 277f5be6c6 i think be cource i want to include header from phpbb3 but i don't know look like this when i not use pages http://venskabsklanerne.dk/serverinfo.php

Right now i just link to the server online/offline from a block like you see on my portal
link to server online/offline is http://venskabsklanerne.dk/infoserver.php (this is same script as serverinfo.php) and it work fine but phpbb3 style is not included in my script like above.

How do i include og add my code to the left menu in my portal so i can see if my server is online/offline ?

I need to have this 2 lines ind the script to
<meta http-equiv="refresh" content="10">
<link rel="stylesheet" type="text/css" href="../../../style.css">

serverinfo.php

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

page_header('Server Info');

$template->set_filenames(array(
   'body' => 'serverinfo_body.html',
));

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
serverinfo_body.html

Code: Select all

<!-- INCLUDE overall_header.html -->

<h2>Server Info</h2>

<div class="panel">
   <div class="inner"><span class="corners-top"><span></span></span>

   <div class="content">
<p align="center">

<?php
header('Content-Type: text/html; charset=UTF-8');
?>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="refresh" content="10">
<link rel="stylesheet" type="text/css" href="../../../style.css">
<title>[VK] - Main Menu Right</title>
</head>

<body text="#BBBBBB" bgcolor="#000000" SCROLL="no" BOTTOMMARGIN="0" TOPMARGIN="0" RIGHTMARGIN="0" LEFTMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">

<table class="TRtable">
		<tr>
			<th>[VK] TEAMSPEAK SERVER</th></tr>
		<tr><td>
<!--[VK] TeamSpeak3 Server-->
<?PHP
$ts_ip = "151.80.90.218";
$ts_port = "10011";

$output = @fsockopen("$ts_ip", $ts_port, $errno, $errstr, 2);
socket_set_timeout($output, 000002);

if (!$output) {
    echo '<strong><font face="Comic Sans MS">[+35] TEAMSPEAK3 SERVER</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#F00;">Offline</font></span><br />';
} else {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[+35] TEAMSPEAK3 SERVER</font></strong><br />';
	echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">151.80.90.218:12270</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#0F0;">Online</font></span><br />';
    echo '<span style="color:grey;"><strong><font size=1 face="Verdana, helvetica, sans-serif"><a href="ts3server://151.80.90.218:12270/?channel=?password=">Join Here</a></font></strong></span><br />';
}
@fclose($output);
?>
		</td></tr>
</table>

<br>

<table class="TRtable">
		<tr>
			<th>[VK] CSS SERVER</th></tr>
		<tr><td>
<!--[+35] CSS Fairplay For Adults I-->
<?PHP
$ts_ip1 = "5.135.161.166";
$ts_port1 = "27035";

$output1 = @fsockopen("$ts_ip1", $ts_port1, $errno, $errstr, 2);
socket_set_timeout($output1, 000002);

if (!$output1) {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[+35] CSS Fairplay For Adults I</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#F00;">Offline</font></span><br />';
} else {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[+35] CSS Fairplay For Adults I</font></strong><br />';
	echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">5.135.161.166:27035</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#0F0;">Online</font></span><br />';
    echo '<span style="color:grey;"><strong><font size=1 face="Verdana, helvetica, sans-serif"><a href="steam://connect/5.135.161.166:27035">Join Here</a></font></strong></span><br />';
}
@fclose($output1);
?>
		</td></tr>

		<tr><td>
<!--[+35] CSS FAIRPLAY FOR ADULTS [NO AWP/AUTO]-->
<?PHP
$ts_ip2 = "5.135.161.166";
$ts_port2 = "27036";

$output2 = @fsockopen("$ts_ip2", $ts_port2, $errno, $errstr, 2);
socket_set_timeout($output2, 000002);

if (!$output2) {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[+35] CSS Fairplay For Adults II<br />[NO AWP/AUTO]</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#F00;">Offline</font></span><br />';
} else {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[+35] CSS Fairplay For Adults II<br />[NO AWP/AUTO]</font></strong><br />';
	echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">5.135.161.166:27036</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#0F0;">Online</font></span><br />';
    echo '<span style="color:grey;"><strong><font size=1 face="Verdana, helvetica, sans-serif"><a href="steam://connect/5.135.161.166:27036">Join Here</a></font></strong></span><br />';
}
@fclose($output2);
?>
		</td></tr>

		<tr><td>
<!--[WoF] CSS FAIRPLAY FOR ADULTS-->
<?PHP
$ts_ip3 = "5.135.161.166";
$ts_port3 = "27037";

$output3 = @fsockopen("$ts_ip3", $ts_port3, $errno, $errstr, 2);
socket_set_timeout($output3, 000002);

if (!$output3) {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[WoF] CSS FAIRPLAY FOR ADULTS</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#F00;">Offline</font></span><br />';
} else {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[WoF] CSS FAIRPLAY FOR ADULTS</font></strong><br />';
	echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">5.135.161.166:27037</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#0F0;">Online</font></span><br />';
    echo '<span style="color:grey;"><strong><font size=1 face="Verdana, helvetica, sans-serif"><a href="steam://connect/5.135.161.166:27037">Join Here</a></font></strong></span><br />';
}
@fclose($output3);
?>
		</td></tr>

		<tr><td>
<!--[+35] CSS GUNGAME 5.1 SERVER-->
<?PHP
$ts_ip4 = "5.135.161.166";
$ts_port4 = "27038";

$output4 = @fsockopen("$ts_ip4", $ts_port4, $errno, $errstr, 2);
socket_set_timeout($output4, 000002);

if (!$output4) {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[+35] CSS GUNGAME 5.1 SERVER</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#F00;">Offline</font></span><br />';
} else {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[+35] CSS GUNGAME 5.1 SERVER</font></strong><br />';
	echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">5.135.161.166:27038</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#0F0;">Online</font></span><br />';
    echo '<span style="color:grey;"><strong><font size=1 face="Verdana, helvetica, sans-serif"><a href="steam://connect/5.135.161.166:27038">Join Here</a></font></strong></span><br />';
}
@fclose($output4);
?>
		</td></tr>

		<tr><td>
<!--KRYPTONITE-DK-RETRO-GUNGAME-->
<?PHP
$ts_ip5 = "5.135.161.166";
$ts_port5 = "27039";

$output5 = @fsockopen("$ts_ip5", $ts_port5, $errno, $errstr, 2);
socket_set_timeout($output5, 000002);

if (!$output5) {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">KRYPTONITE-DK-RETRO-GUNGAME</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#F00;">Offline</font></span><br />';
} else {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">KRYPTONITE-DK-RETRO-GUNGAME</font></strong><br />';
	echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">5.135.161.166:27039</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#0F0;">Online</font></span><br />';
    echo '<span style="color:grey;"><strong><font size=1 face="Verdana, helvetica, sans-serif"><a href="steam://connect/5.135.161.166:27039">Join Here</a></font></strong></span><br />';
}
@fclose($output5);
?>
		</td></tr>

		<tr><td>
<!--[WoF] CSS GUNGAME 5.1 SERVER-->
<?PHP
$ts_ip6 = "5.135.161.166";
$ts_port6 = "27040";

$output6 = @fsockopen("$ts_ip6", $ts_port6, $errno, $errstr, 2);
socket_set_timeout($output6, 000002);

if (!$output6) {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[WoF] CSS GUNGAME 5.1 SERVER</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#F00;">Offline</font></span><br />';
} else {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[WoF] CSS GUNGAME 5.1 SERVER</font></strong><br />';
	echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">5.135.161.166:27040</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#0F0;">Online</font></span><br />';
    echo '<span style="color:grey;"><strong><font size=1 face="Verdana, helvetica, sans-serif"><a href="steam://connect/5.135.161.166:27040">Join Here</a></font></strong></span><br />';
}
@fclose($output6);
?>
		</td></tr>
</table>

<br>

<table class="TRtable">
		<tr>
			<th>[VK] CSGO SERVER</th></tr>
		<tr><td>
<!--[+35] CSGO FAIRPLAY FOR ADULTS-->
<?PHP
$ts_ip7 = "5.135.161.166";
$ts_port7 = "27041";

$output7 = @fsockopen("$ts_ip7", $ts_port7, $errno, $errstr, 2);
socket_set_timeout($output7, 000002);

if (!$output7) {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[+35] CSGO FAIRPLAY FOR ADULTS</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#F00;">Offline</font></span><br />';
} else {
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">[+35] CSGO FAIRPLAY FOR ADULTS</font></strong><br />';
	echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">5.135.161.166:27041</font></strong><br />';
    echo '<strong><font size=1 face="Verdana, helvetica, sans-serif">Server is:</strong> <span style="color:#0F0;">Online</font></span><br />';
    echo '<span style="color:grey;"><strong><font size=1 face="Verdana, helvetica, sans-serif"><a href="steam://connect/5.135.161.166:27041">Join Here</a></font></strong></span><br />';
}
@fclose($output7);
?>

</font>

			</td>
		</tr>
	</table>

</body>

</html>

</p>
   </div>

   <span class="corners-bottom"><span></span></span></div>
</div>

<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->
[/i]
User avatar

Kirk
Dev
Posts: 1956
Joined: 27. July 2010 18:02
phpBB.de User: Kirk
Contact:

Re: Show server online/offline in left menu

Post by Kirk »

For this you have to create an own module. Create a module for Board3 Portal 2.1.x
Gruß Udo
Locked

Return to “Board3 Portal 2.1.x - English Support”