Refer with the codes with the online chatroom list. Or wait for a while.
Guys. .i need your help. .i want code which informing users when the sh0ut is shouted. .i am talking about the time. .like 2 mins. ago, 4 days ago, 51 secs. ago like in fb. .my script is lavalair. .please help me. .i am a new php learner. .
It's n0t that i am afraid to die. Its just that if i die, wh0 wilL loVe her as muCh as i Do?
Refer with the codes with the online chatroom list. Or wait for a while.
Did I help you?
You can help me too [Only registered and activated users can see links. Click Here To Register...]
Your donations will help me finance my studies.
in my old script i used this
use this likePHP Code:function ponick_time ( $start, $end = false)
{
if ($end == false) //if you don't pass a second parameter,
$end = time(); //we assume you're comparing to now.
$tme=date("h:ia",$start);
$dati=date("d/m/y", $start);
$diff = $end - $start;
$days = floor ( $diff/86400 ); //calculate the days
$diff = $diff - ($days*86400); // subtract the days
$hours = floor ( $diff/3600 ); // calculate the hours
$diff = $diff - ($hours*3600); // subtract the hours
$mins = floor ( $diff/60 ); // calculate the minutes
$diff = $diff - ($mins*60); // subtract the mins
$secs = $diff; // what's left is the seconds;
if ($secs < 30) {
$returnval = "just now";
}
if ($secs > 30) {
$returnval = "about $secs second".(($secs>1) ? "s":"")." ago";
}
if ($mins > 0) {
$returnval = "$mins minute".(($mins>1) ? "s":"")." ago";
}
if ($hours > 0) {
$returnval = "$hours hour".(($hours>1) ? "s":"")." ago";
}
if ($days > 0) {
$returnval = "$days day".(($days>1) ? "s":"")." ago";
}
if ($days == 2) {
$returnval = "Yesterday at $tme";
}
if ($days > 2) {
$returnval = "$days day".(($days>1) ? "s":"")." ago";
}
if ($days ==7) {
$returnval = "a week ago";
}
if ($days ==30) {
$returnval = "a month ago";
}
if ($days > 30) {
$returnval = "$dati";
}
return $return . $returnval;
}
PHP Code:ponick_time($shouttime);
Last edited by Ponick; 01-05-11 at 13:43.
Tnx p0nic. . I will try it. .![]()
It's n0t that i am afraid to die. Its just that if i die, wh0 wilL loVe her as muCh as i Do?
tabks ponick very
Is that complete ponick?. .and is it working?. .where do i put function ponick_time?. .and ponick_time($shouttime);? And where is $shouttime?. .i can't find it. .
It's n0t that i am afraid to die. Its just that if i die, wh0 wilL loVe her as muCh as i Do?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks