Jump to content

creating double spaces based on day file was modified


hellonoko

Recommended Posts

I have a simple script that list a directories contents.

I am trying to cause it to insert double <br> tags whenever it detects files of a different day.

 

Thus grouping the files by day modified.

 

$olddate = 0;

   	foreach($arr as $key => $value) 
{
     
	if ( $key !== "filelist3.php" && $key !== "index.php" )
	{



		print "<object type=\"application/x-shockwave-flash\" data=\"http://www.sharingizcaring.com/button/musicplayer.swf?&song_url=http://www.sharingizcaring.com/REPOSITORY/$key&b_colors=,,ff0000,&\" width=\"17\" height=\"17\"";
         	print "<param name=\"movie\" value=\"http://www.sharingizcaring.com/button/musicplayer.swf?&song_url=http://www.sharingizcaring.com/REPOSITORY/$key&b_colors=,,ff0000,&\"</object>";

         	//print "<img src=\"noflash.gif\" width=\"17\" height=\"17\" alt=\"\" />";
         	print "<span class=small_font><a href=\"http://www.sharingizcaring.com/REPOSITORY/$key\" class=".color()."> $key</a></span>";



		echo $date = date("d", filemtime($key));

		echo "<br>";

		if ( $date !== $olddate && $olddate !== 0 )
		{
			echo "<br>";
		}

		$olddate = $date;
	}
   	} 

 

It compares the modified day of the current file to that of the last one and if it finds a difference it causes a second <br>

 

For some reason I can't get the second <br> to appear in the correct spot though. It is always one line too low.

 

http://www.sharingizcaring.com/REPOSITORY/

 

Any ideas?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.