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!::
Php/ Filesystem Project
Page 1 of 110 Replies - 1734 Views - Last Post: 17 October 2002 - 10:09 PM
Replies To: Php/ Filesystem Project
#2
Re: Php/ Filesystem Project
Posted 17 October 2002 - 06:25 AM
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.
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.
#3
Re: Php/ Filesystem Project
Posted 17 October 2002 - 07:07 AM
Thanks.. I think I'll buy it and spend all day at work deconstructing the code.
#4
Re: Php/ Filesystem Project
Posted 17 October 2002 - 07:46 AM
mudslideslim, on Oct 17 2002, 08:07 AM, said:
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.
#5
Re: Php/ Filesystem Project
Posted 17 October 2002 - 09:45 AM
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.
#6
Re: Php/ Filesystem Project
Posted 17 October 2002 - 10:59 AM
One problem.. its not opensource. Still open for suggestions guys, that was a wee bit too much.
#7
Re: Php/ Filesystem Project
Posted 17 October 2002 - 11:13 AM
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-geek...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.
Here's something I found in Perl that parses the filestructure: http://www.tech-geek...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.
#9
Re: Php/ Filesystem Project
Posted 17 October 2002 - 01:55 PM
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*
*goes to find code*
#10
Re: Php/ Filesystem Project
Posted 17 October 2002 - 01:57 PM
k, here is the entire thing... take out the date functions and such and you've got what you need f00
<?
$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);
?>
#11
Re: Php/ Filesystem Project
Posted 17 October 2002 - 10:09 PM
Chris, that will only work for 97 more years!
Page 1 of 1

New Topic/Question
Reply



MultiQuote



|