Changeset 407 for beta/pages/gmlog.php


Ignore:
Timestamp:
Feb 9, 2009, 6:29:42 PM (16 years ago)
Author:
zork
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • beta/pages/gmlog.php

    r405 r407  
     1
     2
    13<?php
    2 // works only on server ! temp way to beta !!
     4$gmlog = "/a/mangos/log/GM_Commands.log"; //CESTA K GM LOGU
     5$config = "../gh_system/conn.php"; //CESTA KE CONN.PHP
     6$pocet_radku = 50; //KOLIK RADKU Z LOGU SE BUDE ZOBRAZOVAT
     7
     8echo"<table align=center bordercolor='black' border=2><tr><td align=center><strong>Cas</strong><td align=center><strong>Príkaz</strong><td align=center><strong>GM</strong><td align=center><strong>Vybrán</strong></tr>";
     9
     10
     11
     12
    313echo "<img src=\"imgs/gm.jpg\">";
    4 exec("tail -30 /a/mangos/log/GM_Commands.log >> /a/www/wow/beta/server/gmlog.txt");
    5     $fp_c = fopen ("server/gmlog.txt", "r");
    6     $load_log = fread($fp_c, filesize("server/gmlog.txt"));
    7     echo "<center>";
    8     $server -> ShowGmLog($load_log);
    9     echo "</center>";
    10 exec("rm /a/www/wow/beta/server/gmlog.txt"); 
     14include($config);
     15$data = file($gmlog);
     16$radku = count($data);
     17$i = 0;
     18
     19
     20while($i < $pocet_radku){
     21$radek = $radku-1;
     22$pole=explode(" ",$data[$radek]);
     23
     24if($pole[3]=="announce"):
     25$prikaz = "announce ...";
     26else:
     27$prikaz=explode("[","$pole[3] $pole[4] $pole[5] $pole[6] $pole[7] $pole[8] $pole[9]");
     28$prikaz = $prikaz[0];
     29endif;
     30
     31$prikaz_pole=explode("[","$pole[3] $pole[4] $pole[5] $pole[6] $pole[7] $pole[8] $pole[9]");
     32$hrac_pole=explode("Player:",$data[$radek]);
     33$hrac=explode(" ",$hrac_pole[1]);
     34$vybran_pole=explode("Selected:",$data[$radek]);
     35$vybran=explode(" ",$vybran_pole[1]);
     36
     37if($vybran[1]=="player"):
     38$guid_pole=explode("GUID:",$vybran_pole[1]);
     39$guid=explode(")]",$guid_pole[1]);
     40
     41mysql_connect($SQL_Server, $SQL_Uzivatel, $SQL_Heslo);
     42  mysql_select_db($Databaze_characters);
     43  mysql_query("SET NAMES 'utf8'");
     44   $pocet = mysql_num_rows(mysql_query("SELECT guid FROM characters where guid=$guid[0]"));
     45   if($pocet!=0):
     46  $query = mysql_query("SELECT * FROM characters where guid=$guid[0]");
     47           while ($radek = mysql_fetch_array($query) ) {
     48           $vybran_radek = $radek['name'];
     49           $vybran = "hráč $vybran_radek";
     50           }
     51else:
     52$vybran = "<i>neznámý hrác</i>";
     53endif;
     54else:
     55$vybran = $vybran[1];
     56endif;
     57
     58echo"<tr><td align=center>$pole[0] $pole[1]<td align=center>$prikaz<td align=center>$hrac[1]<td align=center>$vybran</tr>";
     59$i = $i+1;
     60$radku = $radku-1;
     61}
     62echo"</table>";
     63
    1164?>
Note: See TracChangeset for help on using the changeset viewer.