Mam takie pliki
index.php oparty o smarty.
/templates/naglowek.tpl
tabela.php - zwykly plik wyświetlający rekordy z pagerem wer. 2.5
/templates/stopka.tpl
Plik index.php
<? $_SESSION['user_logged'] = false; require_once('config.php'); $smarty->display('naglowek.tpl'); // tutaj chciałem stworzyć i wyświetlić tpl z pagerem $smarty->display('stopka.tpl'); ?>
Plik tabela.php wyświetlająca bazę z pagerem.
<?php require_once('Pager.class.php'); require_once('EPager.class.php'); mysql_connect('localhost', 'user', 'pas') or die('Błąd połączenia z bazą danych: '.mysql_error());//host, uzytkownik, haslo $pager = new EPager('id', null, false,$orders); $pager->RecordsPerPage = 10; $sql = 'select * from szukane'; $sql = $pager->Generate($sql); $pager->OrderHeader($headers); echo "<table cellpadding='10' cellspacing='6' style='width: 500px'><tr></div> <th><a href=\"{$headers['id']['LINK']}\">ID</a>".($headers['id']['SORTED'] ? ' <img src="sort_'.$headers['id']['SORTED'].'.gif"/>' : '')."</th> <th><a href=\"{$headers['nazwa']['LINK']}\">NAZWA</a>".($headers['nazwa']['SORTED'] ? ' <img src="sort_'.$headers['nazwa']['SORTED'].'.gif"/>' : '')."</th> <th><a href=\"{$headers['ile']['LINK']}\">POPULARNOŚĆ</a>".($headers['ile']['SORTED'] ? ' <img src="sort_'.$headers['ile']['SORTED'].'.gif"/>' : '')."</th> </tr>"; //wyświetlenie wyników zapytania echo "<tr><td>{$row['id']}</td><td><a href=\"search-mp3,{$row['nazwa']},1.html\" target=\"_blank\">{$row['nazwa']}</a></td><td>{$row['ile']}</td></tr> "; } ?>
Dacie mi jakieś wskazówki
