lazda144 Posted December 2, 2007 Report Share Posted December 2, 2007 kaa var uztaisiit apmeeram taadu lapu!! (bildes naw svariigas galvenais kaa pa dienaam sadaliit!!) man ir viens demo skripts bet loti vienkars!! <?php if ($handle = opendir('C:/wamp/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=\"demo/$file\">Novilkt</a></br></center>"; } } closedir($handle); } ?> Link to comment Share on other sites More sharing options...
andrisp Posted December 3, 2007 Report Share Posted December 3, 2007 Te pat forumā jau n-reizes aprunāts. Pameklē. Link to comment Share on other sites More sharing options...
lazda144 Posted December 3, 2007 Author Report Share Posted December 3, 2007 skatiijos jau bet tur visi bez dienu sadaliijuma!! Link to comment Share on other sites More sharing options...
marcis Posted December 3, 2007 Report Share Posted December 3, 2007 Nu skaties pats. Paņem šodienas datumu attiecīgā formātā. Salīdzini ar faila datumu, kas kā saprotu tev jau ir zināms. Tad skaties, ja faila datums sakrīt ar šodienas datumu, tad parādi, ja ne tad ne Link to comment Share on other sites More sharing options...
lazda144 Posted December 3, 2007 Author Report Share Posted December 3, 2007 diemzeel taadus prikolus es veel nejeedzu :( Link to comment Share on other sites More sharing options...
blackhalt Posted December 3, 2007 Report Share Posted December 3, 2007 imho vieglāk uzreiz samest pa attiecīgajām laika direktorijām, jo ja kaut kas nobrūk, tad liekot no rezerves kopijām tie laiki nobrūk. Nu var jau arī rakstī kādā DB vai txt failā kāds kuram failam tas datums bija. http://lv.php.net/manual/en/function.filemtime.php Link to comment Share on other sites More sharing options...
marcis Posted December 3, 2007 Report Share Posted December 3, 2007 Nu kas tur ko nejēgt? Faila datumu tu jau zini. Šodienas datumu uzzini ar date() un tad pārbaudi if($faila_datums==$shodienas_datums) echo "links"; Link to comment Share on other sites More sharing options...
lazda144 Posted December 3, 2007 Author Report Share Posted December 3, 2007 kaa tas apmeeram izskatiitos?? Link to comment Share on other sites More sharing options...
Kavacky Posted December 3, 2007 Report Share Posted December 3, 2007 Kas? Link to comment Share on other sites More sharing options...
lazda144 Posted December 3, 2007 Author Report Share Posted December 3, 2007 kaa marca teikto izmantot?? Link to comment Share on other sites More sharing options...
Kavacky Posted December 3, 2007 Report Share Posted December 3, 2007 ****, nu kaut uz tualetes papīra drukā un izmanto; kāpēc tu vispār te atnāci, a? Tam arī izmanto. Link to comment Share on other sites More sharing options...
marcis Posted December 3, 2007 Report Share Posted December 3, 2007 http://www.google.lv/search?hl=lv&q=ph...A1ana&meta= diezvai gatavu kodu tev kāds dos... Link to comment Share on other sites More sharing options...
lazda144 Posted December 3, 2007 Author Report Share Posted December 3, 2007 es maz ko jeedzu no php luudzu paliidzat es gribu pabeigt so web un tad saaksu maciities no nekaa taisiit Link to comment Share on other sites More sharing options...
marcis Posted December 3, 2007 Report Share Posted December 3, 2007 <? $handle="./bla/bla/bla/"; $today=date("Y-m-d"); while(false !== ($file = readdir($handle))) { $created=filemtime($handle.$file); $filedate=date("Y-m-d h:i:s",$created); $filedate=explode(" ",$filedate); if($filedate[0]==$today){ echo "bla bla bla"; } } ?> ej un mācies Link to comment Share on other sites More sharing options...
lazda144 Posted December 3, 2007 Author Report Share Posted December 3, 2007 (edited) tik un taa neit!! Warning: readdir(): supplied argument is not a valid Directory resource in C:\wamp\www\dem.php on line 4 <?php $handle="/demo/"; $today=date("Y-m-d"); while(false !== ($file = readdir($handle))) { $created=filemtime($handle.$file); $filedate=date("Y-m-d h:i:s",$created); $filedate=explode(" ",$filedate); if($filedate[0]==$today){ echo "bla bla bla"; } } ?> Edited December 3, 2007 by lazda144 Link to comment Share on other sites More sharing options...
Recommended Posts