rendered paste body public function KaPage($Kategorie) { $p = (!empty($_GET['p'])) ? $_GET['p'] : 1; switch ($Kategorie) { case "news": $MyTable = 'karanews'; $MyPage = './index.php'; break; } $KaData = $this->KaQuery('SELECT COUNT(*) AS NbrData FROM '.$MyTable); $KaMsgs = mysql_fetch_array($KaData); $KaMsgs = $KaMsgs['NbrData']; $NbrPage = ceil($KaMsgs/$this->KaLimit); for ($i=1;$i<=$NbrPage;$i++) { if ($i != $p) { echo '<a href="'.$MyPage.'?p='.$i.'">'.$i.'</a> '; } else { echo $i.' '; } } $KaOne = ($p-1) * $this->KaLimit; $KaData = $this->KaQuery('SELECT * FROM '.$MyTable.' ORDER BY id DESC LIMIT '.$KaOne.','.$this->KaLimit); while ($MyData = mysql_fetch_array($KaData)) { $News = substr($MyData['texte'],0,150); echo '<table width="531" border="0"><tr><td width="88" rowspan="2"><img src="'.$MyData['img'].'" alt="" width="88" height="88" /></td> <td width="345"><p>'.$MyData['titre'].'</p> </td><td width="84"><p>'.$MyData['date'].'</p></td></tr><tr> <td colspan="2" valign="top"><p>'.$News.'...</p></td></tr><tr><td> </td> <td colspan="2"><a href="./actualite/?id='.$MyData['id'].'"><img src="images/details.png" border="0" alt="" width="100" height="25" /></a></td></tr></table>'; } for ($i=1;$i<=$NbrPage;$i++) { if ($i != $p) { echo '<a href="'.$MyPage.'?p='.$i.'">'.$i.'</a> '; } else { echo $i.' '; } } }