<span class='pages'>第 <?php echo $cur_page; ?> 页，共 <?php echo $page['num']; ?> 页</span>

<?php if($page['num']<=5 && $page['num']>1):?>
	<?php for($i=1;$i <= $page['num'];$i++):?>
		<?php if($cur_page == $i) {echo '<span class="current">'.$cur_page.'</span>';continue;}?>
		<a href='<?php echo $page['num-'.$i] ?>' class='page smaller'><?php echo $i; ?></a>
	<?php endfor;?>
<?php else:?>

	<?php if($page['num']>5 && ($cur_page-2)>1):?>
		<a href='<?php echo $page['home']; ?>' class='first'>&laquo; 最新</a>	
		<a href='<?php echo $page['previous']; ?>' class='previouspostslink'>&laquo;</a>	
		<span class='extend'>...</span>
	<?php endif;?>
	
	<?php if(($cur_page+1)>$page['num'] && $page['num']>=5):?><a href='<?php echo $page['num-'.($cur_page-4)] ?>' class='page smaller'><?php echo ($cur_page-4); ?></a><?php endif?>
	<?php if( (($cur_page+2)>$page['num'] && $page['num']>=5)):?><a href='<?php echo $page['num-'.($cur_page-3)] ?>' class='page smaller'><?php echo ($cur_page-3); ?></a><?php endif?>
	<?php if(($cur_page-2)>=1):?><a href='<?php echo $page['num-'.($cur_page-2)] ?>' class='page smaller'><?php echo ($cur_page-2); ?></a><?php endif?>
	<?php if(($cur_page-1)>=1):?><a href='<?php echo $page['num-'.($cur_page-1)] ?>' class='page smaller'><?php echo ($cur_page-1); ?></a><?php endif?>
	
	<span class='current'><?php echo $cur_page; ?></span>
	
	<?php if(!(($cur_page+1)>$page['num'])):?>
	<a href='<?php echo $page['num-'.($cur_page+1)] ?>' class='page larger'><?php echo ($cur_page+1); ?></a>
	<?php endif;?>
	<?php if(!(($cur_page+2)>$page['num'])):?>
	<a href='<?php echo $page['num-'.($cur_page+2)] ?>' class='page larger'><?php echo ($cur_page+2); ?></a>
	<?php endif;?>
	<?php if( (!(($cur_page-2)>=1) && $page['num']>=5) ):?><a href='<?php echo $page['num-'.($cur_page+3)] ?>' class='page larger'><?php echo ($cur_page+3); ?></a><?php endif?>
	<?php if(!(($cur_page-1)>=1) && $page['num']>=5):?><a href='<?php echo $page['num-'.($cur_page+4)] ?>' class='page larger'><?php echo ($cur_page+4); ?></a><?php endif?>
	
	<?php if($page['num'] >5 && ($cur_page+2)<$page['num']):?>
		<span class='extend'>...</span>
		<a href='<?php echo $page['next']; ?>' class='nextpostslink'>&raquo;</a>
		<a href='<?php echo $page['end'] ?>' class='last'>最旧 &raquo;</a>
	<?php endif;?>

<?php endif;?>	