Mam galerię która ma jest podzielona na strony. jest limit obrazków na stronie
i tym momencie jest tak np:
<< 1 2 3 >> >>-to są znaki do następnej strony , jak zrobić że jak będę miał dużo tych stron to wyświetlało się coś takiego << 1 2 3 ... 10 11 12 >> i np żeby dodać jakieś znaki żeby można iść do początku i do końca stron. np << < 1 2 3 ... 10 11 12 > >>. Poniżej podaje kod który mam.Trochę się z tym już męczę więc dlatego piszę
<?php $database->setQuery("SELECT count(*) " . " FROM #__gallery As a, #__gallery_catg " . " AS ca WHERE a.catid=ca.cid " . " AND a.published=1 " . " AND a.approved=1 " . " AND ca.published=1 " . " AND ca.access<=$gid "); $count = $database->loadResult(); $seitenrest = $count % $ad_perpage; if ($seitenrest > 0) { $gesamtseiten++; } if ($startpage > $gesamtseiten) { $startpage = $gesamtseiten; } else if ($startpage < 1) { $startpage = 1; } } else { $startpage = 1; } $seiterueck = $startpage - 1; if ($seiterueck > 0) { echo "<a href='" . sefRelToAbs("$dgurl&func=cid=$cid&startpage=$seiterueck") . "'><strong>«</strong></a> "; } for ($i = 1; $i <= $gesamtseiten; $i++) { if ($i == $startpage) { } else { } } $seitevor = $startpage + 1; if ($seitevor <= $gesamtseiten) { echo "<a href='" . sefRelToAbs("$dgurl&func=cid=$cid&startpage=$seitevor") . "'><strong>»</strong></a> "; } $start = ($startpage - 1) * $ad_perpage; ?>