In part of my script i have a script to list all directorys inside of the folder MSG. Its lists them in a table with the pic env.gif next to each one. I know the code is badly formated but i urgantly need to make it list the folders in date order rather than simply in alphabetical order which is done as default. PLEASE please help. Thanks
The following is the code concerned:
if ( $view == 1 ) {
?>
<html>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="90%">
<tr>
<td bgcolor="#8A9AAD"><p align="center"><font
color="#FFFFFF"><strong>FBI ONLINE</strong></font></p>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="90%">
<td class="navtd"><table border="0"
cellpadding="0" cellspacing="0" width="100%">
<TBODY> <tr>
<td align="right"><a
href="index.php?post=1"><font class="navtd">New Post</font></a></td>
</tr>
</TBODY> </table>
</td>
</tr>
</TBODY> </table>
</td>
</tr>
</table>
<table width="90%" border="1" height="28" body bgcolor="#8A9AAD" cellpadding="1" cellspacing="1" bordercolor="#000000">
<tr>
<td width="6%"></td>
<td width="46%"><font color="#FFFFFF"><b>Subject</b></font></td>
<td width="22%"><font color="#FFFFFF"><b>Author</b></font></td>
<td width="26%"><font color="#FFFFFF"><b>Last post</b></font></td>
</tr>
</table>
</html>
<?php
chdir( MSG );
$dh = opendir( "." );
while ( ! ( ( $file = readdir ( $dh ) ) === false ) ) {
if ( is_dir( "$dirname/$file" ) )
print " ";
?>
<html>
</html>
<?php
if ( $file != "." ) {
if ( $file != ".." ) {
?>
<html>
<table width="90%" border="0" height="28" body bgcolor="#8A9AAD">
<tr>
<td width="6%"><img src="env.gif" width="19" height="14"></td>
<td width="46%">
<?php
$nfile = str_replace("~"," ",$file);
echo "<a href='index.php?show=1&item=$file'>$nfile</a>";
?>
</td>
<td width="22%">
<?php
chdir( $file );
include ("author.htm");
chdir( ".." );
?>
</td>
<td width="26%">
<?php
chdir( $file );
include ("last.htm");
chdir( ".." );
?>
</td>
</tr>
</table>
</html>
<?php
$nd == $file;
}
}
}
closedir( $dh );
}