Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,605 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 930 people online right now. Registration is fast and FREE... Join Now!




Php/ Filesystem Project

 
Reply to this topicStart new topic

Php/ Filesystem Project

bazooka tooth
post 16 Oct, 2002 - 11:00 PM
Post #1


risky operation, but worth it.

*****
Joined: 1 Oct, 2002
Posts: 1,205


My Contributions


alright.. i'm not looking for anyone to write code for me here or anything, so don't get that idea.. im just looking for ideas on whats the best way to go about this before i throw a lot of time into it...

i need to list a unix directory(that will probably have a whole lot of files in it)
and
allow each of those files to be able to be selected somehow
and
their exact filenames (not locations) to be stored in a variable.

this is all going to be done via a website that is already in place.
::smoosh!::
User is offlineProfile CardPM

Go to the top of the page

Taranis
post 17 Oct, 2002 - 05:25 AM
Post #2


New D.I.C Head

*
Joined: 15 Oct, 2002
Posts: 14

You might download Andromeda and take a look at how it parses a file folder. The interface is nicely done as well. The script itself is highly configurable for filetypes and such.

You might could strip it down and then get some ideas from how he parses the filestructure. I would think you would want to give him some credit if his ideas inspire you.
User is offlineProfile CardPM

Go to the top of the page

bazooka tooth
post 17 Oct, 2002 - 06:07 AM
Post #3


risky operation, but worth it.

*****
Joined: 1 Oct, 2002
Posts: 1,205


My Contributions


Thanks.. I think I'll buy it and spend all day at work deconstructing the code.
User is offlineProfile CardPM

Go to the top of the page

Taranis
post 17 Oct, 2002 - 06:46 AM
Post #4


New D.I.C Head

*
Joined: 15 Oct, 2002
Posts: 14

QUOTE(mudslideslim @ Oct 17 2002, 08:07 AM)
Thanks.. I think I'll buy it and spend all day at work deconstructing the code.

Is that sarcasm? I was just trying to help.

You can download a free version.
User is offlineProfile CardPM

Go to the top of the page

bazooka tooth
post 17 Oct, 2002 - 08:45 AM
Post #5


risky operation, but worth it.

*****
Joined: 1 Oct, 2002
Posts: 1,205


My Contributions


No, I was totally serious. That's what I've been working on today.. I even showed my boss and let him know what I was up to.
User is offlineProfile CardPM

Go to the top of the page

bazooka tooth
post 17 Oct, 2002 - 09:59 AM
Post #6


risky operation, but worth it.

*****
Joined: 1 Oct, 2002
Posts: 1,205


My Contributions


One problem.. its not opensource. Still open for suggestions guys, that was a wee bit too much.
User is offlineProfile CardPM

Go to the top of the page

Taranis
post 17 Oct, 2002 - 10:13 AM
Post #7


New D.I.C Head

*
Joined: 15 Oct, 2002
Posts: 14

Do you know Perl? You might could adapt some of these ideas and find analogous methods in PHP.

Here's something I found in Perl that parses the filestructure: http://www.tech-geeks.org/contrib/mdrone/e...dex/Readme.html

It is open-source under a GPL, so you could use it to build off of.

I hate be presumptuous or condescending, but you might also familiarize yourself with all the php filesystem functions. I find when starting to develop functionality I haven't worked on before that getting a handle on all the built-in abilities of the language for that task can spur inspiration.
User is offlineProfile CardPM

Go to the top of the page

skrilla
post 17 Oct, 2002 - 12:33 PM
Post #8


boots.

*****
Joined: 5 Jul, 2002
Posts: 2,848



Dream Kudos: 14
My Contributions


PHP.net search for 'file' in the 'function search' box. it will give you all sorts of fun things to learn and do. the ultimate PHP resource. go for it! :t_up:

pirate.gif
User is offlineProfile CardPM

Go to the top of the page

skyhawk133
post 17 Oct, 2002 - 12:55 PM
Post #9


Head DIC Head

Group Icon
Joined: 17 Mar, 2001
Posts: 14,846



Thanked 45 times

Dream Kudos: 1650

Expert In: Web Development

My Contributions


we use a similar system for our newsletter script, it takes the names of files in a newsletter directory and actually parses them into a readable date, but we load it into an array, I think I used the file function for the task.

*goes to find code*
User is offlineProfile CardPM

Go to the top of the page

skyhawk133
post 17 Oct, 2002 - 12:57 PM
Post #10


Head DIC Head

Group Icon
Joined: 17 Mar, 2001
Posts: 14,846



Thanked 45 times

Dream Kudos: 1650

Expert In: Web Development

My Contributions


k, here is the entire thing... take out the date functions and such and you've got what you need f00

CODE
<?

     $handle=opendir('/hsphere/local/home/dreaminc/home.dreamincode.net/newsletters');

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

   if ($file != "." && $file != ".."

&& $file != "newsletters.php") {

       $filename = str_replace("_"," ",$file);

                   $month = substr("$filename", 0, 2);

       $day = substr("$filename", 2, 2);

       $year = substr("$filename", 4, 2);

       $year = "20".$year;

       $newsletter_date = mktime (0,0,0,$month,$day,$year);

       $newsletter_date = date("F d, Y", $newsletter_date);

       $filename = str_replace(".php","",$filename);

       echo "<li><b><a href='/newsletters/$file' target=_blank>$newsletter_date</a></b></li>";

   }

     }

     closedir($handle);

?>
User is offlineProfile CardPM

Go to the top of the page

gneato
post 17 Oct, 2002 - 09:09 PM
Post #11


<title>Untitled Document</title>

*****
Joined: 3 Sep, 2001
Posts: 1,311

Chris, that will only work for 97 more years! crazy.gif

biggrin.gif
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 02:18AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month