Help with shout time posted

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with shout time posted

    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?

    #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.

    Comment


      #3
      in my old script i used this
      PHP 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;
      } 
      use this like
      PHP Code:
      ponick_time($shouttime); 
      Last edited by Ponick; 01.05.11, 13:43.
      PHP Code:
      /* I don't know everything hehe */ 
      Find me on facebook

      Comment


        #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?

        Comment


          #5
          tabks ponick very

          Comment


            #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?

            Comment

            Working...
            X