private static function deleteOldActivations(Module_Register $module) { $cut = time() - $module->getActivationThreshold(); self::log('Deleting user activations older than ' . GWF_Time::displayTimestamp($cut)); $table = new GWF_UserActivation(false); $result = $table->deleteWhere("timestamp<{$cut}"); if (0 < ($nDeleted = $table->affectedRows($result))) { self::log(sprintf('Deleted %d old user activations.', $nDeleted)); } }
private function checkPeak() { $channel = Dog::getChannel(); $count = $channel->getUserCount(); $peak = Dog_ChannelPeak::getPeak($channel); $old_peak = $peak->getVar('lcpeak_peak'); if ($count > $old_peak) { if (!$peak->savePeak($count)) { Dog::err('ERR_DATABASE', array(__FILE__, __LINE__)); } elseif ($old_peak > 0 && $this->hasPeakshow()) { $iso = $channel->getLangISO(); $date = GWF_Time::displayTimestamp(NULL, $iso); $channel->sendNOTICE($this->langISO($iso, 'new_peak', array($channel->getName(), Dog::getServer()->displayLongName(), $count, $date))); } } }
public function displayNote(Dog_Server $server, $viewerid) { $time = $this->getVar('lnote_time'); $ago = GWF_Time::humanDuration(time() - $time); $date = GWF_Time::displayTimestamp($time); $from = $this->getVar('lnote_from'); $to = $this->getVar('lnote_from'); if ($from == $viewerid) { $fromto = 'to'; $otherid = $to; } else { $fromto = 'from'; $otherid = $from; } $othername = $this->getUsername($otherid); $b = chr(2); return sprintf($b . 'Note %s %s (%s - %s) ago:' . $b . ' %s (' . $b . 'ID: %s' . $b . ')', $fromto, $othername, $date, $ago, $this->getVar('lnote_msg'), $this->getID()); }
public function displayDate() { return GWF_Time::displayTimestamp($this->getVar('userhist_date')); }
echo gwfProfileRow(WC_HTML::lang('th_rank2'), GWF_HTML::anchor(GWF_WEB_ROOT . 'ranking/player/' . $u->urlencode2('user_name') . '#rank_' . $rank, $rank)); } if ($u->getVar('user_countryid') !== '0') { if (isset($data['WC_HIDE_RANK'])) { echo gwfProfileRow(WC_HTML::lang('th_crank'), $wechall->lang('hidden')); } else { $cRank = WC_Regat::calcCountryRank($u); $href_crank = GWF_WEB_ROOT . 'country_ranking/player/' . $u->urlencode2('user_name') . '#rank_' . $cRank; echo gwfProfileRow(WC_HTML::lang('th_crank'), GWF_HTML::anchor($href_crank, $cRank)); } } echo gwfProfileRow($tLang->lang('th_registered'), GWF_Time::displayDate($u->getVar('user_regdate'))); if ($u->isOptionEnabled(GWF_User::HIDE_ONLINE)) { $lastactivity = GWF_HTML::lang('unknown'); } else { $lastactivity = GWF_Time::displayTimestamp($u->getVar('user_lastactivity')); } echo gwfProfileRow($tLang->lang('th_last_active'), $lastactivity); echo gwfProfileRow($tLang->lang('th_views'), $p->getVar('prof_views')); if ('' !== ($v = $p->display('prof_firstname'))) { echo gwfProfileRow($tLang->lang('th_firstname'), $v); } if ('' !== ($v = $p->display('prof_lastname'))) { echo gwfProfileRow($tLang->lang('th_lastname'), $v); } if ($u->isOptionEnabled(GWF_User::SHOW_BIRTHDAY) && '00000000' !== ($v = $u->getVar('user_birthdate'))) { echo gwfProfileRow($tLang->lang('th_age'), GWF_Time::displayAge($v)); echo gwfProfileRow($tLang->lang('th_birthdate'), GWF_Time::displayDate($v)); } if ('' !== ($v = $p->display('prof_street'))) { echo gwfProfileRow($tLang->lang('th_street'), $v);
public function displayRegdate() { return GWF_Time::displayTimestamp($this->getVar('regdate')); }
<?php $lang = array('en' => array('help' => 'Usage: %CMD% [<timestamp>] [<timezone>]. Convert a unix timestamp to a date.', 'conv' => 'Timestamp %s will be %s.')); $plugin = Dog::getPlugin(); if ('' === ($message = $plugin->msg())) { return $plugin->showHelp(); } $args = explode(' ', $message); if (count($args) === 1) { $args[] = 'CET'; } if (count($args) !== 2) { return $plugin->showHelp(); } $plugin->rply('conv', array($args[0], GWF_Time::displayTimestamp($args[0], Dog::getLangISO(), 'Invalid date')));
public function displayDate() { return GWF_Time::displayTimestamp($this->getVar('accacc_time')); }
/** * Gizmore timestamp modifier * * Type: modifier * Name: timestamp * Date: Dec 06, 2011 * Purpose: convert a timestamp into human readable date * Input: int to convert * Example: {$var|timestamp:"8"} * @author gizmore * @param array $params parameters * @return string with compiled code */ function smarty_modifier_timestamp($timestamp) { return GWF_Time::displayTimestamp($timestamp, NULL, 'Never'); }
<?php echo $tVars['search_form']; $headers = array(array($tLang->lang('th_userid'), 'user_id', 'ASC'), array($tLang->lang('th_user_credits'), 'user_credits', 'ASC'), array($tLang->lang('th_user_level'), 'user_level', 'ASC'), array($tLang->lang('th_country'), 'user_countryid', 'ASC'), array($tLang->lang('th_user_name'), 'user_name', 'ASC'), array($tLang->lang('th_regdate'), 'user_regdate', 'ASC'), array($tLang->lang('th_email'), 'user_email', 'ASC'), array($tLang->lang('th_birthdate'), 'user_birthdate', 'ASC'), array($tLang->lang('th_regip'), 'user_regip', 'ASC'), array($tLang->lang('th_lastactivity'), 'user_lastactivity', 'DESC')); echo $tVars['pagemenu']; echo GWF_Table::start(); echo GWF_Table::displayHeaders1($headers); foreach ($tVars['users'] as $user) { echo GWF_Table::rowStart(); $user instanceof GWF_User; $href = Module_Admin::getUserEditURL($user->getID()); echo GWF_Table::column(GWF_HTML::anchor($href, $user->getID()), 'gwf_num'); echo GWF_Table::column(GWF_HTML::anchor($href, round($user->getVar('user_credits')), 2), 'gwf_num'); echo GWF_Table::column(GWF_HTML::anchor($href, $user->getLevel()), 'gwf_num'); echo GWF_Table::column(sprintf('<a href="%s">%s</a>', $href, $user->displayCountryFlag())); echo GWF_Table::column(GWF_HTML::anchor($href, $user->display('user_name'))); echo GWF_Table::column(GWF_HTML::anchor($href, GWF_Time::displayDate($user->getVar('user_regdate'))), 'gwf_date'); echo GWF_Table::column(GWF_HTML::anchor($href, $user->display('user_email'))); echo GWF_Table::column(GWF_HTML::anchor($href, GWF_Time::displayDate($user->getVar('user_birthdate'))), 'gwf_date'); echo GWF_Table::column(GWF_HTML::anchor($href, GWF_IP6::displayIP($user->getVar('user_regip'), GWF_IP_EXACT))); echo GWF_Table::column(GWF_HTML::anchor($href, GWF_Time::displayTimestamp($user->getVar('user_lastactivity'))), 'gwf_date'); echo GWF_Table::rowEnd(); } echo GWF_Table::end(); echo $tVars['pagemenu'];
public function displayTimestamp() { return GWF_Time::displayTimestamp($this->getVar('timestamp')); }