function timeago_token_values in Timeago 6.2
Implementation of hook_token_values().
File
- ./
timeago.module, line 135 - Adds support for the Timeago jQuery library.
Code
function timeago_token_values($type, $object = NULL, $options = array()) {
$values = array();
$o = (object) $object;
if ($type == 'node' && !empty($o->created)) {
$values['timeago'] = timeago_format_date($o->created);
}
elseif ($type == 'comment' && !empty($o->timestamp)) {
$values['created-timeago'] = timeago_format_date($o->timestamp);
}
return $values;
}