Dear Php experts.
Please can any php expert help me modify a simple php Album script, the script can be seen at http://www.regionaltimes.com, it show the image randomly, but interested to have to sort by in series, 1.jpg, 2.jpg … 8.jpg, in other words it works fine for us, but the placement is incorrect that shows the newspaper in the disordered format.
the code has been pasted below.
<?php # SETTINGS $max_width = 200; $max_height = 200; $per_page = 10; $page = $_GET['page']; $has_previous = false; $has_next = false; function getPictures() { global $page, $per_page, $has_previous, $has_next; if ( $handle = opendir(".") ) { $lightbox = rand(); echo '- ';
$count = 0;
$skip = $page * $per_page;
if ( $skip != 0 )
$has_previous = true;
while ( $count < $skip && ($file = readdir($handle)) !== false ) {
if ( !is_dir($file) && ($type = getPictureType($file)) != '' )
$count++;
}
$count = 0;
while ( $count < $per_page && ($file = readdir($handle)) !== false ) {
if ( !is_dir($file) && ($type = getPictureType($file)) != '' ) {
if ( ! is_dir('thumbs') ) {
mkdir('thumbs');
}
if ( ! file_exists('thumbs/'.$file) ) {
makeThumb( $file, $type );
}
echo '
- '; echo ''; echo ' '; $count++; } } echo '