Changeset 365 for trunk/log.php
- Timestamp:
- Mar 9, 2010, 11:29:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/log.php
r357 r365 6 6 { 7 7 $Items = array(); 8 if(array_key_exists('type', $_GET)) $Where = ' WHERE ` type` = "'.($_GET['type'] * 1).'"';8 if(array_key_exists('type', $_GET)) $Where = ' WHERE `Type` = "'.($_GET['type'] * 1).'"'; 9 9 else $Where = ''; 10 $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';10 $sql = 'SELECT *,UNIX_TIMESTAMP(`Date`), (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `Log`.`User`) AS `User` FROM `Log`'.$Where.' ORDER BY `Date` DESC LIMIT 100'; 11 11 $ID = $Database->SQLCommand($sql); 12 12 while($Line = mysql_fetch_assoc($ID)) 13 13 { 14 $DbResult = $Database->SQLCommand('SELECT * FROM `LogType` WHERE `Id`='.$Line[' type']);14 $DbResult = $Database->SQLCommand('SELECT * FROM `LogType` WHERE `Id`='.$Line['Type']); 15 15 $LogType = mysql_fetch_assoc($DbResult); 16 16 17 17 $Items[] = array 18 18 ( 19 'Title' => strip_tags($LogType['Name'].': '.$Line[' text'].' ('.$Line['user'].', '.$Line['IP'].')'),19 'Title' => strip_tags($LogType['Name'].': '.$Line['Text'].' ('.$Line['Name'].', '.$Line['IP'].')'), 20 20 'Link' => $Config['Web']['BaseURL'].'log.php', 21 'Description' => $LogType['Name'].': '.$Line[' text'].' ('.$Line['user'].', '.$Line['IP'].')',22 'Time' => $Line['UNIX_TIMESTAMP( date)'],21 'Description' => $LogType['Name'].': '.$Line['Text'].' ('.$Line['Name'].', '.$Line['IP'].')', 22 'Time' => $Line['UNIX_TIMESTAMP(Date)'], 23 23 ); 24 24 } … … 39 39 if(array_key_exists('group', $_GET)) $_SESSION['group'] = $_GET['group']; 40 40 41 if($_SESSION['type'] != '') $WhereType = ' ` type`='.$_SESSION['type'];41 if($_SESSION['type'] != '') $WhereType = ' `Type`='.$_SESSION['type']; 42 42 else $WhereType = '1=1'; 43 43 … … 61 61 else 62 62 { 63 if(array_key_exists('group', $_SESSION)) $Where = ' WHERE ` text` LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"';63 if(array_key_exists('group', $_SESSION)) $Where = ' WHERE `Text` LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"'; 64 64 else $Where = ''; 65 65 } 66 66 //if(($Where != '') and (array_key_exists('group', $_SESSION))) $Where .= ' AND text LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"'; 67 67 68 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ` log` '.$Where);68 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Log` '.$Where); 69 69 $DbRow = mysql_fetch_row($DbResult); 70 70 $PageList = GetPageList($DbRow[0]); … … 75 75 array('Name' => 'date', 'Title' => 'Čas'), 76 76 array('Name' => 'text', 'Title' => 'Text'), 77 array('Name' => ' user', 'Title' => 'Uživatel'),77 array('Name' => 'User', 'Title' => 'Uživatel'), 78 78 array('Name' => 'IP', 'Title' => 'Adresa'), 79 79 ); … … 82 82 echo($Order['Output']); 83 83 84 $sql = 'SELECT *, `LogType`.`Color` AS `LogColor`, (SELECT ` user`.`user` FROM `user` WHERE `user`.`id` = `log`.`user`) AS `user` FROM `log` LEFT JOIN `LogType` ON `LogType`.`Id`=`log`.`type` '.$Where.$Order['SQL'].$PageList['SQLLimit'];84 $sql = 'SELECT *, `LogType`.`Color` AS `LogColor`, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `Log`.`User`) AS `User` FROM `Log` LEFT JOIN `LogType` ON `LogType`.`Id`=`Log`.`Type` '.$Where.$Order['SQL'].$PageList['SQLLimit']; 85 85 //echo($sql); 86 86 $ID = $Database->SQLCommand($sql); 87 87 while($Line = mysql_fetch_assoc($ID)) 88 88 { 89 echo('<tr><td>'.$Line[' date'].'</td><td><span style="color: '.$Line['LogColor'].'">'.$Line['text'].'</span></td><td>'.$Line['user'].'</td><td>'.$Line['IP'].'</td></tr>');89 echo('<tr><td>'.$Line['Date'].'</td><td><span style="color: '.$Line['LogColor'].'">'.$Line['Text'].'</span></td><td>'.$Line['Name'].'</td><td>'.$Line['IP'].'</td></tr>'); 90 90 } 91 91 echo('</table>');
Note:
See TracChangeset
for help on using the changeset viewer.