Changeset 67 for trunk/log.php
- Timestamp:
- Feb 5, 2009, 11:12:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/log.php
r49 r67 2 2 3 3 include('includes/global.php'); 4 include('rss.php'); 5 6 if(array_key_exists('rss', $_GET)) 7 { 8 $Items = array(); 9 if(array_key_exists('type', $_GET)) $Where = ' WHERE type = "'.$_GET['type'].'"'; 10 else $Where = ''; 11 $sql = 'SELECT *,UNIX_TIMESTAMP(date), (SELECT user.user FROM user WHERE user.id = log.user) as user FROM log'.$Where.' ORDER BY date DESC LIMIT 100'; 12 $ID = $Database->SQLCommand($sql); 13 while($Line = mysql_fetch_assoc($ID)) 14 { 15 $Items[] = array 16 ( 17 'Title' => $LogTypes[$Line['type']][1], 18 'Link' => $Config['Web']['BaseURL'].'log.php', 19 'Description' => $Line['text'].' ('.$Line['user'].', '.$Line['IP'].')', 20 'Time' => $Line['UNIX_TIMESTAMP(date)'], 21 ); 22 } 23 24 echo(GenerateRSS(array 25 ( 26 'Title' => 'WoWpřeklad', 27 'Link' => $Config['Web']['BaseURL'], 28 'Description' => 'Překlad textů WoW', 29 'WebmasterEmail' => $Config['Web']['AdminEmail'], 30 'Items' => $Items, 31 ))); 32 } else 33 { 34 if(array_key_exists('type', $_GET)) $Type = '&type='.$_GET['type']; 35 else $Type = ''; 4 36 5 echo('<b>Filtr: </b>'); 6 echo('<a href="log.php" title="Bez filtrování"><span style="color:black">Všechny</span></a> '); 7 foreach($LogTypes as $Index => $LogItem) 8 { 9 echo('<a href="log.php?type='.$LogItem[0].'" title="'.$LogItem[3].'"><span style="color:'.$LogItem[2].'">'.$LogItem[1].'</span></a> '); 37 $RSSChannels = array(array('Title' => 'Záznamy změn', 'URL' => 'log.php?rss'.$Type)); 38 ShowPage(); 39 40 if(array_key_exists('Page', $_GET)) $_SESSION['Page'] = $_GET['Page']; 41 else if(!array_key_exists('Page', $_SESSION)) $_SESSION['Page'] = 1; 42 43 echo('<b>Filtr: </b>'); 44 echo('<a href="log.php" title="Bez filtrování"><span style="color:black">Všechny</span></a> '); 45 foreach($LogTypes as $Index => $LogItem) 46 { 47 echo('<a href="log.php?type='.$LogItem[0].'" title="'.$LogItem[3].'"><span style="color:'.$LogItem[2].'">'.$LogItem[1].'</span></a> '); 48 } 49 50 // echo ' Formát: datum: text zprávy (uživatel, IP)<br /><br />'; 51 echo('<br /><br />'); 52 53 if(array_key_exists('type', $_GET)) $Where = ' WHERE type = "'.$_GET['type'].'"'; 54 else $Where = ''; 55 $sql = 'SELECT *,(SELECT user.user FROM user WHERE user.id = log.user) as user FROM log '.$Where.'ORDER BY date DESC LIMIT '.($_SESSION['Page'] - 1) * $Config['Web']['ItemsPerPage'].','.$Config['Web']['ItemsPerPage']; 56 57 ListPaging('?Page=', 'log', $Where, $Config['Web']['ItemsPerPage'], $_SESSION['Page']); 58 $ID = $Database->SQLCommand($sql); 59 while($Line = mysql_fetch_assoc($ID)) 60 { 61 foreach($LogTypes as $Index => $LogItem) 62 { 63 if($Line['type'] == $LogItem[0]) $color = $LogItem[2]; 64 } 65 echo($Line['date'].': <span style="color:'.$color.'">'.$Line['text'].'</span> ('.$Line['user'].', '.$Line['IP'].')<br />'); 66 } 67 //ListPaging('?Page=', 'log', $Where, $Config['Web']['ItemsPerPage'], $_SESSION['Page']); 68 69 ShowFooter(); 10 70 } 11 71 12 // echo ' Formát: datum: text zprávy (uživatel, IP)<br /><br />';13 echo('<br /><br />');14 15 if(array_key_exists('type', $_GET))16 {17 $sql = "SELECT *,(SELECT user.user FROM user WHERE user.id = log.user) as user18 FROM log WHERE type = '".$_GET['type']."' ORDER BY date DESC LIMIT 100";19 // if ($_GET['type'] == $LogItem[0]) { }20 } else $sql = "SELECT *,(SELECT user.user FROM user WHERE user.id = log.user) as user FROM log ORDER BY date DESC LIMIT 100";21 22 $ID = $Database->SQLCommand($sql);23 while($Line = mysql_fetch_array($ID))24 {25 foreach($LogTypes as $Index => $LogItem)26 {27 if($Line['type'] == $LogItem[0]) $color = $LogItem[2];28 }29 echo($Line['date'].': <span style="color:'.$color.'">'.$Line['text'].'</span> ('.$Line['user'].', '.$Line['IP'].')<br />');30 }31 32 ShowFooter();33 34 72 ?>
Note:
See TracChangeset
for help on using the changeset viewer.