PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 5th, 2005, 04:55 PM
Malek Malek is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 8 Malek User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 10 m 18 sec
Reputation Power: 0
readdir help

Hi people. I need some help with a readdir script.

The script I already have used on the site for a different section looks like this:

<?php

$date = date("md");

$handle=opendir('events');

while (($file = readdir($handle))!==false) {

if ($file >= $date) {

include("events/$file");

}

}

closedir($handle);

?>

It compares the current month-day to the files which are named in the month-day format so that it displays only events that are current. What I need now is a script which only displays about 21 of the newest files, so that it doesn't ruin the sites layout. Also is there a way to designate in the files which one is the newest without putting it in the file name?

Each file listing needs to be a link to that file, how would you accomplish this?

Thanks.
PS: Is there a way to get the readdir function to display the files in chronological order?



Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > readdir help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway