mój problem z paginacją i skracaniem wygląda następująco:
Prosiłbym o nakierowanie mnie jak użyć klasy nospor'a (poniżej jak ja to robię).
index.php
<? include('templates/newsy.php'); ?> <?php require_once('templates/Pager.class.php'); $sql = 'select count(*) from news'; $recordsCount = $row[0];//pobranie liczby rekordów try{ $pager = new Pager('age'); $pager->SetTotalRecords($recordsCount); $pager->Make(true); $pag = $pager->Render(); $start = $pager->GetIndexRecordStart(); $end = $pager->GetIndexRecordEnd(); } catch (Exception $e) { } //zapytanie z uwzglenieniem stronicowania $sql = 'select * from newsy limit '.$start.','.($end - $start + 1); //...pobranie wyników i ich wyswietlenie ?>
newsy.php
<? function przytnij($zdanie,$ile) { else $dod="..."; for($i=0;$i<$ile;$i++) $wiersz .= " ".$slowa[$i]; return "$wiersz$dod"; } ?> <? { } ?>
Struktura bazy:
id tytul tresc data
Dziękuje za wszelką pomoc.