Code PHP :
Pour copier le contenu exact du code,
Veuillez citer le message
-
<?php
-
/*
*
* Gameserver - A PHPNuke module for querying Gameservers
* Copyright (C) 2002 Jeremias Reith (
)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
adapté pwsphp par zeta */
-
-
$module_name=gameserver;
-
include("modules/$module_name/gsQuery.php");
$currentlang="french";
//needed to support different languages
include("modules/$module_name/language/lang-".$currentlang.".php");
-
// get all gameservers
$result = reqmysql("select id, shortname, address, queryport, protocol, show_in_block from gameserver where show_in_block<>"no" order by name");
if(!$result) { return; }
$numrows = mysql_num_rows($result);
-
// no servers found
if ($numrows == 0) {
return;
}
-
while(list($id, $shortname, $address, $queryport, $protocol, $show_in_block)=mysql_fetch_array($result)) {
-
$gameServer=new gsQuery($address,$queryport);
-
if(!$gameServer->query_server($protocol,FALSE,FALSE)) {
if(strtolower($show_in_block)=="yes") {
if($num_servers++) { $boxstuff.="<br>"; }
$boxstuff.="<table border="0">"
."<tr><td></td><td><b>".$shortname."</b></td></tr>"
."<tr><td>"._STATUS.":</td><td>"._OFFLINE."</td></tr>"
."</table>";
}
} else {
-
switch($gameServer->password) {
-
case 1:
case "True":
case "true":
$status=_PRIVATE;
break;
case 0:
$status=_PUBLIC;
break;
default:
$status=_UNKNOWN;
}
-
if($num_servers++) $boxstuff.="<br>"; // instert a <br> between the servers
$boxstuff.="<center><b>".$shortname."</b></center>";
$boxstuff.="<table border="0">";
if($status!=_UNKNOWN) {
$boxstuff.="<tr><td>"._STATUS.":</td><td>".$status."</td></tr>";
}
-
$boxstuff.="<tr><td>"._GAMEMODE.":</td><td>". $gameServer->gametype ."</td></tr>";
-
// the mapname is sometimes larger than the box (So maptitle is chosen if available).
if($gameServer->maptitle=="") {
$boxstuff.="<tr><td>"._MAP.":</td><td>". $gameServer->mapname ."</td></tr>";
} else {
$boxstuff.="<tr><td>"._MAP.":</td><td>". $gameServer->maptitle ."</td></tr>";
}
-
$boxstuff.="<img src="modules/$module_name/images/".htmlentities($gameServer->gamename)."/".htmlentities($gameServer->mapname).".jpg"<tr><td>"._PLAYERS.":</td><td>". $gameServer->numplayers ."/". $gameServer->maxplayers . "</td></tr>"
."</table>";
$boxstuff.="<center>[<a href="index.php?mod=gameserver&type=detail&serverid=$id">"._DETAILS."</a>]</center>";
}
}
-
$content=$boxstuff;
bloc($result_blocs->parametre1,$content);
-
?>
-
voila ce que j'ai exactement
Edité Dimanche 27 janvier 2008 :12:36 par fredoo