Changeset 365 for trunk/index.php
- Timestamp:
- Mar 9, 2010, 11:29:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r357 r365 8 8 9 9 $Output = '<strong>Změny systému:</strong><div class="NewsBox">'; 10 $DbResult = $Database->SQLCommand('SELECT news.Time, user.user, news.Text FROM news JOIN user ON user.ID = news.User ORDER BY TimeDESC LIMIT 10');10 $DbResult = $Database->SQLCommand('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10'); 11 11 while($DbRow = mysql_fetch_assoc($DbResult)) 12 $Output .= '<div><strong>'.$DbRow[' user'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')</strong> <br />'.$DbRow['Text'].'</div>';12 $Output .= '<div><strong>'.$DbRow['Name'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')</strong> <br />'.$DbRow['Text'].'</div>'; 13 13 $Output .= '<a href="action.php?action=news">Všechny zprávy</a>'; 14 14 $Output .= '</div>'; … … 21 21 22 22 $Output = '<br /><strong>Poslední překlady:</strong><div class="NewsBox">'; 23 $DbResult = $Database->SQLCommand('SELECT date,user.user,text FROM log JOIN user ON user.ID = log.User WHERE type = 1 ORDER BY dateDESC LIMIT 20');23 $DbResult = $Database->SQLCommand('SELECT `Date`, `User`.`Name`, `Text` FROM `Log` JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 20'); 24 24 while($DbRow = mysql_fetch_assoc($DbResult)) 25 $Output .= '<strong>'.$DbRow[' user'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['date'])).')</strong>26 '.$DbRow[' text'].' <br />';25 $Output .= '<strong>'.$DbRow['Name'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Date'])).')</strong> 26 '.$DbRow['Text'].' <br />'; 27 27 $Output .= '</div>'; 28 28 return($Output); … … 36 36 if($_GET['rss'] == 'news') 37 37 { 38 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP( news.Time), news.Time, user.user, news.Text FROM news JOIN user ON user.ID = news.User ORDER BY TimeDESC LIMIT 10');38 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(`News`.`Time`) AS `UnixTime`, `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10'); 39 39 while($DbRow = mysql_fetch_assoc($DbResult)) 40 40 { 41 41 $Items[] = array 42 42 ( 43 'Title' => $DbRow[' user'].'('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')',43 'Title' => $DbRow['Name'].'('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')', 44 44 'Link' => $Config['Web']['BaseURL'], 45 45 'Description' => $DbRow['Text'], 46 'Time' => $DbRow['U NIX_TIMESTAMP(news.Time)'],46 'Time' => $DbRow['UnixTime'], 47 47 ); 48 48 } … … 58 58 if($_GET['rss'] == 'translation') 59 59 { 60 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP( date), date, user.user, text FROM log JOIN user ON user.ID = log.User WHERE type = 1 ORDER BY dateDESC LIMIT 100');60 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(`Date`) AS `Date`, `User`.`Name` AS `UserName`, `Text` FROM `Log` JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 100'); 61 61 while($DbRow = mysql_fetch_assoc($DbResult)) 62 62 { 63 63 $Items[] = array 64 64 ( 65 'Title' => strip_tags($DbRow[' text'].' ('.$DbRow['user'].')'),65 'Title' => strip_tags($DbRow['Text'].' ('.$DbRow['UserName'].')'), 66 66 'Link' => $Config['Web']['BaseURL'], 67 'Description' => $DbRow[' text'],68 'Time' => $DbRow[' UNIX_TIMESTAMP(date)'],67 'Description' => $DbRow['Text'], 68 'Time' => $DbRow['Date'], 69 69 ); 70 70 } … … 82 82 $TitleLength = 50; 83 83 mb_internal_encoding('utf-8'); 84 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP( date), user, text FROM shoutbox ORDER BY IDDESC LIMIT 20');84 $DbResult = $Database->SQLCommand('SELECT UNIX_TIMESTAMP(`Date`) AS `UnixDate`, `User`, `Text` FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20'); 85 85 while($DbRow = mysql_fetch_assoc($DbResult)) 86 86 { … … 89 89 $Items[] = array 90 90 ( 91 'Title' => $DbRow[' user'].': '.$Title,91 'Title' => $DbRow['User'].': '.$Title, 92 92 'Link' => $Config['Web']['BaseURL'], 93 'Description' => $DbRow[' text'],94 'Time' => $DbRow['U NIX_TIMESTAMP(date)'],93 'Description' => $DbRow['Text'], 94 'Time' => $DbRow['UnixDate'], 95 95 ); 96 96 }
Note:
See TracChangeset
for help on using the changeset viewer.