<?php
function checklog( $server )
{
	require('data\_dbconfig.php');
	if ($server == "world") { $pfad = $serverfilepfad."\World00_WorldManager\DebugMessage"; }
	if ($server == "gamelog") { $pfad = $serverfilepfad."\World00_GameLog\DebugMessage"; }
	if ($server == "character") { $pfad = $serverfilepfad."\World00_Character\DebugMessage"; }
	if ($server == "zone1") { $pfad = $serverfilepfad."\World00_Zone\DebugMessage"; }
	if ($server == "zone2") { $pfad = $serverfilepfad."\World00_Zone1\DebugMessage"; }
	if ($server == "zone3") { $pfad = $serverfilepfad."\World00_Zone2\DebugMessage"; }
	if ($server == "") { echo "Fileinfo Wrong"; }
	
    $logfile = '';
	$check = '';
	$dir = opendir ($pfad);
		while ($file=@readdir($dir))
			if (!$bild || filemtime($check)<filemtime("$pfad/$file"))
				$datei = $file;
					$zeilen = @file("$pfad/$datei");
					$anzahl = count($zeilen);
					$serverlogtime = date("d.m.Y",filemtime("$pfad/$datei")); 
					$logfile = "Logfile - Date: ".$serverlogtime."<br><table width='100%' border='0' cellspacing='3' cellpadding='0'><tr><td width='2%'>&nbsp;</td><td width='98%'><font size='1'><strong>Time:</strong></font></td></tr>";
					for ($i=$anzahl-50; $i<$anzahl; $i++)
						{
							$x1 = $i;
							$cappedlog = substr("$zeilen[$i]", 18);
							if ($i < 0) { $logfile .= ""; } else { $xi = $i+1; $logfile .= "<tr><td width='2%'><font size='1'>{$xi}. </font></td><td width='98%'><font size='1'>{$cappedlog}</font></td></tr>"; }	
						}
						$logfile .= "</table>";
		return $logfile; //echo  checklog($_GET['checklog']);
}


	
?>

