Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo '<p>';
- $result = $database -> query ('
- SELECT
- SQL_CALC_FOUND_ROWS
- id,
- title,
- date2
- FROM
- ' . $newstable . '
- ORDER BY
- id DESC
- LIMIT
- 2, 20');
- echo '<strong>Archief</strong>' . PHP_EOL;
- echo '<ol>' . PHP_EOL;
- while ($result !== false && $row = $result -> fetch_assoc ())
- {
- $visibleTitle = $row ['title'];
- if (strlen ($visibleTitle) > 13)
- {
- $visibleTitle = substr ($visibleTitle, 0, 12) . '…';
- }
- echo ' <li>' . $row ['date2'] . ' <a href="index.php?action=view&id=' . $row ['id'] . '&page=1" title="' . $row ['title'] . '">' . $visibleTitle . '</a></li>' . PHP_EOL;
- }
- $totalResult = $database -> query ('SELECT FOUND_ROWS()');
- $totalArticles = array_pop ($totalResult -> fetch_row ());
- if ($totalArticles > 21)
- {
- echo ' <li><a href="index.php?action=archief&page=1" title="Archief">Kijk dieper in archief…</a></li>' . PHP_EOL;
- }
- echo '</ol>';
- echo '</p>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement