max_num_pages;
if ( $max == 1 )
return;
$start = intval( $paged - $range / 2 );
$stop = intval( $paged + $range - $range / 2 );
if ( $start < 1 ) {
$stop = $stop - $start;
$start = 1;
}
if ( $stop > $max ) {
$start = $start - ( $stop - $max ); // fixme check > 0
$stop = $max;
if ( $start < 1 )
$start = 1;
}
if ( $start > 1 ) {
$back = true;
if ( $start > 2 )
$back_separator = true;
}
if ( $stop < $max ) {
$forward = true;
if ( $stop < $max - 1 )
$forward_separator = true;
}
if ( $stop < $start )
return;
if ( $back ) {
echo '';
previous_posts_link( $prevanchor );
echo "\n";
}
else {
echo '';
echo $prevanchor;
echo "\n";
}
if ( $back_separator ) {
echo '1';
echo ' ... ';
}
for ( $i = $start; $i <= $stop; $i++ ) {
echo '$i\n";
}
if ( $forward_separator ) {
echo ' ... ';
echo '' . $max . '';
}
if ( $forward ) {
echo '';
next_posts_link( $nextanchor );
echo "\n";
}
else {
echo '';
echo $nextanchor;
echo "\n";
}
}
?>