so ive got this diretcory full of directories that have tgp galleries in them. and a new directory is created for each gallery and its dated by the system (running linux/apache/php4)... so i want to create an archive directory with subdirectories for each date and then move the directories that have the galleries to the proper archive at the end of the day, or when a button is pushed.
ive got the code that can display the galleries and give them dates. im just not sure how to move them around and create an archive page based on moving them around.
[see www.everybodyneedstgp.com]
<?
require("settings.php");
// Read the directory
$max_number_of_files = 25;
$dirhandle= opendir($confirmed);
$number_of_files = 0;
while($filename = readdir($dirhandle)) {
if ($filename != ".") {
if ($filename != "..") {
$file_names[]="$filename";
$number_of_files ++;
}
}
}
closedir($dirhandle);
// Print the galleries to screen
print ("
<CENTER>
<p>
<hr width=60%>
<p>
<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 WIDTH=60%>
<TR>
<TD ALIGN=left>
");
print("
<center>
<TABLE BORDER=0 width=100% CELLPADDING=4 CELLSPACING=1>
<TR>
<TD BGCOLOR=#cfcfcf width=20%><FONT FACE=\"Arial, Helvetica\" SIZE=3><b>Date Added:</FONT></TD>
<TD BGCOLOR=#cfcfcf width=20%><FONT FACE=\"Arial, Helvetica\" SIZE=3><b># of Pictures:</FONT></TD>
<TD BGCOLOR=#cfcfcf width=60%><FONT FACE=\"Arial, Helvetica\" SIZE=3><b>Gallery Description:</FONT></TD>
</TR>");
// Put the array filenames in the reverse order
if($file_names) {
rsort ($file_names);
for ($i=0; $i < $max_number_of_files; $i++) {
$filehandle = file("$confirmed/$file_names[$i]");
$submitted_info = explode ("|", $filehandle[0]);
// Make the date look prettier
$date_gallery_added = explode("_", $submitted_info[0]);
print("
<TR><TD><FONT FACE=\"Arial, Helvetica\" SIZE=2>$date_gallery_added[0] $date_gallery_added[1] $date_gallery_added[2]</FONT></TD>
<TD><FONT FACE=\"Arial, Helvetica\" SIZE=2>$submitted_info[3] pics</FONT></TD>
<TD><FONT FACE=\"Arial, Helvetica\" SIZE=2><A HREF=\"$submitted_info[5]\">$submitted_info[6]</A></FONT></TD></TR>
");
}
}
print("
</TABLE>
<BR>
<HR>
</TD>
</TR>
</TABLE>
");
?>