1 頁 (共 1 頁)

[問題] 如果在forum頂加入物件?

發表於 : 2005-04-10 08:44
york2
我這個forum 是遊戲私服, 想在forum 頂加入server status:
<?PHP
error_reporting(0);
$my_serv_name="";
$my_ip="218.253.42.97";$IP = array("" => "$my_ip:3724"
);
$online= "<font color=green><B>ONLINE <img src='user_online.gif'></B></font>";
$offline = "<font color=red><B>OFFLINE <img src='user_offline.gif'></B></font>";

while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
echo("<TR><TD>".$ServerName."</TD><TD>");
if($fp=fsockopen($IPAddress, 3724, $ERROR_NO, $ERROR_STR,(float)0.5)) {
echo("

<table border='0' cellpadding='0' cellspacing='0' width='165' height='50'>
<tr height='50'>
<td width='165' height='50' background='themes/warcraft/files/status.gif'><img src='themes/warcraft/files/space.gif' width='16' height='14' border='0'>Server: $online</td>

</tr>
</table>


");
fclose($fp);}
else
echo ("
<table border='0' cellpadding='0' cellspacing='0' width='165' height='50'>
<tr height='50'>
<td width='165' height='50' background='themes/warcraft/files/status.gif'><img src='themes/warcraft/files/space.gif' width='16' height='14' border='0'>Server: $offline</font></td>

</tr>
</table>

");
}

?>
以上是已有的status.php
;-)

發表於 : 2005-04-16 17:29
小斌
我能想到最簡單的方法就是修改 index_body.tpl 或 overall_header.tpl 檔案,用 iframe 來把這個放進去。參考看看吧。