Пример #1
0
    $str .= createPageFor($p, $page, $page_size, $count);
}
if ($start_page > 0) {
    echo createPageFor(0, $page, $page_size, $count);
}
// add page 0 if not in list
if ($start_page > 1) {
    echo "...";
}
// have some dots if there is a real gap between 0 and the rest
echo $str;
if ($end_page < $very_last_page - 1) {
    echo "...";
}
if ($end_page < $very_last_page) {
    echo createPageFor($very_last_page, $page, $page_size, $count);
}
//add last page if lot in list
?>
</div>

<input type="hidden" name="current_partner_id" id="current_partner_id" value="<?php 
echo $partner_id;
?>
" >

<div id='gallery' style='font-family:verdana;font-size:11px;'>
<table style='border: solid 1px; font-family:verdana;font-size:11px;'><tr>
<?php 
$i = 0;
foreach ($entries as $entry) {
Пример #2
0
$str = "";
$start_page = max ( 0 , $page - 5 );
$very_last_page = $count / $page_size;
$end_page = min ( $very_last_page , $start_page + 10 );
//echo "[$page] [$start_page] [$end_page]";

for ( $p=$start_page ; $p < $end_page ; $p++)
{
	$str .= createPageFor ( $p , $page  , $page_size , $count);
}

if ( $start_page > 0 ) echo createPageFor ( 0, $page , $page_size , $count )  ; // add page 0 if not in list  
if ( $start_page > 1 ) echo "..."; // have some dots if there is a real gap between 0 and the rest
echo $str;
if ( $end_page < $very_last_page -1 ) echo "..."; 
if ( $end_page < $very_last_page ) echo createPageFor ( $very_last_page , $page  , $page_size, $count); //add last page if lot in list
?>
</div>

<input type="hidden" name="current_partner_id" id="current_partner_id" value="<?php 
echo $partner_id;
?>
" >

<div id='gallery' style='font-family:verdana;font-size:11px;'>
<table style='border: solid 1px; font-family:verdana;font-size:11px;'><tr>
<?
$i=0;
foreach ( $entries as $entry ) {	 
?>
<td style="font-size: 11px; width: 150px ; background-color:<?php