/** * XML <Now /> element handler * * @see Element::addText() * @final */ function NowSHandler() { global $currentElement; $g = timestamp_to_gedcom_date(WT_CLIENT_TIMESTAMP); $currentElement->addText($g->Display()); }
?> </th></tr> <?php // Check users not logged in too long $ucnt = 0; foreach (User::all() as $user) { if ($user->getSetting('sessiontime') == "0") { $datelogin = (int) $user->getSetting('reg_timestamp'); } else { $datelogin = (int) $user->getSetting('sessiontime'); } if (mktime(0, 0, 0, (int) date("m") - $month, (int) date("d"), (int) date("Y")) > $datelogin && $user->getSetting('verified') && $user->getSetting('verified_by_admin')) { ?> <tr><td><?php echo WT_Filter::escapeHtml($user->getUserName()), " - <p>", WT_Filter::escapeHtml($user->getRealName()), "</p>", WT_I18N::translate('User’s account has been inactive too long: '); echo timestamp_to_gedcom_date($datelogin)->Display(false); $ucnt++; ?> </td><td><input type="checkbox" name="del_<?php echo $user->getUserId(); ?> " value="1"></td></tr><?php } } // Check unverified users foreach (User::all() as $user) { if (date("U") - (int) $user->getSetting('reg_timestamp') > 604800 && !$user->getSetting('verified')) { ?> <tr><td><?php echo WT_Filter::escapeHtml($user->getUserName()), " - ", WT_Filter::escapeHtml($user->getRealName()), ": ", WT_I18N::translate('User didn’t verify within 7 days.'); $ucnt++;
static function browserDate() { return timestamp_to_gedcom_date(WT_CLIENT_TIMESTAMP)->Display(false); }
function format_timestamp($time) { global $DATE_FORMAT, $TIME_FORMAT; $time_fmt = $TIME_FORMAT; // PHP::date() doesn't do I18N. Do it ourselves.... preg_match_all('/%[^%]/', $time_fmt, $matches); foreach ($matches[0] as $match) { switch ($match) { case '%a': $t = gmdate('His', $time); if ($t == '000000') { $time_fmt = str_replace($match, WT_I18N::translate('midnight'), $time_fmt); } elseif ($t < '120000') { $time_fmt = str_replace($match, WT_I18N::translate('a.m.'), $time_fmt); } elseif ($t == '120000') { $time_fmt = str_replace($match, WT_I18N::translate('noon'), $time_fmt); } else { $time_fmt = str_replace($match, WT_I18N::translate('p.m.'), $time_fmt); } break; case '%A': $t = gmdate('His', $time); if ($t == '000000') { $time_fmt = str_replace($match, WT_I18N::translate('Midnight'), $time_fmt); } elseif ($t < '120000') { $time_fmt = str_replace($match, WT_I18N::translate('A.M.'), $time_fmt); } elseif ($t == '120000') { $time_fmt = str_replace($match, WT_I18N::translate('Noon'), $time_fmt); } else { $time_fmt = str_replace($match, WT_I18N::translate('P.M.'), $time_fmt); } break; default: $time_fmt = str_replace($match, WT_I18N::digits(gmdate(substr($match, -1), $time)), $time_fmt); } } return timestamp_to_gedcom_date($time)->Display(false, $DATE_FORMAT) . '<span class="date"> - ' . $time_fmt . '</span>'; }
static function browserDate() { return timestamp_to_gedcom_date(client_time())->Display(false); }
/** * XML <PGVRNow /> elemnt handler * * @see PGVRElement::addText() * @final */ function PGVRNowSHandler() { global $currentElement; $g = timestamp_to_gedcom_date(client_time()); $currentElement->addText($g->Display()); }
function timestamp_to_jd($time) { return timestamp_to_gedcom_date($time)->JD(); }