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. | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
windwaker

Ball and Chain Trooper
WHY ALL THE MAYONNAISE HATE
Level: 61

Posts: 526/1797
EXP: 1860597
For next: 15999

Since: 03-15-04

Since last post: 4 days
Last activity: 6 days
Posted on 12-06-04 03:59 AM Link | Quote
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?
labmaster

Blue Octorok
Level: 12

Posts: 8/43
EXP: 6135
For next: 1786

Since: 07-17-04
From: New Zealand!

Since last post: 10 days
Last activity: 2 min.
Posted on 12-06-04 09:32 AM Link | Quote
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

Ball and Chain Trooper
WHY ALL THE MAYONNAISE HATE
Level: 61

Posts: 534/1797
EXP: 1860597
For next: 15999

Since: 03-15-04

Since last post: 4 days
Last activity: 6 days
Posted on 12-06-04 10:32 PM Link | Quote
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?


(edited by windwaker on 12-06-04 01:51 PM)
(edited by windwaker on 12-06-04 01:52 PM)
(edited by windwaker on 12-06-04 01:52 PM)
(edited by windwaker on 12-06-04 01:52 PM)
Darth Coby

Vire
Dacht je nou echt dat het over was?
Dacht je nou echt dat ik gebroken was? Nee toch?
Nou kijk eens goed op uit je ogen gast.
zonder clic heb je geen kloten tjap... bitch
Level: 55

Posts: 936/1371
EXP: 1240774
For next: 73415

Since: 03-15-04
From: Belgium

Since last post: 2 days
Last activity: 9 hours
Posted on 12-07-04 01:13 AM Link | Quote
Err, can't you just use another array?
windwaker

Ball and Chain Trooper
WHY ALL THE MAYONNAISE HATE
Level: 61

Posts: 539/1797
EXP: 1860597
For next: 15999

Since: 03-15-04

Since last post: 4 days
Last activity: 6 days
Posted on 12-07-04 02:34 AM Link | Quote
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 :\.
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
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.005 seconds.