Gallérie d’images

" . ucwords( str_replace( "_", " ", $category ) ) . "

\n"; $thumb .= ""; if ($offset!=0) { // first or only page so bypass prev $prevoffset=$offset-$perpage; // $thumb .= "prev | \n"; } for ($i=1;$i<=$pages;$i++) { // make links for however many number of pages there are $newoffset=$perpage*($i-1); // $thumb .= "$i | \n"; } if (!(($offset+$perpage) > $num_of_thumbs) && $pages!=1) { // not last page so display next link $newoffset=$offset+$perpage; // $thumb .= "next\n

"; } $thumb .= ""; $remainder=$num_of_thumbs-$offset; if( $offset+$perpage > $num_of_thumbs ){ for( $i=0; $i<$remainder/$per_row; $i++ ){ // determines how many rows we will need and loops // that many times. $thumb .= ""; for( $x=0; $x<$per_row; $x++ ){ // loop $per_row times in every row $thumb .= ""; if( $offset+1 > $num_of_thumbs ){ // no more pictures, so don't do anything. } else { $thumb .= ""; } $thumb .= ""; $offset++; } $thumb .= ""; } } else { for( $i=0; $i<$perpage/$per_row; $i++ ){ // determines how many rows we will need and loops // that many times. $thumb .= ""; for( $x=0; $x<$per_row; $x++ ){ // loop $per_row times in every row $thumb .= ""; $thumb .= ""; $thumb .= ""; $offset++; } $thumb .= ""; } } $thumb .= ""; echo $thumb; ?>