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?

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.