Help with shout time posted

Started on the old forum in April 2011 · view the original in the archive · old links redirect here

5 replies · 452 views · started 15 years ago · 1 min read

4 participants
analyzer Developer · 104 posts #1

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?

kei_ki7 Senior · 431 posts #2

Refer with the codes with the online chatroom list. Or wait for a while.

Did I help you? You can help me too Your donations will help me finance my studies.

Ponick Developer · 216 posts #3

in my old script i used this

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;
}

use this like

ponick_time($shouttime);
/* I don't know everything hehe */

Find me on facebook

analyzer Developer · 104 posts #4

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?

analyzer Developer · 104 posts #6

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?

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close