Legend:
- Unmodified
- Added
- Removed
-
news.php
r16 r47 6 6 { 7 7 global $Database; 8 echo('<strong>Aktuality:</strong>');9 echo('<div style="NewsTable">');8 $ItemPerPage = 6; 9 if(array_key_exists('Page', $_GET)) $Page = $Database->real_escape_string($_GET['Page']); else $Page = 0; 10 10 $Database->select_db('wow'); 11 $Result = $Database->query('SELECT news.*, user.User as username FROM news JOIN user ON user.ID=news.user WHERE 1 ORDER BY time DESC LIMIT 6'); 12 while($Row = $Result->fetch_array()) 11 $DbResult = $Database->query('SELECT COUNT(*) FROM news'); 12 $Total = $DbResult->fetch_array(); 13 $Total = $Total[0]; 14 15 $Result = '<strong>Aktuality:</strong>'; 16 $Result .= '<div style="NewsTable">'; 17 $DbResult = $Database->query('SELECT news.*, user.User as username FROM news JOIN user ON user.ID=news.user WHERE 1 ORDER BY time DESC LIMIT '.($Page * $ItemPerPage).','.$ItemPerPage); 18 while($Row = $DbResult->fetch_array()) 13 19 { 14 echo('<div class="NewsItem">');20 $Result .= '<div class="NewsItem">'; 15 21 if($Row['long_text'] != '') $Row['title'] = '<a href="?new_id='.$Row['id'].'">'.$Row['title'].'</a>'; 16 echo('<div class="NewsItemTitle"><strong>'.$Row['title'].'</strong> ('.HumanDate($Row['time']).')</div>');17 echo($Row['short_text'].' ('.$Row['username'].')</div>');22 $Result .= '<div class="NewsItemTitle"><strong>'.$Row['title'].'</strong> ('.HumanDate($Row['time']).')</div>'; 23 $Result .= $Row['short_text'].' ('.$Row['username'].')</div>'; 18 24 } 19 echo('</div>'); 25 $Result .= '</div>'; 26 $Result .= PagesList('?Page=', $Page, $Total, $ItemPerPage); 27 return($Result); 20 28 } 21 29
Note:
See TracChangeset
for help on using the changeset viewer.