1 | <?php
|
---|
2 |
|
---|
3 | $gmlog = $Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['GMCommandsLog'];
|
---|
4 | $pocet_radku = 50; //KOLIK RADKU Z LOGU SE BUDE ZOBRAZOVAT
|
---|
5 |
|
---|
6 | echo('<img src="imgs/gm.jpg" alt="gm" /><br />');
|
---|
7 | echo($server->RealmSelection());
|
---|
8 | echo('<table class="BaseTable"><tr><th>Čas</th><th>Příkaz</th><th>GM</th><th>Vybrán</th></tr>');
|
---|
9 |
|
---|
10 | $data = file($gmlog);
|
---|
11 | $radku = count($data);
|
---|
12 | $i = 0;
|
---|
13 |
|
---|
14 | $db->select_db($Config['Mangos']['DatabaseCharacters']);
|
---|
15 |
|
---|
16 | while($i < $pocet_radku)
|
---|
17 | {
|
---|
18 | $radek = $radku - 1;
|
---|
19 | $pole = explode(' ', $data[$radek]);
|
---|
20 |
|
---|
21 | if($pole[3] == 'announce') $prikaz = 'announce ...';
|
---|
22 | else
|
---|
23 | {
|
---|
24 | $prikaz = explode('[', $pole[3].' '.$pole[4].' '.$pole[5].' '.$pole[6].' '.$pole[7].' '.$pole[8].' '.$pole[9]);
|
---|
25 | $prikaz = $prikaz[0];
|
---|
26 | }
|
---|
27 |
|
---|
28 | $prikaz_pole = explode('[', $pole[3].' '.$pole[4].' '.$pole[5].' '.$pole[6].' '.$pole[7].' '.$pole[8].' '.$pole[9]);
|
---|
29 | $hrac_pole = explode('Player:', $data[$radek]);
|
---|
30 | $hrac = explode(' ', $hrac_pole[1]);
|
---|
31 | $vybran_pole = explode('Selected:', $data[$radek]);
|
---|
32 | $vybran = explode(' ', $vybran_pole[1]);
|
---|
33 |
|
---|
34 | if($vybran[1] == 'player')
|
---|
35 | {
|
---|
36 | $guid_pole = explode('GUID:', $vybran_pole[1]);
|
---|
37 | $guid = explode(')]', $guid_pole[1]);
|
---|
38 |
|
---|
39 | $DbResult = $db->query('SELECT name FROM characters WHERE guid='.$guid[0]);
|
---|
40 | if($DbResult->num_rows > 0)
|
---|
41 | {
|
---|
42 | $radek = $DbResult->fetch_assoc();
|
---|
43 | $vybran_radek = $radek['name'];
|
---|
44 | $vybran = 'hráč '.$vybran_radek;
|
---|
45 | } else $vybran = '<i>neznámý hráč</i>';
|
---|
46 | } else $vybran = $vybran[1];
|
---|
47 |
|
---|
48 | echo('<tr><td>'.$pole[0].' '.$pole[1].'</td><td>'.$prikaz.'</td><td>'.$hrac[1].'</td><td>'.$vybran.'</td></tr>');
|
---|
49 | $i = $i + 1;
|
---|
50 | $radku = $radku - 1;
|
---|
51 | }
|
---|
52 | echo('</table>');
|
---|
53 |
|
---|
54 | ?>
|
---|