You are here

function _activity_off in Activity 5

date formatter

1 call to _activity_off()
theme_activity_page in ./activity.module
theme function for displaying the users activity page

File

./activity.module, line 427
Activity module: Allow users to see their friends' activity on the site.

Code

function _activity_off($date) {
  $offset = strftime("%j") + strftime("%Y") * 365 - (strftime("%j", $date) + strftime("%Y", $date) * 365);
  if ($offset > 7) {
    $offset = strftime("%V") + strftime("%Y") * 52 - (strftime("%V", $date) + strftime("%Y", $date) * 52);
    $end = $offset != 0 ? $offset > 1 ? $offset . " weeks ago" : "a week ago" : "Today";
  }
  else {
    $end = $offset != 0 ? $offset > 1 ? "{$offset} days ago" : "Yesterday" : "Today";
  }
  return $end;
}