Changeset 284 for trunk/log.php
- Timestamp:
- Dec 11, 2009, 11:41:03 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/log.php
r250 r284 1 1 <?php 2 2 3 include('includes/global.php'); 4 include('rss.php'); 3 include_once('includes/global.php'); 5 4 6 5 if(array_key_exists('rss', $_GET)) … … 14 13 { 15 14 $Items[] = array 16 17 'Title' => strip_tags($LogTypes[$Line['type']][ 1].': '.$Line['text'].' ('.$Line['user'].', '.$Line['IP'].')'),15 ( 16 'Title' => strip_tags($LogTypes[$Line['type']]['Name'].': '.$Line['text'].' ('.$Line['user'].', '.$Line['IP'].')'), 18 17 'Link' => $Config['Web']['BaseURL'].'log.php', 19 'Description' => $LogTypes[$Line['type']][ 1].': '.$Line['text'].' ('.$Line['user'].', '.$Line['IP'].')',18 'Description' => $LogTypes[$Line['type']]['Name'].': '.$Line['text'].' ('.$Line['user'].', '.$Line['IP'].')', 20 19 'Time' => $Line['UNIX_TIMESTAMP(date)'], 21 20 ); 22 } 21 } 23 22 24 23 echo(GenerateRSS(array … … 32 31 } else 33 32 { 34 if(array_key_exists('Page', $_GET)) $_SESSION['Page'] = $_GET['Page']; 35 else if(!array_key_exists('Page', $_SESSION)) $_SESSION['Page'] = 1; 33 if(array_key_exists('type', $_GET)) $_SESSION['type'] = $_GET['type'] * 1; 34 else if(!array_key_exists('type', $_SESSION)) $_SESSION['type'] = ''; 35 36 36 if(array_key_exists('group', $_GET)) $_SESSION['group'] = $_GET['group']; 37 37 38 if(array_key_exists('type', $_GET)) $_SESSION['type'] = $_GET['type']; 39 else if(!array_key_exists('type', $_SESSION)) $_SESSION['type'] = ''; 40 41 if($_SESSION['type'] <> '') $Type = '&type='.$_SESSION['type']; 42 else { 43 $Type = ''; 44 unset($_SESSION['type'],$_SESSION['group']); 45 } 46 47 $RSSChannels = array(array('Title' => 'Záznamy změn', 'URL' => 'log.php?rss'.$Type)); 38 if($_SESSION['type'] != '') $WhereType = ' `type`='.$_SESSION['type']; 39 else $WhereType = '1=1'; 40 41 $RSSChannels = array(array('Title' => 'Záznamy změn', 'URL' => 'log.php?rss&type='.$_SESSION['type'])); 48 42 ShowPage(); 49 43 … … 54 48 foreach($LogTypes as $Index => $LogItem) 55 49 { 56 echo('<a href="log.php?type='.$ LogItem[0].'" style="color:'.$LogItem[2].'" title="'.$LogItem[3].'">'.$LogItem[1].'</a> ');50 echo('<a href="log.php?type='.$Index.'" style="color:'.$LogItem['Color'].'" title="'.$LogItem['Name'].'">'.$LogItem['Name'].'</a> '); 57 51 } 58 52 } … … 60 54 echo('<br /><br />'); 61 55 62 if(array_key_exists('type', $_SESSION)) $Where = ' WHERE type = "'.$_SESSION['type'].'"';63 56 if(array_key_exists('type', $_SESSION)) $Where = ' WHERE '.$WhereType; 57 else 64 58 { 65 59 if(array_key_exists('group', $_SESSION)) $Where = ' WHERE text LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"'; 66 60 else $Where = ''; 67 61 } 68 62 if(($Where != '') and (array_key_exists('group', $_SESSION))) $Where .= ' AND text LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"'; 69 63 70 $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)*100).',100'; 64 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `log` '.$Where); 65 $DbRow = mysql_fetch_row($DbResult); 66 $PageList = GetPageList($DbRow[0]); 67 68 $sql = 'SELECT *,(SELECT `user`.`user` FROM `user` WHERE `user`.`id` = `log`.`user`) AS `user` FROM `log` '.$Where.' ORDER BY `date` DESC '.$PageList['SQLLimit']; 71 69 72 ListPaging('?Page=', 'log', $Where, 100, $_SESSION['Page']); 70 echo($PageList['Output']); 71 echo('<table class="BaseTable"><tr><th>Čas</th><th>Text</th><th>Uživatel</th><th>Adresa</th></tr>'); 73 72 $ID = $Database->SQLCommand($sql); 74 73 while($Line = mysql_fetch_assoc($ID)) 75 74 { 76 foreach($LogTypes as $Index => $LogItem) 77 { 78 if($Line['type'] == $LogItem[0]) $color = $LogItem[2]; 79 } 80 echo($Line['date'].': <span style="color:'.$color.'">'.$Line['text'].'</span> ('.$Line['user'].', '.$Line['IP'].')<br />'); 75 echo('<tr><td>'.$Line['date'].'</td><td><span style="color:'.$LogTypes[$Line['type']]['Color'].'">'.$Line['text'].'</span></td><td>'.$Line['user'].'</td><td>'.$Line['IP'].'</td></tr>'); 81 76 } 82 //ListPaging('?Page=', 'log', $Where, $Config['Web']['ItemsPerPage'], $_SESSION['Page']); 77 echo('</table>'); 78 echo($PageList['Output']); 83 79 84 80 ShowFooter();
Note:
See TracChangeset
for help on using the changeset viewer.