Also das der Code in der Box (die komplette rechte Seite)
<?php
defined ('main') or die ( 'no direct access' );
require("lgsl/lgsl_module.php");
?>
Das ist der Code der lgsl_module.php
<?php
//-----------------------------------------------------------------------------------------------------------+
$lgsl_random = 0; // NUMBER OF RANDOM SERVERS TO SHOW INSTEAD OF USING THE :on SELECTION
$lgsl_cachetime = 1; // REFRESH DELAY IN MINS - AS GUIDE ADD 1 AFTER EVERY 5 SERVERS ON THE LIST
$lgsl_hostnamelength = 20; // NUMBER OF CHARACTERS BEFORE SERVER NAME GETS SHORTENED
$lgsl_hide_offline = 1; // CHANGE THIS TO 1 IF YOU DONT WANT TO SHOW OFFLINE SERVERS
$lgsl_hide_empty = 0; // CHANGE THIS TO 1 IF YOU DONT WANT TO SHOW ONLINE BUT EMPTY SERVERS
$lgsl_hide_full = 0; // CHANGE THIS TO 1 IF YOU DONT WANT TO SHOW ONLINE BUT FULL SERVERS
$lgsl_hostname_to_ip = 0; // CONVERT HOSTNAMES TO IP ADDRESS TO SAVE SPACE AND FOR ASE LINK TO WORK
$lgsl_path = "lgsl/"; // RELATIVE PATH BETWEEN THIS FILE AND ITS LOADING PAGE WITH 'require'
//-----------------------------------------------------------------------------------------------------------+
require_once($lgsl_path."lgsl_protocol.php");
if (!is_writable($lgsl_path."lgsl_module_cache.dat")) { echo "THE FILE LGSL_MODULE_CACHE.DAT IS NOT WRITABLE"; exit; }
//-----------------------------------------------------------------------------------------------------------+
$lines = file($lgsl_path."lgsl_module_cache.dat");
$last_line = count($lines) - 1;
$last_update = intval($lines[$last_line]);
$time_check = time() - ($lgsl_cachetime * 60);
if ($time_check < $last_update)
{
// echo "DEBUG: This information was CACHED <br /><br />";
unset($lines[$last_line]); // REMOVE TIMESTAMP
unset($data_cache);
foreach ($lines as $line_number=>$line)
{
$data_cache[$line_number] = unserialize($line);
}
}
else
{
//-----------------------------------------------------------------------------------------------------------+
if ($lgsl_random > 0)
{
unset($data_cache);
unset($data_counter);
unset($random_file);
// GENERATES A RANDOM FILE LIST USING SERVERS FROM THE REAL FILE LIST
$lines = file($lgsl_path."lgsl_servers.txt");
// GOES THROUGH LIST REMOVING ANY BLANK LINES SO THEY ARE NOT PICKED
$data_counter = 0;
unset($data_cache);
unset($random_file);
foreach ($lines as $line)
{
if (!trim($line)) { continue; } // SKIP BLANK LINES
$data_counter += 1;
$data_cache[$data_counter] = $line;
}
// MAKE SURE NUMBER OF SERVERS TO PICK IS NOT HIGHER THAN THE NUMBER AVAILABLE
if ($lgsl_random > count($data_cache))
{
$lgsl_random = count($data_cache);
}
// PICK OUT RANDOM SERVERS WHILE MAKING SURE THAT NO SERVER IS REPEATED TWICE
while (count($random_file) < $lgsl_random)
{
$random = rand(1, count($data_cache));
if (!$random_file[$random])
{
$part = explode(":", $data_cache[$random]);
$random_file[$random] = trim($part[0]).":".trim($part[1]).":".trim($part[2]).":on";
}
}
}
//-----------------------------------------------------------------------------------------------------------+
// echo "DEBUG: This information was LIVE <br /><br />";
ignore_user_abort(true); // FINISH WRITING CACHE EVEN IF THE CLIENTS BROWSER IS CLOSED
if ($lgsl_random > 0)
{
$lines = $random_file; // USE RANDOM FILE LIST GENERATED ABOVE
}
else
{
$lines = file($lgsl_path."lgsl_servers.txt"); // USE THE REAL FILE LIST
}
$data_counter = 0;
unset($data_cache);
foreach ($lines as $line)
{
if (!trim($line)) { continue; } // SKIP BLANK LINES
$part = explode(":", $line);
$server_ip = trim($part[0]); // TRIM REMOVES
$server_port = trim($part[1]); // ACCIDENTAL SPACES
$server_type = trim($part[2]); // AND NEWLINE CHARACTERS
$server_module = trim($part[3]); // AND NEWLINE CHARACTERS
if ($server_module != "on") { continue; } // SKIP NON MODULES
$data = lgsl_query($server_ip, $server_port, $server_type, "info");
$data[mapname] = preg_replace("/[^A-Za-z0-9 \_\-]/", "_", strtolower($data[mapname])); // CONVERT FOR FILE
$data[gamemod] = preg_replace("/[^A-Za-z0-9 \_\-]/", "_", strtolower($data[gamemod])); // AND FOLDER USAGE
$data_counter += 1;
$data_cache[$data_counter] = $data;
}
$fh = fopen($lgsl_path."lgsl_module_cache.dat","w");
foreach($data_cache as $line)
{
$line = serialize($line)."\r\n";
fwrite($fh,$line);
}
fwrite($fh, time());
fclose($fh);
ignore_user_abort(false);
}
//-----------------------------------------------------------------------------------------------------------+
if (count($data_cache) == 0) { echo "no servers with :on set"; exit; } // STOP IF THE MODULE LIST IS EMPTY
//-----------------------------------------------------------------------------------------------------------+
foreach($data_cache as $data)
{
//-----------------------------------------------------------------------------------------------------------+
if ($lgsl_hide_offline && !$data[status]) { continue; }
if ($lgsl_hide_empty && $data[status] && $data[players] == 0) { continue; }
if ($lgsl_hide_full && $data[status] && $data[players] == $data[maxplayers]) { continue; }
//-----------------------------------------------------------------------------------------------------------+
if (!$data[status])
{
$lgsl_image_map = $lgsl_path."images/status/noresponse.jpg";
$data[hostname] = "Unknown";
$data[mapname] = "unknown";
}
else
{
$lgsl_image_map = $lgsl_path."images/maps/$data[gametype]/$data[gamemod]/$data[mapname].jpg";
if (!file_exists($lgsl_image_map))
{
$lgsl_image_map = $lgsl_path."images/status/noimage.jpg";
}
}
$lgsl_image_map = str_replace(" ", "%20", $lgsl_image_map); // CHANGE SPACES FOR A VALID URL
//-----------------------------------------------------------------------------------------------------------+
if (!$data[password])
{
$lgsl_image_pass = $lgsl_path."images/status/nopassword.gif";
}
else
{
$lgsl_image_pass = $lgsl_path."images/status/password.gif";
}
//-----------------------------------------------------------------------------------------------------------+
if (strlen($data[hostname]) > $lgsl_hostnamelength)
{
$data[hostname] = substr($data[hostname], 0, $lgsl_hostnamelength - 3) . "..."; // SHORTEN HOSTNAME
}
$data[hostname] = htmlentities($data[hostname], ENT_QUOTES); // CHANGE SYMBOLS INTO ENTITIES
//-----------------------------------------------------------------------------------------------------------+
if ($lgsl_hostname_to_ip) { $data[ip] = gethostbyname($data[ip]); } // CONVERT HOSTNAME TO IP
$lgsl_launch = lgsl_get("launch", $data[ip], $data[port], $data[gametype]); // GET SOFTWARE LAUNCH LINK
//-----------------------------------------------------------------------------------------------------------+
echo "
<div style='width:160px; text-align:center; border:none; font-size:11px; font-family:verdana;'>
<table width='160' border='0' style='font-size:11px; font-family:verdana;'><tr><td align='center' valign='middle'><img src='lgsl/images/icons/$data[gametype]/$data[gamemod].gif' alt='' title='$data[gametype] - $data[gamemod]' /></td><td>
<a style='text-decoration:none' href='?lgsl_settings&ip=$data[ip]&port=$data[port]' title='CLICK TO VIEW SERVER SETTINGS'>$data[hostname]</a><br />
<a style='text-decoration:none' href='$lgsl_launch' title='CLICK TO VIEW IN THE A.S.E.'>$data[ip]:$data[port]</a></td>
</tr></table>
<div style='border:none; background-image:url($lgsl_image_map); background-repeat:no-repeat; background-position:center'>
<img src='$lgsl_image_pass' alt='' title='$data[gametype] - $data[gamemod]' />
</div>
$data[mapname]<br />
<a style='text-decoration:none' href='?lgsl_players&ip=$data[ip]&port=$data[port]' title='CLICK TO VIEW PLAYER INFO'>PLAYERS: $data[players]/$data[maxplayers]</a><br />
<br />
</div>
";
}
//-----------------------------------------------------------------------------------------------------------+
?>
und in die Dateien lgsl_player.php und lgsl_settings.php (beide im Ordner include/contents) hab ich
jeweils am Anfang
defined ('main') or die ( 'no direct access' );
$title = $allgAr['title'].' :: Playerstats';
$hmenu = 'Playerstats';
$design = new design ( $title , $hmenu );
$design->header();
bzw.
defined ('main') or die ( 'no direct access' );
$title = $allgAr['title'].' :: Serversettings';
$hmenu = 'Serversettings';
$design = new design ( $title , $hmenu );
$design->header();
und am Ende
$design->footer();
Der Ordner lgsl befindet sich im selben Ordner wie die index.php
Unter 1.0.5 lief es einwandfrei. Nur unter 1.1e jetzt nicht mehr.
Unter ner anderen 1.1 Version hab ich es nicht getestet da die Seite unter 1.1c ja kaum lief weil da irgendwer der Meinung war sie hacken (oder cracken oder sonst was, mir scheiss egal wie es heißt) zu müssen.