Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
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 |
| ||
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. |
| ||
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 |
| ||
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: < $imagefiles = array_slice (glob ('gallery/*.gif'), $begin1, $end1); foreach ($imagefiles as $image) { echo "< } ?> Now, I need to add a column that has the filectime in it, so it'd look like this:
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 |
| ||
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 |
| ||
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. | | | |