本文整理汇总了PHP中WT_I18N::time_ago方法的典型用法代码示例。如果您正苦于以下问题:PHP WT_I18N::time_ago方法的具体用法?PHP WT_I18N::time_ago怎么用?PHP WT_I18N::time_ago使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WT_I18N
的用法示例。
在下文中一共展示了WT_I18N::time_ago方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit_field_inline
$datum[2] = edit_field_inline('user-user_name-' . $user_id, $datum[2]);
$datum[3] = edit_field_inline('user-real_name-' . $user_id, $datum[3]);
$datum[4] = edit_field_inline('user-email-' . $user_id, $datum[4]);
// $aData[5] is a link to an email icon
if ($user_id != WT_USER_ID) {
$datum[5] = '<i class="icon-email" onclick="return message(\'' . $user_name . '\', \'\', \'\');"></i>';
}
$datum[6] = edit_field_language_inline('user_setting-' . $user_id . '-language', $datum[6]);
// $aData[7] is the sortable registration timestamp
$datum[8] = $datum[8] ? format_timestamp($datum[8]) : '';
if (date("U") - $datum[7] > 604800 && !$datum[11]) {
$datum[8] = '<span class="red">' . $datum[8] . '</span>';
}
// $aData[9] is the sortable last-login timestamp
if ($datum[9]) {
$datum[10] = format_timestamp($datum[9]) . '<br>' . WT_I18N::time_ago(WT_TIMESTAMP - $datum[9]);
} else {
$datum[10] = WT_I18N::translate('Never');
}
$datum[11] = edit_field_yes_no_inline('user_setting-' . $user_id . '-verified-', $datum[11]);
$datum[12] = edit_field_yes_no_inline('user_setting-' . $user_id . '-verified_by_admin-', $datum[12]);
// Add extra column for "delete" action
if ($user_id != WT_USER_ID) {
$datum[13] = '<div class="icon-delete" onclick="delete_user(\'' . WT_I18N::translate('Are you sure you want to delete “%s”?', WT_Filter::escapeJs($user_name)) . '\', \'' . WT_Filter::escapeJs($user_id) . '\');"></div>';
} else {
// Do not delete ourself!
$datum[13] = '';
}
}
// Total filtered/unfiltered rows
$recordsFiltered = WT_DB::prepare("SELECT FOUND_ROWS()")->fetchOne();