3 if(!function_exists("mw_navig")) :
4 function mw_navig($current, $total, $max, $base_url, $start_param, $legende = null){
6 if($max && $total > $max){
9 $legende." ".($current + 1)." à "
10 .(($current + $max) > $total ? $total : $current + $max)
11 ." sur ".$total." - aller à la ";
13 $get_params = array();
14 if(($q = strpos($base_url, "?")) !== false){
15 $v_query = explode("&", substr($base_url, $q + 1));
16 $base_url = substr($base_url, 0, $q);
17 foreach($v_query as $query){
19 $v = explode("=", $query);
20 $get_params[$v[0]] = $v[1];
24 if(isset($get_params[$start_param])) unset($get_params[$start_param]);
26 foreach($get_params as $key => $value) $base_url .= $key."=".$value."&";
27 $nb_pages = ceil($total / $max);
30 ."<select onchange=\"document.location=this.options[this.selectedIndex].value;\">\n";
35 " <option value=\"".$base_url.$start_param."=".$ni."\"".($current >= $ni && $current <= $ni ? " SELECTED" : "").">"
45 "<a href=\"".$base_url.$start_param."=".($current - $max)."\">«</a>\n";
47 if($current < $total - $max){
49 "<a href=\"".$base_url.$start_param."=".($current + $max)."\">»</a>\n";