ID: 33552 Updated by: [EMAIL PROTECTED] Reported By: badocs at tbaytel dot net -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: Linux PHP Version: 4.3.10 New Comment:
Ask the administrator of the server to report bugs. And this works fine for me. Previous Comments: ------------------------------------------------------------------------ [2005-07-03 22:53:36] badocs at tbaytel dot net I am not the admin of the server, so i cannot do anything to my version of php. I would test it out on a later version...but I looked and the problem has never been brought up before...so it doesn't seem that major. But the solution works, it's just logic really..write the date, get the date, sort the date. ------------------------------------------------------------------------ [2005-07-03 22:13:14] [EMAIL PROTECTED] I can't say I fully understand your explanation, but I still do not see any sense in reporting a problem that could be already fixed. I'd really appreciate if you provide a _short_ test case *and* test it with latest snapshot of PHP4 (also I'd be very thankful if you give a try to latest snapshot of PHP5 too). Thanks in advance. ------------------------------------------------------------------------ [2005-07-03 21:53:58] badocs at tbaytel dot net oo..you can see this working at http://Docs.u13.net. Look at the right side of the tables for the grey boxes. ^^ ------------------------------------------------------------------------ [2005-07-03 21:52:21] badocs at tbaytel dot net I do not have access to the server's php stuff. It's a hosting server. It's alright, i did another solution instead. First off, I figured that since upload is the way stuff gets modified... when a file is uploaded.. $l = "$path/day.txt"; $hand = fopen($l, 'w'); $string = date("ymdHi"); fwrite($hand, $string); fclose($hand); I basically open/create a file and dump the current date and time of the upload. This is actually even better then what i wanted...because new users don't even have this file, so when i pull this textfile out of their directory (or lack thereof), users that uploaded will have a date sorted by year, month, day, hour, minure, while new ones...have nothing. I do this by collecting a list of all the directories i need to check. my directory is /user1 /user2 /user3 scripts to upload display delete rename etc. ---- so, i get the folders (user1, user2, etc..) $i=1; while ($file = readdir($dir_handle)) { if (!strstr($file, '.')) { if ($file!='error_log') { // this narrowed it down to a folder $sitearray[$i]=$file; $i++; } } } closedir($dir_handle); ----- then i proceed to pull out the string in my file (day.txt) out of each user directory for ($ii=1; $ii<$i; $ii++ ) { $toscan="$WWW$sitearray[$ii]"; $dayfile="$WWW$sitearray[$ii]/day.txt"; $handle=fopen($dayfile, "r"); $string=fread($handle, filesize($dayfile)); $lastupdate[$ii]=$string; fclose($handle); } I'm now left with 2 arrays, (the array of folders and the array of dates). These arrays are sidebyside, so now i sort them together. array_multisort($lastupdate, SORT_DESC, $sitearray); I now have at the top of the array the most recently updated folder and at the bottom...the new guys. now...i just make it distinglishable. echo "<table>"; $setbrk="True"; for ($ii=0; $ii<$i-1; $ii++ ) { if ($lastupdate[$ii]=="") { if ($setbrk=="True"){ echo "</table><tr><td><center>New Sites (Empty)<table>"; $setbrk="False"; } } echo "<tr><td class=\"post\" bgcolor=\"#777777\" width=100><center><a href=\"httptomysite/WWW/$sitearray[$ii]\"><font color=#000000>$sitearray[$ii]</font></a></center></td></tr>"; } echo "</table>"; ---- what that did was it dumped the whole sorted array into the table and inserted ONE hoz. line when we reached the point where $lastupdate[$ii] is empty. There, what do you think? ------------------------------------------------------------------------ [2005-07-03 21:18:22] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/33552 -- Edit this bug report at http://bugs.php.net/?id=33552&edit=1