Dragonfly CMS v9 ⇒ Gamers Modules & Blocks :: Archives ⇒ BF2 Server Block :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index Modules & Blocks Gamers Modules & Blocks ⇒ Archives

Archived ⇒ BF2 Server Block


Can anyone convert this into a block I can use in dragonfly.


<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<style type="text/css">
<!--
body { color: black; }
table { border: 1px solid black; text-align: center; background: lavender; }
th { font: 900 14px verdana; border: 0px; }
td { font: 100 9px verdana; border: 0px; }
a { font: 100 9px verdana; border: 0px; }
#right { font: 900 9px verdana; text-align: right; }
#middle { font: 900 10px verdana; }
#left { text-align: left; }
-->
</style>
</head>
<body>
<?php
require("serverCheckerPreHead.php");

$linkToServerChecker = "index.php"; // the link to the server checker, to display the full info

if(!$wrongIP) {

if(strlen($val[hostname])>26) { $hostname=substr($val[hostname],0,26)."..."; } else { $hostname=$val[hostname]; }

if($val[bf2_ranked]) { $ranked="<font color="limegreen">YES</font>"; } else { $ranked="<font color="red">NO</font>"; }
if($val[bf2_anticheat]) { $anticheat="<font color="limegreen">YES</font>"; } else { $anticheat="<font color="red">NO</font>"; }
if($val[password]) { $password="<font color="red">YES</font>"; } else { $password="<font color="limegreen">NO</font>"; }

if(!$val[numplayers]) { $players="dodgerblue"; }
elseif($val[numplayers]==$val[maxplayers]) { $players="red"; }
elseif($val[maxplayers]-$val[numplayers]<=2) { $players="orange"; }
else { $players="limegreen"; }

echo "<table cellpadding="1" cellspacing="0" align="center">\n";
echo "<tr><th colspan="2">".ucfirst($val[gamename])."</th></tr>\n";
echo "<tr><td id="middle" colspan="2">$hostname</td></tr>\n";
echo "<tr><td colspan="2"><a href="$linkToServerChecker" title="Click for detailed Information!">IP: $pip:$val[hostport]</a></td></tr>\n";
echo "<tr><td colspan="2"><a href="$linkToServerChecker" title="Click for detailed Information!"><img src="$path" border="0"></a></td></tr>\n";
echo "<tr><td id="right">Map: </td><td id="left">$val[mapname]</td></tr>\n";
echo "<tr><td id="right">Players: </td><td id="left"><font color="$players">$val[numplayers]/$val[maxplayers]</font></td></tr>\n";
echo "<tr><td id="right">Ranged: </td><td id="left">$ranked</td></tr>\n";
echo "<tr><td id="right">Anticheat: </td><td id="left">$anticheat</td></tr>\n";
echo "<tr><td id="right">Password: </td><td id="left">$password</td></tr>\n";
echo "<tr><td id="right">Version: </td><td id="left">$val[gamever]</td></tr>\n";
echo "</table>";
}
else { if(!$corQue) { echo "<font color="red">Server is Offline!</font>"; } else { echo "<font color="red">Wrong IP!</font>"; } }
?>
</body>
</html>

To see what it looks like - www.xplosivegaming.co..../block.php

The index.php file it gets the information from is in - bf2server/index.php.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CPGNuke


I got this far then got stuck, i'm no expert but i'm trying to learn how to code blocks and modules by just fiddling, its how i learn anything i've done on the web, lol..........

Its still progress as i see it though... maybe a guru will jump in and finish it... Very Happy

<?php if (!defined('CPG_NUKE')) { exit; } global $content; $linkToServerChecker = 'index.php'; if(!$wrongIP) { if(strlen($val['hostname'])>26) { $hostname=substr($val['hostname'],0,26)."..."; } else { $hostname=$val['hostname']; } if($val['bf2_ranked']) { $ranked='<font color="limegreen">YES</font>'; } else { $ranked='<font color="red">NO</font>'; } if($val['bf2_anticheat']) { $anticheat='<font color="limegreen">YES</font>'; } else { $anticheat='<font color="red">NO</font>'; } if($val['password']) { $password='<font color="red">YES</font>'; } else { $password='<font color="limegreen">NO</font>'; } if(!$val['numplayers']) { $players="dodgerblue"; } elseif($val['numplayers']==$val['maxplayers']) { $players="red"; } elseif($val['maxplayers']-$val['numplayers']<=2) { $players="orange"; } else { $players="limegreen"; } $content = '<table cellpadding="1" cellspacing="0" align="center"><tr><th colspan="2">'.ucfirst($val['gamename']).'</th></tr> <tr><td id="middle" colspan="2">'.$hostname.'</td></tr> <tr><td colspan="2"><a href="$linkToServerChecker" title="Click for detailed Information!">IP: $pip:$val[hostport]</a></td></tr> <tr><td colspan="2"><a href="$linkToServerChecker" title="Click for detailed Information!"><img src="$path" border="0"></a></td></tr> <tr><td id="right">Map: </td><td id="left">$val[mapname]</td></tr> <tr><td id="right">Players: </td><td id="left"><font color="$players">$val[umplayers]/$val[maxplayers]</font></td></tr> <tr><td id="right">Ranged: </td><td id="left">$ranked</td></tr> <tr><td id="right">Anticheat: </td><td id="left">$anticheat</td></tr> <tr><td id="right">Password: </td><td id="left">$password</td></tr> <tr><td id="right">Version: </td><td id="left">$val[gamever]</td></tr> </table>'; } else { if(!$corQue) { $content = '<font color="red">Server is Offline!</font>'; } else { $content = '<font color="red">Wrong IP!</font>'; } }

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
XP / 2.0 / 5.1 / 5.2 / none


I'd ported a BF2 stats block, but it sucked because it queried a server that was always busy and put me in a queue at position 222,017 or so when i used it, so i found it worthless.

I've been waiting for something worth using... Very Happy

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
XP / 2.0 / 5.1 / 5.2 / none


You might try speaking to FrontRunner, webmaster of www.bf2nation.co.uk which runs 3 BF2 servers all with on-site information etc.

Gaming League / Cup - www.leaguecms.co.uk :: Other DragonFly modules - www.cmsdreams.co.uk

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


I created a zip-archive of the script i use on BF2Nation.

Download it here: BF2 Serverinfo Block for CPG Nuke
  1. Unzip it to your desktop
  2. Edit bf2serverinfo/serverInfo.php and edit the serversettings
  3. upload to your cpgnuke root folder
  4. enable the block

Be aware this is the version I´m running. The script is able to show more serverdetails than currently shown.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
FreeBSD/Apache/1.3.33/MySQL 4.0.24/PHP 5.0.4/CPGNuke 9.0.6.1

Last edited by FrontRunner on Tue Oct 04, 2005 9:14 pm; edited 1 time in total


Thanks alot FrontRunner Big grin Cool

Please enter your server specs in your user profile! 😢


Put this image in your pics folder for Wake Island.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
FreeBSD/Apache/1.3.33/MySQL 4.0.24/PHP 5.0.4/CPGNuke 9.0.6.1


oh.. Where Can the files be downloaded from now?

www.jzky.net a Dragonfly site. cms.jzky.net < test site. - Pardon my bad englsih Wink
My home town

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / Apache / PHP Version 5.2.0 /MySQL Version 4.1.21-standard / CMS Version 9.1.1

All times are UTC