PDA

View Full Version : Last Influence Countdown


SilverDragonTears
11-29-2011, 03:51 PM
How would I go about showing a countdown until users can influence again?

if($type == 'Thylo Silvfox' && $currentlevel <= '4'){
$article_content .= "Influence - (<i>Only adults may influence.</i>)<br>";
}else if($type == 'Thylo Silvfox' && $lastinfluence >= '$lastweek'){
$article_content .= "Influence - You must wait one week before influencing.<br>";
}else
if($type == 'Thylo Silvfox' && $currentlevel <= '4'){
$article_content .= "";
}else if($type == 'Thylo Silvfox' && $gender == 'f'){

$article_content .= "<a href='myadopts.php?act=influence&id=".$id."'>Influence</a> Allow an adopt to be influenced female by ".stripslashes($name).". <br>";
}else if($type == 'Thylo Silvfox' && $gender == 'm'){

$article_content .= "<a href='myadopts.php?act=influence&id=".$id."'>Influence</a> Allow an adopt to be influenced male by ".stripslashes($name).".<br>";
}else {
$article_content .= "";
}

SilverDragonTears
11-29-2011, 04:28 PM
Something like this? I'm so bad at math....

$article_content .= "Influence - You must wait ";

$target = $lastinfluence ;

$today = time () ;

$difference =($target-$today) ;

$days =(int) ($difference/86400) ;


$article_content .= $days." before influencing.<br>";
}else

SilverDragonTears
12-07-2011, 10:13 PM
Ok (this is for breeding too) I'm close but I'm a day off....

$target = $lastweek ;

$today = $lastbred ;

$difference =($today-$target) ;

$days =(int) ($difference/86400) ;

$article_content .= "<i> You must wait ".$days." days before breeding.<br>";
}