Changeset 556 for trunk/pages/gmlog.php
- Timestamp:
- Mar 29, 2009, 6:45:56 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pages/gmlog.php
r551 r556 1 1 <?php 2 $gmlog = "/a/mangos1/logs/GM_Commands.log"; //CESTA K GM LOGU 3 $ config = "../gh_system/conn.php"; //CESTA KE CONN.PHP2 3 $gmlog = $Config['Mangos']['GMCommandsLog']; 4 4 $pocet_radku = 50; //KOLIK RADKU Z LOGU SE BUDE ZOBRAZOVAT 5 5 6 echo"<table align=center bordercolor='black' border=2><tr><td align=center><strong>Cas</strong><td align=center><strong>Příkaz</strong><td align=center><strong>GM</strong><td align=center><strong>Vybrán</strong></tr>"; 6 echo('<img src="imgs/gm.jpg" alt="gm" /><br />'); 7 echo('<table class="gmlog"><tr><th>Čas</th><th>Příkaz</th><th>GM</th><th>Vybrán</th></tr>'); 7 8 8 9 10 11 echo('<img src="imgs/gm.jpg" alt="gm">');12 include($config);13 9 $data = file($gmlog); 14 10 $radku = count($data); 15 11 $i = 0; 16 echo "<br />";17 12 18 while($i < $pocet_radku){ 19 $radek = $radku-1; 20 $pole=explode(" ",$data[$radek]); 13 $db->select_db($Config['Mangos']['DatabaseCharacters']); 21 14 22 if($pole[3]=="announce"): 23 $prikaz = "announce ..."; 24 else: 25 $prikaz=explode("[","$pole[3] $pole[4] $pole[5] $pole[6] $pole[7] $pole[8] $pole[9]"); 26 $prikaz = $prikaz[0]; 27 endif; 15 while($i < $pocet_radku) 16 { 17 $radek = $radku - 1; 18 $pole = explode(' ', $data[$radek]); 28 19 29 $prikaz_pole=explode("[","$pole[3] $pole[4] $pole[5] $pole[6] $pole[7] $pole[8] $pole[9]"); 30 $hrac_pole=explode("Player:",$data[$radek]); 31 $hrac=explode(" ",$hrac_pole[1]); 32 $vybran_pole=explode("Selected:",$data[$radek]); 33 $vybran=explode(" ",$vybran_pole[1]); 20 if($pole[3] == 'announce') $prikaz = 'announce ...'; 21 else 22 { 23 $prikaz = explode('[', $pole[3].' '.$pole[4].' '.$pole[5].' '.$pole[6].' '.$pole[7].' '.$pole[8].' '.$pole[9]); 24 $prikaz = $prikaz[0]; 25 } 34 26 35 if($vybran[1]=="player"): 36 $guid_pole=explode("GUID:",$vybran_pole[1]); 37 $guid=explode(")]",$guid_pole[1]); 27 $prikaz_pole = explode('[', $pole[3].' '.$pole[4].' '.$pole[5].' '.$pole[6].' '.$pole[7].' '.$pole[8].' '.$pole[9]); 28 $hrac_pole = explode('Player:', $data[$radek]); 29 $hrac = explode(' ', $hrac_pole[1]); 30 $vybran_pole = explode('Selected:', $data[$radek]); 31 $vybran = explode(' ', $vybran_pole[1]); 38 32 39 mysql_connect($SQL_Server, $SQL_Uzivatel, $SQL_Heslo); 40 mysql_select_db($Databaze_characters); 41 mysql_query("SET NAMES 'utf8'"); 42 $pocet = mysql_num_rows(mysql_query("SELECT guid FROM characters where guid=$guid[0]")); 43 if($pocet!=0): 44 $query = mysql_query("SELECT * FROM characters where guid=$guid[0]"); 45 while ($radek = mysql_fetch_array($query) ) { 46 $vybran_radek = $radek['name']; 47 $vybran = "hráč $vybran_radek"; 48 } 49 else: 50 $vybran = "<i>neznámý hrác</i>"; 51 endif; 52 else: 53 $vybran = $vybran[1]; 54 endif; 33 if($vybran[1] == 'player') 34 { 35 $guid_pole = explode('GUID:', $vybran_pole[1]); 36 $guid = explode(')]', $guid_pole[1]); 37 38 $DbResult = $db->query('SELECT name FROM characters WHERE guid='.$guid[0]); 39 if($DbResult->num_rows > 0) 40 { 41 $radek = $DbResult->fetch_assoc(); 42 $vybran_radek = $radek['name']; 43 $vybran = 'hráč '.$vybran_radek; 44 } else $vybran = '<i>neznámý hráč</i>'; 45 } else $vybran = $vybran[1]; 55 46 56 echo"<tr><td align=center>$pole[0] $pole[1]<td align=center>$prikaz<td align=center>$hrac[1]<td align=center>$vybran</tr>";57 $i = $i+1;58 $radku = $radku-1;47 echo('<tr><td>'.$pole[0].' '.$pole[1].'</td><td>'.$prikaz.'</td><td>'.$hrac[1].'</td><td>'.$vybran.'</td></tr>'); 48 $i = $i + 1; 49 $radku = $radku - 1; 59 50 } 60 echo "</table>";51 echo('</table>'); 61 52 62 53 ?>
Note:
See TracChangeset
for help on using the changeset viewer.