sayed Posted November 20, 2006 Report Share Posted November 20, 2006 Gribu savā web lapa ielit atpakaļskaitīšanas taimeru līdz nakošajiem jaunumiem.. Vai nav kādam jau gatavs tāds skripts? Ideja tāda ka norāda kādu noteiktu datumu un laiku viņš sāk rādīt laiku cik ir palicis līdz manam norādītajam laikam. Paldies jau iepriekš! Link to comment Share on other sites More sharing options...
Delfins Posted November 20, 2006 Report Share Posted November 20, 2006 5 Lati vai http://www.google.lv/search?q=php+countdown+timer Link to comment Share on other sites More sharing options...
sayed Posted November 20, 2006 Author Report Share Posted November 20, 2006 Tradu tādu prastu tikai problēma ir ka mēneša nosaukumi ir angliski :( <?php // countdown function // parameters: (year, month, day, hour, minute) countdown(2006,11,24,12,0); function countdown($year, $month, $day, $hour, $minute) { // make a unix timestamp for the given date $the_countdown_date = mktime($hour, $minute, 0, $month, $day, $year, -1); // get current unix timestamp $today = time(); $difference = $the_countdown_date - $today; if ($difference < 0) $difference = 0; $days_left = floor($difference/60/60/24); $hours_left = floor(($difference - $days_left*60*60*24)/60/60); $minutes_left = floor(($difference - $days_left*60*60*24 - $hours_left*60*60)/60); // OUTPUT echo "Šodien ir ".date("F j, Y, g:i a")."<br/>"; echo "Beigu datums ".date("F j, Y, g:i a",$the_countdown_date)."<br/>"; echo "Atlicis laiks ".$days_left." days ".$hours_left." hours ".$minutes_left." minutes left"; } ?> Kur ko palabot lai būtu latviski? Nekādi pats nevaru iebraukt :( Link to comment Share on other sites More sharing options...
Delfins Posted November 20, 2006 Report Share Posted November 20, 2006 setLocale() Link to comment Share on other sites More sharing options...
sayed Posted November 20, 2006 Author Report Share Posted November 20, 2006 Nesapratu! Link to comment Share on other sites More sharing options...
Delfins Posted November 20, 2006 Report Share Posted November 20, 2006 ko tu nesaprati? šito? - http://lv2.php.net/setlocale Ko tu vispār dari programmēānā.. Link to comment Share on other sites More sharing options...
Recommended Posts