← Desenvolvimento

erro em contador decrescente

Lida 1594 vezes

Offline

frsantos 
Membro
Mensagens 1458 Gostos 0
Troféus totais: 35
Trófeus: (Ver todos)
Linux User Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter

boas, tenho este contador decrescente para colocar num blog wordpress
Código: [Seleccione]
<?php
// countdown function
// parameters: (year, month, day, hour, minute)
countdown(2007,09,22,21,15);

//--------------------------
// author: Louai Munajim
// website: www.elouai.com
//
// Note:
// Unix timestamp limitations 
// Date range is from 
// the year 1970 to 2038
//--------------------------
function countdown($year$month$day$hour$minute)
{
  
// make a unix timestamp for the given date
  
$the_countdown_date mktime($hour$minute0$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 "Faltam ".$days_left." dias ".$hours_left." horas ".$minutes_left." minutos";
}
?>
Mas o contador não está a funcionar, apenas aparece
Citar
Faltam 0 dias 0 horas 0 minutos
ou seja não está a contar, alguem sabe o que está mal?
obrigado
Offline

frsantos 
Membro
Mensagens 1458 Gostos 0
Troféus totais: 35
Trófeus: (Ver todos)
Linux User Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter

ninguem sabe o problema? ???
e outro sistema de contdown para evento com dia, hora e minutos?
Offline

icaro 
Membro
Mensagens 128 Gostos 0
Troféus totais: 26
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 100 Posts

em vez de 09, põe só 9 que já dá
Offline

frsantos 
Membro
Mensagens 1458 Gostos 0
Troféus totais: 35
Trófeus: (Ver todos)
Linux User Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter

obrigado, era mesmo isso