»Forumlar »SE ? Core Labs »Alternative Pagination Function
  https://seditio.com.tr/eski1/forums.php?m=posts&q=1787
          Geri Dön      -      Sayfayı Yazdırmak için tıklayın
Author: Kaan, Posted: 2012-01-28 01:47 GMT. This post was edited by Kaan (2012-03-11 22:01 GMT, 5162 Gün ago)
?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."&amp;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."&amp;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."&amp;d=".(($n-1)*$perpage)."\">".$n."</a></li>";
}
return ($res);
}

Yazar: Alexander
Author: LocaL, Posted: 2012-01-28 01:48 GMT.
Turkcesi yada Azericesi yoqmuydu aceba
Author: Kaan, Posted: 2012-01-28 02:06 GMT.
Gerek yok yapman gereken fonksiyondaki 2200 sat?rdaki kodlar? bununla de?i?tirmen.
Author: kors@n, Posted: 2012-03-11 15:05 GMT.
sed 160 ta ?al??m?yor bu hata veriyor
Author: Kaan, Posted: 2012-03-11 22:03 GMT.
Kodlar? rekli yapt?g?m i?in kodlarda ters slash karakter de?i?tiriyor ondan olabilir orjinal sayfas?ndan edinebilirsiniz.
Go: http://www.neocrome.net/forums.p.....s&q=27661
Yada kodlar? d?zenledim tekrar deneyebilirsiniz.

Powered by SeditioPrint version