Alternative Pagination Function
|
#6785 |
|
|
Kaan
User is:
Posts: 2772
Meslek: Serbest Meslek
Age: 43
|
?rnek:
1 2 3 4 next page prev page 1 2 3 4 next page 1 2 3 4 5 ... 15 next page prev page 1 2 3 4 5 ... 15 next page prev page 1 ... 5 6 7 8 9 ... 15 next page prev page 1 ... 11 12 13 14 15 what to change? system / functions.php (around line 2200) Kod: function sed_pagination($url, $current, $entries, $perpage) { global $cfg, $L; if ($entries<=$perpage) { return (""); } $def_count_outer = 1; $def_count_inner = 2; /* Initial calculations */ $minblocksize = $def_count_outer + $def_count_inner; $totalpages = ceil($entries / $perpage); $currentpage = ($current / $perpage) + 1; if($currentpage > $totalpages) { $currentpage = $totalpages; } /* Open the division */ $res = "<div id=\"pagination\" class=\"pagination\"><ul>"; /* Create the link to the previous page */ if ($currentpage > 1) { $res .= "<li class=\"page_prev\"><a href=\"".$url."&d=".($current-$perpage)."\">".$L['Previous']."</a></li>"; } /* Create the left link block of the subpages */ if ($currentpage > $minblocksize + 1) { $res .= sed_buildPageLinks($url, 1, $def_count_outer, $perpage); $res .= "<li class=\"page_break\">...</li>"; $res .= sed_buildPageLinks($url, ($currentpage-$def_count_inner), ($currentpage-1), $perpage); } elseif ($currentpage > 1) { $res .= sed_buildPageLinks($url, 1, ($currentpage-1), $perpage); } /* Create the information about the current page */ $res .= "<li class=\"page_current\">".$currentpage."</li>"; /* Create the right link block of the subpages */ if ($currentpage < ($totalpages-$minblocksize)) { $res .= sed_buildPageLinks($url, ($currentpage+1), $currentpage + $def_count_inner, $perpage); $res .= "<li class=\"page_break\">...</li>"; $res .= sed_buildPageLinks($url, $totalpages, $totalpages, $perpage); } else { $res .= sed_buildPageLinks($url, ($currentpage+1), $totalpages, $perpage); } /* Create the link to the next page */ if ($currentpage < $totalpages) { $res .= "<li class=\"page_next\"><a href=\"".$url."&d=".($current+$perpage)."\" title=\"".$L['Next']."\" rel=\"next\">".$L['Next']."</a></li>"; } /* Close the division */ $res .= "</ul></div>"; return ($res); } function sed_buildPageLinks($url, $first, $last, $perpage) { $res = ""; for ($n = $first; $n <= $last; $n++) { $res.="<li><a class=\"page\" href=\"".$url."&d=".(($n-1)*$perpage)."\">".$n."</a></li>"; } return ($res); } Yazar: Alexander Bu mesaj Kaan tarafından 2012-03-11 22:01 GMT, 5162 Gün önce düzenlendi. |
Emlak, Oto Galeri, Rent A Car, ?iir, Edebiyat Script Sipari?lerinizi Verebilirsiniz. Detaylar ??in: kaan@ntka.org Seditio 170 ?ndir Capte M?zik ?ndir Seditio Toolbar ?ndir |













