Re: here is another question.background story on pictures

by "Darrell King" <darrell(at)webctr.com>

 Date:  Thu, 7 Oct 2004 14:09:16 -0400
 To:  <hwg-techniques(at)mail.hwg.org>
 References:  earthlink earthlink2
  todo: View Thread, Original
That code I sent you should handle that.

Here is the readdir() function I was talking about:

http://us4.php.net/manual/en/function.readdir.php

So, try setting this (replacing the /path/to/files/ as appropriate) up on 
your server, then browse to it and see if the file names are in the order 
you want them:

<?php
$image_names = array();

if ($handle = opendir('/path/to/files')) {
   while (false !== ($file = readdir($handle))) {
    if ($file == '.' || $file == '..') continue;
       $image_names[] = $file;
   }
   closedir($handle);
}

rsort($image_names,SORT_NUMERIC);
reset($image_names);

foreach ($image_names as $a_filename) {
 echo "$a_filename<br />\n";
}

?>

Of course, the output isn't numbered yet, but first things first...:).

D

----- Original Message ----- 
From: "Terry Goode" <tgoode(at)earthlink.net>


We are a bunch of painters and we have what they call "panel jams" where
every one paints a panel and exchanges them once in a while. I have had
a few of the viewers ask that instead of waiting for the last picture to
load RE: bandwidth=dial-up, that i place the "latest" picture to come in
be displayed on the top or first to be displayed.
So i must go in after i get a new picture and move the last picture down
and add the new on to the top and renumber all of them, over and over, etc..
These pictures come into me over a period of several weeks.
the web site..
http://ww.terry-g.net/jam/panel.htm

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.