3; } $dir_parts = explode('.', $section); $dirname = getcwd() . '/' . implode( '/', $dir_parts ) . '/' . 'thumbs'; $rel_dirname = '/' . implode( '/', $dir_parts ); $rel_thumbdir = $rel_dirname . '/thumbs'; $joined_parts = implode( '_', $dir_parts ); $handle = opendir( $dirname ); $match_str = implode('_', $dir_parts); $first_thumbs = array(); $thumbs = array(); while ($file = readdir($handle)) { if( $file == FALSE ) break; if( $file == '.' || $file == '..' ) continue; if( strstr( $file, $match_str ) ){ $basename = preg_replace( '/\..+$/', '', $file ); if( strstr( $file, '_new' ) ){ array_push( $first_thumbs, $basename ); }else{ array_push( $thumbs, $basename ); } } } sort( $first_thumbs ); sort( $thumbs ); $combined = array_merge( $first_thumbs, $thumbs ); $count = count( $combined ); if( $count > 8 ){ $last_page = floor( $count / 8 ) + 1; }else{ $last_page = 1; } ?>
" border="0"> " border="0">