Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Sorry I can't try this solution right now, but it should be something like:</p> <pre><code>&lt;?php function getPictures() { global $page, $per_page, $has_previous, $has_next, $DirFoto, $DirThumb; if ( $handle = opendir($DirFoto) ) { $images = array(); # empty data structure while(($file = readdir($handle)) !== false ) { if ( !is_dir($file) &amp;&amp; ($type = getPictureType($file)) != '' ) # only for images $exif = exif_read_data("$DirFoto/$file", 0, true); $date = $exif['IFD0']['DateTime']; # everything you like to be ordered $images[$file] = $date; # associate each file to its date } } asort($images); # sort the structure by date echo '&lt;ul id="pictures"&gt;'; $skip = $page * $per_page; if ( $skip != 0 ) $has_previous = true; $count = 0; while ( $count &lt; $skip &amp;&amp; ($file = array_shift($images)) !== false ) { if ( !is_dir($file) &amp;&amp; ($type = getPictureType($file)) != '' ) $count++; } # $count = 0;# (???) while ( $count &lt; $per_page &amp;&amp; ($file = array_shift($images)) !== false ) { $exif = exif_read_data("$DirFoto/$file", 0, true); # it could be avoided if ( ! is_dir($DirThumb) ) { mkdir($DirThumb); } if ( ! file_exists($DirThumb.'/'.$file) ) { makeThumb( $file, $type ); } echo '&lt;li&gt;&lt;a href="'.$DirFoto.'/'.$file.'" title="Photo taken on '.date("F d Y, H:i:s", strtotime($exif['IFD0']['DateTime'])).'"&gt;'; echo '&lt;img src="'.$DirThumb.'/'.$file.'" alt="'.date("F d Y, H:i:s", strtotime($exif['IFD0']['DateTime'])).'"/&gt;'; echo '&lt;/a&gt;&lt;/li&gt;'; $count++; } echo '&lt;/ul&gt;'; while ( ($file = readdir($handle)) !== false ) { if ( !is_dir($file) &amp;&amp; ($type = getPictureType($file)) != '' ) { $has_next = true; break; } } } } ?&gt; </code></pre> <p>Please give me a feedback on that. Cheers, Riccardo</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload