Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - You'll never, ever guess what type of question I'll ask.
  
User name:
Password:
Reply:
 

UserPost
windwaker
Posts: 539/1797
Well, I need to sort the files in the array created by the glob() by the filectime of each file, so I'm not sure if I could do that :\.
Darth Coby
Posts: 936/1371
Err, can't you just use another array?
windwaker
Posts: 534/1797
The "get filename" question was really dumb, as my glob array thing already had the filenames .

Thanks man, that helps tons.

Edit: ack, here's another dilemna (sp).

I have all of these rows, as I used glob. My code is:

<?php
$imagefiles = array_slice (glob ('gallery/*.gif'), $begin1, $end1);
foreach ($imagefiles as $image) {
echo "<img src=$image><br>";
}
?>

Now, I need to add a column that has the filectime in it, so it'd look like this:

filectime filepath
time here path to file
time here path to file

how would I add another column to the array that has the filectime in it?
labmaster
Posts: 8/43
Just to get things straight - the gallery is simply based on putting files into directories - not adding any info in a file or DB?

Showing the filenames should be easy - you'll have them when you open the files, so you can grep those out. To get the 'last modified' time of a file, use filectime (I'm getting this out of my CHM version of the PHP Manual, I suggest you grab a copy if you haven't already).
windwaker
Posts: 526/1797
PHP questions, of course .

So yeah, I'm coding the gallery for my site, and everything's going quite smoothly (I've been able to show all of the gif's in a certain directory, and yadda yadda). But now, I want to make it so it shows two things: one, the filename of the image specified (can I "glob", or so to say, filenames?), and two, the images in order of last updated. Is there a command that'll let me do this?
Acmlm's Board - I2 Archive - Programming - You'll never, ever guess what type of question I'll ask.


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.010 seconds.