Dragonfly CMS v9 ⇒ Gamers Modules & Blocks :: Archives ⇒ need block made from this PHP :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index Modules & Blocks Gamers Modules & Blocks ⇒ Archives

Archived ⇒ need block made from this PHP


ive tried and tried to get this to work and all it does it slap the code in the logo header and not on the left side like i want.... please help someone.

<? $info[0]["name"]="Google"; $info[0]["address"]="216.239.39.99"; $info[0]["port"]="80"; $info[1]["name"]="FTP Microsoft.com"; $info[1]["address"]="207.46.133.140"; $info[1]["port"]="21"; $infocount = 1; $timeout = 2; echo '<table width="300" border="0">'; for ($i=0; $i<=$infocount; $i++){ $fp = @fsockopen ($info[$i]["address"], $info[$i]["port"], $errno, $errstr, $timeout); if ($fp) { echo "<tr><td><img src='images/up.gif' alt='Connected'></td><td><a href='http://" . $info[$i]["address"] . "'>" . $info[$i]["name"] . "</a></td><td>" . $info[$i]["address"] . "</td><td>" . $info[$i]["port"] . "</td></tr>"; }else{ echo "<tr><td><img src='images/down.gif' alt='Down!'></td><td>" . $info[$i]["name"] . "</td><td>" . $info[$i]["address"] . "</td><td>" . $info[$i]["port"] . "</td></tr>"; } } echo "</tr></table>"; ?>

i pulled this ping port number script from someone and need it to check a few servers and put the info in a block.

the reason im using this is bc it echos the result as an IMAGE or whatever i want it to.

thanks ahead if someone can convert this to be dragonfly cms block.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Windows Server 2003/IIS 6.0/PHP 5/DF 9.1.2.1


no one can help me here?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Windows Server 2003/IIS 6.0/PHP 5/DF 9.1.2.1


You try to add <?php to the beginning instead of just <?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux 2.4.32 / Apache 1.3.37 / MySQL 5.0.16 / PHP 5.2.2 / Dragonfly CVS


yes... that was one of the first things i tried.

all this does when i make a block is cram the script in the header, and not code its actually running.

i cant figure out why it wont go into a block.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Windows Server 2003/IIS 6.0/PHP 5/DF 9.1.2.1


instead of using Echo, assign the output to $content
<?php $info[0]["name"]="Google"; $info[0]["address"]="216.239.39.99"; $info[0]["port"]="80"; $info[1]["name"]="FTP Microsoft.com"; $info[1]["address"]="207.46.133.140"; $info[1]["port"]="21"; $infocount = 1; $timeout = 2; $content = "<table width='300' border='0'>"; for ($i=0; $i<=$infocount; $i++){ $fp = @fsockopen ($info[$i]["address"], $info[$i]["port"], $errno, $errstr, $timeout); if ($fp) { $content .= "<tr><td><img src='images/up.gif' alt='Connected'></td><td><a href='http://" . $info[$i]["address"] . "'>" . $info[$i]["name"] . "</a></td><td>" . $info[$i]["address"] . "</td><td>" . $info[$i]["port"] . "</td></tr>"; }else{ $content .= "<tr><td><img src='images/down.gif' alt='Down!'></td><td>" . $info[$i]["name"] . "</td><td>" . $info[$i]["address"] . "</td><td>" . $info[$i]["port"] . "</td></tr>"; } } $content .= "</tr></table>"; ?>

Admin - Great Lakes Web Designs
Theme Designer - WebSite Guru Designs
Site Admin - Families with Food Allergies

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux 2.6.27-grsec/Apache 2.2.11/MySQL 5.0.67-community-log/PHP 5.2.8/DF 9.2.1


well i tried to duplicate that with another script and tried to make this a module.
FAILED.

any chance someone can help me once more
? lol sry and thank you!
<html> <head> <title>anVox Server Status</title> <style type="text/css"> .listing { color: #000000; FONT-SIZE: 10px; FONT-FAMILY: verdana,arial,helvetica,sans-serif; } .servername { color: #ffffff; FONT-SIZE: 14px; FONT-FAMILY: verdana,arial,helvetica,sans-serif; } .serverdetail { color: #ffffff; FONT-SIZE: 10px; FONT-FAMILY: verdana,arial,helvetica,sans-serif; } .serverdetail a:link, .serverdetail a:visited, .serverdetail a:active { color: #ffffff; text-decoration: none; } .serverdetail a:hover { color: #ffffff; text-decoration: underline; } </style> </head> <body> <table align="left" border="0" cellpadding="0" cellspacing="0" width="400"> <tr> <td> <? // Your anVox server IP $server_ip=""; // Your anVox server port $server_port=""; // Your server type: 1 = Teamspeak, 2 = Ventrilo $server_type=""; // Outside table color $table_color1="556d8c"; // Inside table color $table_color2="ededed"; // Data list table color $table_color3="FFFFFF"; // DO NOT EDIT THE LINE BELOW!! @readfile("http://status.anvox.net/status.php?detail=$server_ip&detailport=$server_port&server_type=$server_type&table_color1=$table_color1&table_color2=$table_color2&table_color3=$table_color3"); ?> </td> </tr> </table> <table align="center" border="0" cellpadding="0" cellspacing="0" width="400"> <tr> <td> <font size="-2" face="verdana"><center>Hosted by <a href="http://www.anvox.com" target="_blank">www.anVox.com</a></center></font> </td> </tr> </table> </body> </html>

sigh so frustrating....

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Windows Server 2003/IIS 6.0/PHP 5/DF 9.1.2.1


Try this:
<?php if (!defined('CPG_NUKE')) { exit; } $content ='<style type="text/css"> .listing { color: #000000; FONT-SIZE: 10px; FONT-FAMILY: verdana,arial,helvetica,sans-serif; } .servername { color: #ffffff; FONT-SIZE: 14px; FONT-FAMILY: verdana,arial,helvetica,sans-serif; } .serverdetail { color: #ffffff; FONT-SIZE: 10px; FONT-FAMILY: verdana,arial,helvetica,sans-serif; } .serverdetail a:link, .serverdetail a:visited, .serverdetail a:active { color: #ffffff; text-decoration: none; } .serverdetail a:hover { color: #ffffff; text-decoration: underline; } </style> <table align="left" border="0" cellpadding="0" cellspacing="0" width="400"> <tr> <td>'; // Your anVox server IP $server_ip=""; // Your anVox server port $server_port=""; // Your server type: 1 = Teamspeak, 2 = Ventrilo $server_type=""; // Outside table color $table_color1="556d8c"; // Inside table color $table_color2="ededed"; // Data list table color $table_color3="FFFFFF"; // DO NOT EDIT THE LINE BELOW!! $content .= @readfile("http://status.anvox.net/status.php?detail=$server_ip&detailport=$server_port&server_type=$server_type&table_color1=$table_color1&table_color2=$table_color2&table_color3=$table_color3"); $content .='</td> </tr> </table> <table align="center" border="0" cellpadding="0" cellspacing="0" width="400"> <tr> <td> <font size="-2" face="verdana"><center>Hosted by <a href="http://www.anvox.com" target="_blank">www.anVox.com</a></center></font> </td> </tr> </table>'; ?>
Name it block-whatever.php, put it in your DF blocks directory, then use you Admin->Blocks menu to create a new block using the file ensuring you choose your positioning and which modules you want it to show in.

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

All times are UTC