griffin Posted August 29, 2007 Report Share Posted August 29, 2007 Ieliku mājas lapā to, ka var novilkt demo, bet tagat problēma viņu ir pa daudz, vai nevar kaut kā tā, kad viņi automātiski dzēšas ārā, piemēram, kā tiek izveidots jauns .dem fails, tā pats vecākais dzēšas ārā? Link to comment Share on other sites More sharing options...
vincister Posted August 29, 2007 Report Share Posted August 29, 2007 protams ka var, vai tad tev kāds liedz? Link to comment Share on other sites More sharing options...
griffin Posted August 29, 2007 Author Report Share Posted August 29, 2007 un kā tas būtu izdarāms? Link to comment Share on other sites More sharing options...
10BaseT Posted August 29, 2007 Report Share Posted August 29, 2007 (edited) Šitie joki vnk spārda BriGe Tas tev <?php // Noraadi mapi $dir = "E:/www/htdocs/x/"; //Funkcija kas izmetis vecako failu no mapes function get_oldest_file($directory) { if ($handle = opendir($directory)) { while (false !== ($file = readdir($handle))) { if (is_file($directory.$file)) { $files[] = $file; } } foreach ($files as $val) { if (is_file($directory.$val)) { $file_date[$val] = filemtime($directory.$val); } } } closedir($handle); asort($file_date, SORT_NUMERIC); reset($file_date); $oldest = key($file_date); return $oldest; } // Izmetam vecako failu $fails = get_oldest_file("$dir"); unlink("$dir/$fails"); ?> Edited August 29, 2007 by 10BaseT Link to comment Share on other sites More sharing options...
griffin Posted August 29, 2007 Author Report Share Posted August 29, 2007 man šito likt klāt demo.php ? Link to comment Share on other sites More sharing options...
10BaseT Posted August 29, 2007 Report Share Posted August 29, 2007 Kā lai es zinu? Parādi savu demo.php un tad pateikšu. Link to comment Share on other sites More sharing options...
griffin Posted August 29, 2007 Author Report Share Posted August 29, 2007 if ($handle = opendir('../../../../../AppServ/www/demo/')) { while (false !== ($file = readdir($handle))) { if (strlen($file) > 4) { $gabali = explode("-", $file); $date = $gabali[1]; $mape = $gabali[2]; $mapesgabali = explode(".", $mape); $name = $mapesgabali[0]; $year = substr($date,0,2); $month = substr($date,2,2); $day = substr($date,4,2); $hour = substr($date,6,2); $minute = substr($date,8,2); echo "<center>$day.$month.$year $hour:$minute $name <a href=\"http://demons.oo.lv/demo/$file\">Download</a></br></center>"; } } closedir($handle); } ?> Link to comment Share on other sites More sharing options...
10BaseT Posted August 29, 2007 Report Share Posted August 29, 2007 Nē jāliek klāt tam failam ar kuru tu uztaisi arhīvus tos zip. Link to comment Share on other sites More sharing options...
ChiganS Posted August 30, 2007 Report Share Posted August 30, 2007 (edited) cik saprotu mums nevajag lai sazipotos... Edited August 30, 2007 by ChiganS Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now