Jump to content
php.lv forumi

Recommended Posts

Posted

<?
function draw_pages($count, $perpage, $offset = 5){
$pages = ceil($count/$perpage);
if($pages<2){
	return '';
}
$r = '<ul class="pages">';
$page = (empty($_GET['p']) || $_GET['p']<2) ? 1 : $_GET['p'];
$first = $page >= $offset+1 ? $page-$offset : 1;
$last = $page <= $pages-$offset ? $page+$offset : $pages;
if($page>1){
	$r.= sprintf('<li><a href="?p=1">«</a></li><li><a href="?p=%d"><</a></li>', $page-1);
}
for($i=$first;$i<=$last;$i++){
	$r.= sprintf('<li%s><a href="?p=%d">%d</a></li>', $page==$i ? ' class="active"' : '', $i, $i);
}
if($page<$pages){
	$r.= sprintf('<li><a href="?p=%d">></a></li><li><a href="?p=%d">»</a></li>', $page+1, $pages);
}
$r.= '</ul>';
return $r;
}
?>

 

lūk lpp dalīšanu skripts.. bet kā viņu uzstādīt ? kur viņs jāliek ? vinkārši esmu iesācējs..

 

man viņu vaidzētu pielāgot šim skriptam http://paste.php.lv/726036e7946dd89ba663ba...ea5ce1?lang=php

Posted

es tur redzu tikai funkcijas,ievade,izvade un nelielu aprakstu..

 

bet kur tas viss jaaliek lai stradaatu man poljube nesanaak un nezinu vai sanaaks....

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...