Ignore:
Timestamp:
Apr 7, 2009, 7:21:24 PM (16 years ago)
Author:
barny
Message:

*Přidán spravce-gmlog.php a spravce-charlog.php na požádání Aphreala..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pages/spravce-gmlog.php

    r559 r560  
    11<?php
     2$soubor = fopen("/a/mangos1/logs/GM_Commands.log", "r");
     3$text = fread($soubor, 1999999);
     4echo($text);
     5fclose($soubor);
     6?>
    27
    3 $gmlog = $Config['Mangos']['GMCommandsLog'];
    4 
    5 
    6 
    7 
    8 $data = file($gmlog);
    9 $radku = count($data);
    10 
    11 
    12 $db->select_db($Config['Mangos']['DatabaseCharacters']);
    13 
    14 
    15 {
    16   $radek = $radku - 1;
    17   $pole = explode(' ', $data[$radek]);
    18 
    19   if($pole[3] == 'announce') $prikaz = 'announce ...';
    20   else
    21   {
    22     $prikaz = explode('[', $pole[3].' '.$pole[4].' '.$pole[5].' '.$pole[6].' '.$pole[7].' '.$pole[8].' '.$pole[9]);
    23     $prikaz = $prikaz[0];
    24   }
    25 
    26   $prikaz_pole = explode('[', $pole[3].' '.$pole[4].' '.$pole[5].' '.$pole[6].' '.$pole[7].' '.$pole[8].' '.$pole[9]);
    27   $hrac_pole = explode('Player:', $data[$radek]);
    28   $hrac = explode(' ', $hrac_pole[1]);
    29   $vybran_pole = explode('Selected:', $data[$radek]);
    30   $vybran = explode(' ', $vybran_pole[1]);
    31 
    32   if($vybran[1] == 'player')
    33   {
    34     $guid_pole = explode('GUID:', $vybran_pole[1]);
    35     $guid = explode(')]', $guid_pole[1]);   
    36    
    37     $DbResult = $db->query('SELECT name FROM characters WHERE guid='.$guid[0]);
    38     if($DbResult->num_rows > 0)
    39     {
    40       $radek = $DbResult->fetch_assoc();
    41       $vybran_radek = $radek['name'];
    42       $vybran = 'hráč '.$vybran_radek;
    43     } else $vybran = '<i>neznámý hráč</i>';
    44   } else $vybran = $vybran[1];
    45 
    46   echo('<tr><td>'.$pole[0].' '.$pole[1].'</td><td>'.$prikaz.'</td><td>'.$hrac[1].'</td><td>'.$vybran.'</td></tr>');
    47   $i = $i + 1;
    48   $radku = $radku - 1;
    49 }
    50 echo('</table>');
    51 
    52 ?>
Note: See TracChangeset for help on using the changeset viewer.