cotonti.com : Pagination Increments https://www.cotonti.com Laatste forum onderwerpen Cotonti en Mon, 12 Jan 2026 06:00:39 -0000 aro747
thanks,

aro

Actually I figured this out now. In "functions.admin.php" you can change the "maxrowsperpage" to your liking. Thanks for your help everyone.]]>
Za, 23 Mei 2009 14:42:58 -0000
pieter Za, 23 Mei 2009 13:54:07 -0000 Trustmaster
$i *= ($n % 2) ? 2 : 5;
in function sed_pagination() in system/function.php is responsible for that.

It sets multipliers for numbers. If you replace it with, e.g.
$i *= ($n % 2) ? 4 : 3;
The buttons will go like [1][3][12][36][144]]]>
Za, 23 Mei 2009 12:14:10 -0000
aro747 Za, 23 Mei 2009 10:45:28 -0000 Elgan
but if u want to create a new, make a function named sed_pagination_custom

like so

function pagination_custom($url, $current, $entries, $perpage, $characters = 'd', $onclick = '', $object='')
{
	if($entries <= $perpage)
	{
		return '';
	}
	$each_side = 3; // Links each side
	$address = strstr($url, '?') ? $url . '&amp;'.$characters.'=' : $url . '?'.$characters.'=';

	$totalpages = ceil($entries / $perpage);
	$currentpage = floor($current / $perpage) + 1;
	$cur_left = $currentpage - $each_side;
	if($cur_left < 1) $cur_left = 1;
	$cur_right = $currentpage + $each_side;
	if($cur_right > $totalpages) $cur_right = $totalpages;

	$before = '';
	$pages = '';
	$after = '';
	$i = 1;
	$n = 0;
	while($i < $cur_left)
	{
		$k = ($i - 1) * $perpage;
		$listparam = empty($object) ? '' : 'var list = {data: \'&'.$characters.'='.$k.'\', '.$object.'}; ';
		$strlistparam = empty($object) ? $k : 'list';
		$event = empty($onclick) ? '' : ' onclick="'.$listparam.'return '.$onclick.'('.$strlistparam.');"';
		$before .= '<span class="pagenav_pages"><a href=https://www.cotonti.com/"'.$address.$k.'"'.$event.'>'.$i.'</a></span>';
		$i *= ($n % 2) ? 2 : 5;
		$n++;
	}
	for($j = $cur_left; $j <= $cur_right; $j++)
	{
		$k = ($j - 1) * $perpage;
		$class = $j == $currentpage ? 'current' : 'pages';
		$listparam = empty($object) ? '' : 'var list = {data: \'&'.$characters.'='.$k.'\', '.$object.'}; ';
		$strlistparam = empty($object) ? $k : 'list';
		$event = empty($onclick) ? '' : ' onclick="'.$listparam.'return '.$onclick.'('.$strlistparam.');"';
		$pages .= '<span class="pagenav_'.$class.'"><a href=https://www.cotonti.com/"'.$address.$k.'"'.$event.'>'.$j.'</a></span>';
	}
	while($i <= $cur_right)
	{
		$i *= ($n % 2) ? 2 : 5;
		$n++;
	}
	while($i < $totalpages)
	{
		$k = ($i - 1) * $perpage;
		$listparam = empty($object) ? '' : 'var list = {data: \'&'.$characters.'='.$k.'\', '.$object.'}; ';
		$strlistparam = empty($object) ? $k : 'list';
		$event = empty($onclick) ? '' : ' onclick="'.$listparam.'return '.$onclick.'('.$strlistparam.');"';
		$after .= '<span class="pagenav_pages"><a href=https://www.cotonti.com/"'.$address.$k.'"'.$event.'>'.$i.'</a></span>';
		$i *= ($n % 2) ? 5 : 2;
		$n++;
	}
	$pages = $before . $pages . $after;

	return $pages;
}


then play with these lines,

$i *= ($n % 2) ? 2 : 5;

and edit them to how you want it. just at aglance, id start there. or are u looking for more direct help?]]>
Za, 23 Mei 2009 08:58:43 -0000
aro747 How can I change the current pagination increments in the articles section from 5, 10, 15, etc. to 4, 8, 12, 16...

thanks,

aro]]>
Za, 23 Mei 2009 00:50:13 -0000