Guest User

Untitled

a guest
Jun 13th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. <?php
  2. // Wczytujemy ostatnie newsy
  3. $news = array();
  4.  
  5. foreach($db->query('SELECT * FROM `news` ORDER BY `id` LIMIT 10', PDO::FETCH_ASSOC) as $row)
  6. {
  7. $news[] = array
  8. (
  9. 'tytul' => <a href="index.php?mod=news&act=show&id='$row['id']'">'.$row['tytul'].'</a>',
  10. 'tresc' => skroc($row['tresc']),
  11. 'data' => $row['data']
  12. );
  13. }
  14.  
  15. // Przypisujemy newsy
  16. $tpl->assign('news', $news);
  17.  
  18. // Parsujemy liste
  19. $tpl->parse('news_index.tpl');
Add Comment
Please, Sign In to add comment