本文整理汇总了PHP中cs_time函数的典型用法代码示例。如果您正苦于以下问题:PHP cs_time函数的具体用法?PHP cs_time怎么用?PHP cs_time使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cs_time函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cs_login_cookies
function cs_login_cookies($userid = 0, $use_old_hash = 0)
{
global $account, $cs_main;
$lifetime = empty($userid) ? 1 : $cs_main['cookie']['lifetime'];
$thistime = empty($userid) ? '' : cs_time();
$thishash = empty($use_old_hash) ? '' : $use_old_hash;
if (!empty($userid) and empty($use_old_hash)) {
$pattern = '1234567890abcdefghijklmnpqrstuvwxyz';
for ($i = 0; $i < 34; $i++) {
$thishash .= $pattern[rand(0, 34)];
}
$cells = array('users_cookietime', 'users_cookiehash');
$content = array($thistime, $thishash);
cs_sql_update(__FILE__, 'users', $cells, $content, $userid, 0, 0);
} elseif (!empty($userid) and $use_old_hash == true) {
$thistime = $account['users_cookietime'];
$thishash = $account['users_cookiehash'];
if (empty($thistime) or empty($thishash)) {
cs_login_cookies($userid);
return true;
}
}
setcookie('cs_userid', $userid, $lifetime, $cs_main['cookie']['path'], $cs_main['cookie']['domain']);
setcookie('cs_cookietime', $thistime, $lifetime, $cs_main['cookie']['path'], $cs_main['cookie']['domain']);
setcookie('cs_cookiehash', $thishash, $lifetime, $cs_main['cookie']['path'], $cs_main['cookie']['domain']);
}
示例2: fetch_pm_period
function fetch_pm_period($array, $value)
{
$loop = count($array);
for ($run = 0; $run < $loop; $run++) {
if (empty($periods)) {
$i = 0;
$daynum = -1;
$weekstart = 1 - 1;
$timestamp = cs_days();
$timestamp = $timestamp + 3600;
$periods = array('today' => $timestamp);
while ($daynum != $weekstart and $i++ < 7) {
$timestamp -= 86400;
$daynum = date('w', $timestamp);
if ($i == 1) {
$periods['yesterday'] = $timestamp;
} else {
$periods[strtolower(date('l', $timestamp))] = $timestamp;
}
}
$periods['last_week'] = $timestamp -= 7 * 86400;
$periods['2_weeks_ago'] = $timestamp -= 7 * 86400;
$periods['3_weeks_ago'] = $timestamp -= 7 * 86400;
$periods['last_month'] = $timestamp -= 28 * 86400;
}
$periodtime2 = cs_time();
foreach ($periods as $periodname => $periodtime) {
if ($array[$run][$value] >= $periodtime and $array[$run][$value] <= $periodtime2) {
$periodtime2 = $periodtime;
$array[$run]['period'] = $periodname;
}
}
if (empty($array[$run]['period'])) {
$array[$run]['period'] = 'older';
}
}
return $array;
}
示例3: pg_safe_exec
$query = "SELECT user_id,ts,event,message FROM userlog WHERE event!=5 AND user_id={$id} ORDER BY ts DESC";
// echo "Q: $query<br>";
$logs = pg_safe_exec($query);
echo "<TABLE border=1 WIDTH=100% cellspacing=0 cellpadding=2 BGCOLOR=#" . $cTheme->table_bgcolor . ">";
echo "<tr><td colspan=3><H2>Log messages (last 5)</H2><a href=\"viewlogs.php?uid=" . $id . "\">View All</a></td></tr>";
echo "<tr bgcolor=#" . $cTheme->table_headcolor . "><td><font color=#" . $cTheme->table_headtextcolor . ">Time</font></td><td><font color=#" . $cTheme->table_headtextcolor . ">Event</font></td><td><font color=#" . $cTheme->table_headtextcolor . ">Message</font></td></tr>";
if (pg_numrows($logs) != 0) {
if (pg_numrows($logs) >= 5) {
$max = 5;
} else {
$max = pg_numrows($logs);
}
for ($row = 0; $row < $max; $row++) {
$log = pg_fetch_object($logs, $row);
echo "<tr><td>";
echo cs_time($log->ts) . " [" . $log->ts . "]</td><td>";
if ($log->event > count($user_events) || $log->event == 0) {
echo "(old)</td><td>";
} else {
echo $type[$log->event] . "</td><td>";
}
if ($admin < SHOW_IP_LEVEL) {
echo htmlentities(remove_ip($log->message, 2)) . "</td></tr>\n";
} else {
echo htmlentities($log->message) . "</td></tr>\n";
}
}
echo "</table>";
} else {
echo "There are no log messages for this user\n<br><br>";
}
示例4: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('users');
$five_min = cs_time() - 300;
$select = 'users_id, users_nick, users_country, users_active, users_invisible, users_picture';
$invisible = $account['access_users'] > 4 ? '' : " AND users_invisible = '0'";
$upcome = "users_laston > " . $five_min . " AND users_active = '1'" . $invisible;
$order = 'users_laston DESC';
$cs_users = cs_sql_select(__FILE__, 'users', $select, $upcome, $order, 0, 8);
$data = array();
if (empty($cs_users)) {
$data['lang']['no_users'] = $cs_lang['no_data'];
echo cs_subtemplate(__FILE__, $data, 'users', 'no_users');
} else {
$count_users = count($cs_users);
for ($run = 0; $run < $count_users; $run++) {
if (!empty($cs_users[$run]['users_picture'])) {
$data['users'][$run]['picture'] = 'uploads/users/' . $cs_users[$run]['users_picture'];
} else {
$data['users'][$run]['picture'] = 'symbols/users/no_pic.png';
}
if (empty($invisible) and !empty($cs_users[$run]['users_invisible'])) {
$data['users'][$run]['nick'] = cs_html_italic(1) . $cs_users[$run]['users_nick'] . cs_html_italic(0);
} else {
$data['users'][$run]['nick'] = $cs_users[$run]['users_nick'];
}
$data['users'][$run]['url'] = cs_url('users', 'view', 'id=' . $cs_users[$run]['users_id']);
}
echo cs_subtemplate(__FILE__, $data, 'users', 'navonline_pic');
示例5: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('board');
$cs_usertime = cs_sql_select(__FILE__, 'users', 'users_readtime', "users_id = '" . $account["users_id"] . "'");
$cs_readtime = cs_time() - $cs_usertime['users_readtime'];
$from = 'threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id';
$conditions = "frm.board_access <= '" . $account['access_board'] . "' AND frm.board_pwd = ''";
$cs_count = cs_sql_count(__FILE__, $from, $conditions);
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
$data['lang']['count'] = $cs_count;
$data['pages']['list'] = cs_pages('board', 'active', $cs_count, $start);
$from = "threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id INNER JOIN {pre}_categories cat ON cat.categories_id = frm.categories_id INNER JOIN {pre}_users usr ON thr.threads_last_user = usr.users_id LEFT JOIN {pre}_read red ON thr.threads_id = red.threads_id AND red.users_id = '" . $account['users_id'] . "'";
$select = 'thr.threads_id AS threads_id, thr.threads_headline AS threads_headline, thr.threads_view AS threads_view, thr.threads_comments AS threads_comments, thr.threads_important AS threads_important, thr.threads_close AS threads_close, thr.threads_last_time AS threads_last_time, usr.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, red.read_since AS read_since';
$order = 'thr.threads_view DESC, thr.threads_last_time DESC';
$cs_threads = cs_sql_select(__FILE__, $from, $select, $conditions, $order, $start, $account['users_limit']);
if (empty($cs_threads)) {
$data['if']['not_active'] = true;
$data['if']['active'] = false;
} else {
$data['if']['not_active'] = false;
$data['if']['active'] = true;
$run = 0;
foreach ($cs_threads as $thread) {
if (empty($thread['threads_comments'])) {
include_once 'mods/board/repair.php';
$thread['threads_comments'] = cs_threads_comments($thread['threads_id']);
}
$icon = 'post_';
$tid = $thread['threads_id'];
示例6: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('games');
require_once 'mods/categories/functions.php';
$files = cs_files();
$options = cs_sql_option(__FILE__, 'games');
$img_filetypes = array('image/gif' => 'gif');
$games_error = 0;
$games_form = 1;
if (empty($_POST['datum_month']) or empty($_POST['datum_day']) or empty($_POST['datum_year'])) {
$games_release = cs_date('unix', cs_time(), 0, 1, 'Y-m-d');
} else {
$games_release = $_POST['datum_year'] . '-' . $_POST['datum_month'] . '-' . $_POST['datum_day'];
}
$symbol = empty($_POST['symbol']) ? '' : $_POST['symbol'];
$games_name = '';
$games_version = '';
$games_creator = '';
$games_url = '';
$categories_id = empty($_POST['categories_id']) ? 0 : $_POST['categories_id'];
$games_usk = empty($_POST['games_usk']) ? '' : $_POST['games_usk'];
$errormsg = '';
if (!empty($_POST['games_name'])) {
$games_name = $_POST['games_name'];
} else {
$errormsg .= $cs_lang['name_error'] . cs_html_br(1);
$games_error++;
}
$categories_id = empty($_POST['categories_name']) ? $categories_id : cs_categories_create('games', $_POST['categories_name']);
示例7: cs_translate
<?php
$cs_lang = cs_translate('medals');
$data = array();
if (isset($_POST['submit'])) {
$medals_id = $_POST['medals_id'];
if (!empty($_POST['users_nick'])) {
$users_nick = cs_sql_escape($_POST['users_nick']);
$users_id = cs_sql_select(__FILE__, 'users', 'users_id', "users_nick = '{$users_nick}'", 0, 0, 1);
if ($users_id > 0) {
$insertion = array('medals_id' => $medals_id, 'users_id' => $users_id['users_id'], 'medalsuser_date' => cs_time());
cs_sql_insert(__FILE__, 'medalsuser', array_keys($insertion), array_values($insertion));
cs_redirect($cs_lang['create_done'], 'medals', 'user', 'where=' . $medals_id);
} else {
cs_redirect($cs_lang['user_not_found'], 'medals', 'user', 'where=' . $medals_id);
}
}
} else {
$medals_id = $_GET['where'];
}
if (isset($_GET['delete'])) {
$medalsuser_id = cs_sql_escape($_GET['delete']);
cs_sql_delete(__FILE__, 'medalsuser', $medalsuser_id);
cs_redirect($cs_lang['del_true'], 'medals', 'user', 'where=' . $medals_id);
}
$start = empty($_GET['start']) ? 0 : $_GET['start'];
$cs_sort[1] = 'md.medalsuser_date DESC';
$cs_sort[2] = 'md.medalsuser_date ASC';
$cs_sort[3] = 'usr.users_nick DESC';
$cs_sort[4] = 'usr.users_nick ASC';
$sort = empty($_GET['sort']) ? 1 : $_GET['sort'];
示例8: pg_fetch_object
$tmp_res = pg_fetch_object($res1, $x);
echo "<tr>\n";
if ($admin >= $min_lvl || $nrw_lvl > 0) {
echo "<td><a href=\"remove_f.php?id=" . $tmp_res->id . "\">Delete</a></td>";
}
if ($tmp_res->user_name != "") {
echo "<td>" . $tmp_res->user_name . "</td>";
} else {
echo "<td><font color=#" . $cTheme->main_warnmsg . ">N/A</font></td>";
}
if ($tmp_res->email != "") {
echo "<td>" . $tmp_res->email . "</td>";
} else {
echo "<td><font color=#" . $cTheme->main_warnmsg . ">N/A</font></td>";
}
echo "<td>" . cs_time($tmp_res->created_ts) . "</td>";
echo "<td>" . $tmp_res->set_by . "</td>";
echo "<td>" . $tmp_res->reason . "</td>";
echo "<td>" . $tmp_res->id . "</td>";
echo "</tr>\n";
}
echo "</table>\n";
} else {
echo "<b>No record found matching your query.</b>\n";
}
echo "<br><br>\n";
}
echo "For CService Admins use <b>ONLY</b>.";
?>
</body>
</html>
示例9: empty
$imprint = empty($cs_main['rte_html']) ? $_POST['imprint'] : cs_abcode_inhtml($_POST['imprint'], 'add');
}
if (!isset($_POST['submit']) and file_exists($filename)) {
$imprint = explode("{laststandbreak}", $content);
}
if (isset($_POST['submit'])) {
$imp_form = 0;
$data['if']['done'] = TRUE;
$data['if']['form'] = FALSE;
$data['if']['wizzard'] = FALSE;
if (file_exists($filename)) {
cs_unlink('imprint', 'imprint.txt');
}
$fp = fopen($filename, "w");
chmod($filename, 0777);
$imp_time = cs_time();
$content = $imp_time;
$content .= '{laststandbreak}';
$content .= $imprint;
# set stream encoding if possible to avoid converting issues
if (function_exists('stream_encoding')) {
stream_encoding($fp, $cs_main['charset']);
}
fwrite($fp, $content);
chmod($filename, 0755);
fclose($fp);
if ($account['access_wizard'] == 5) {
$wizard = cs_sql_count(__FILE__, 'options', "options_name = 'done_cont' AND options_value = '1'");
if (empty($wizard)) {
$data['if']['wizzard'] = TRUE;
}
示例10: pg_fetch_object
$row = pg_fetch_object($res, $i);
if (!((int) $row->flags & 1) && !((int) $row->flags & 2)) {
// pgsql '&' operator fixed display (!)
$bm_count++;
$ts = time();
$ls = $row->last_seen;
$t_val = $ts - $ls;
$t_dur = abs($t_val);
$the_duration = drake_duration($t_dur);
echo "<tr><td><a href=\"../users.php?id=" . $row->user_id . "\" target=users>" . $row->user_name . "</a></td>" . "<td><a href=\"../channels.php?id=" . $row->channel_id . "\" target=channels>" . $row->channel_name . "</a></td>";
if (($row->flags & MIA_TAG_FLAG) == MIA_TAG_FLAG) {
echo "<td><input type=button onClick=\"untag(" . (int) $row->channel_id . ",'" . md5((int) $row->channel_id . CRC_SALT_0016) . "')\" value=\"UnTag\"></td>";
} else {
echo "<td><input type=button onClick=\"tagreview(" . (int) $row->channel_id . ",'" . md5((int) $row->channel_id . CRC_SALT_0016) . "')\" value=\"Tag as reviewed\"></td>";
}
echo "<td>" . cs_time($row->last_seen) . " ({$the_duration})</td>" . "</tr>\n";
}
}
echo "</table><h3>\n";
if ($bm_count == 0) {
echo "No More Missing Managers";
}
if ($bm_count == 1) {
echo $bm_count . " Missing Manager";
}
if ($bm_count > 1) {
echo $bm_count . " Missing Managers";
}
echo "</h3>";
?>
<script language="JavaScript">
示例11: pg_safe_exec
} else {
$xr = pg_safe_exec("SELECT * FROM complaints_threads WHERE reply_text!='' AND complaint_ref='" . (int) $dao->id . "' ORDER BY reply_ts DESC LIMIT 1");
// select last reply with a public reply into it
if ($xo = pg_fetch_object($xr)) {
$dats = $xo->reply_ts;
$la_type = 1;
// assume last action is admin
if ($xo->reply_by == 0) {
$la_type = 0;
}
// if the last reply_by is 0, (user), .. last action is user
} else {
$dats = $dao->reviewed_ts;
$la_type = 0;
}
echo cs_time($dats);
}
echo "\n";
echo "next-action-awaited:\t\t";
if ($dao->status > 2) {
echo "none (ticket is CLOSED)\n";
} else {
if ($la_type == 0) {
echo "Pending CService Admin reply\n";
}
if ($la_type == 1) {
echo "Pending your reply (check the URL in the mail you received to do so)\n";
}
}
echo "</font></pre>\n";
} else {
示例12: cs_content_append
function cs_content_append($content)
{
global $account, $cs_main;
if (!empty($cs_main['sec_remote']) and $account['access_clansphere'] > 4 and ($cs_main['sec_news'] > $cs_main['sec_last'] or cs_time() - $cs_main['sec_time'] > 9000)) {
require_once 'mods/clansphere/sec_func.php';
$content = cs_cspnews() . $content;
}
if (($cs_main['action'] == 'manage' or $cs_main['action'] == 'create' or $cs_main['action'] == 'options') and isset($account['access_' . $cs_main['mod']]) and $account['access_' . $cs_main['mod']] >= 3) {
require_once 'mods/clansphere/admin_menu.php';
$content = cs_admin_menu() . $content;
}
if ($account['access_clansphere'] > 3 and file_exists('install.php') and !file_exists('.git')) {
$content = cs_subtemplate(__FILE__, array(), 'clansphere', 'del_install') . $content;
}
return $content;
}
示例13: empty
$data['register']['nick'] = $register['nick'];
$data['register']['password'] = $register['password'];
$data['register']['email'] = $register['email'];
$data['register']['send_mail'] = $register['send_mail'];
$data['register']['languages'] = '';
$data['checked']['newsletter'] = empty($register['newsletter']) ? '' : 'checked';
$data['checked']['email'] = empty($register['send_mail']) ? '' : 'checked';
foreach ($languages as $lang) {
$lang['name'] == $register['lang'] ? $sel = 1 : ($sel = 0);
$data['register']['languages'] .= cs_html_option($lang['name'], $lang['name'], $sel);
}
$data['if']['captcha'] = 0;
if (empty($op_users['def_register']) or $op_users['def_register'] == '2') {
if (!empty($captcha)) {
$data['if']['captcha'] = 1;
$data['captcha']['img'] = cs_html_img('mods/captcha/generate.php?time=' . cs_time());
}
}
if (empty($op_users['def_register']) or $op_users['def_register'] == '2') {
if ($op_users['def_register'] != '2') {
$data['if']['reg_mail'] = 1;
} else {
$data['if']['reg_mail'] = 0;
}
echo cs_subtemplate(__FILE__, $data, 'users', 'register_code');
} else {
echo cs_subtemplate(__FILE__, $data, 'users', 'register_mail');
}
} else {
$code_id = generate_code(30);
// 30 Zeichen lang
示例14: Other
$blah = "_";
}
$mmsg = $mmsg . "3) " . $blah . "_ Other (see below **)\n";
$mmsg = $mmsg . "\n";
if ($reason == "resign") {
$mmsg = $mmsg . "* :\n" . str_replace("\\'", "'", $resignreason) . "\n\n";
}
if ($reason == "other") {
$mmsg = $mmsg . "** :\n" . str_replace("\\'", "'", $otherreason) . "\n\n";
}
$mmsg = $mmsg . "\n";
$mmsg = $mmsg . "________________________________\n";
$mmsg = $mmsg . "Purge Request\n";
$mmsg = $mmsg . NETWORK_NAME . " Channel Service\n";
$mmsg = $mmsg . "version 03012001\n";
$mmsg = $mmsg . "Sent by [" . cl_ip() . "] at " . cs_time(time()) . " (user's timezone)\n";
$email = $user->email;
if (!file_exists("../testnet")) {
mail($purge_at_email, "Purge Request via WEB", $mmsg, "From: " . $_POST["email"] . "\nReply-To: " . $_POST["email"] . "\nX-Mailer: " . NETWORK_NAME . " Channel Service");
} else {
echo "<h3>Testnet : dumping mail</h3>\n";
echo str_replace("\n", "<br>", $mmsg);
}
/* make the user can re-port in 10 days. */
pg_safe_exec("UPDATE users SET post_forms=(now()::abstime::int4+86400*10) WHERE id=" . $user_id);
echo "<h2>";
echo "Please allow 3-5 days for your request to be processed.\n";
echo "</h2>\n";
echo "</body></html>\n\n";
die;
}
示例15: empty
$wars['status']['yes'] = $sel;
}
if ($select['players_status'] == 'maybe') {
$wars['status']['maybe'] = $sel;
}
if ($select['players_status'] == 'no') {
$wars['status']['no'] = $sel;
}
$wars['status']['players_id'] = $select['players_id'];
$wars['status']['wars_id'] = $wars_id;
$wars['lang']['submit'] = empty($in_list) ? $cs_lang['confirm'] : $cs_lang['edit'];
} else {
$players_id = (int) $_POST['players_id'];
$wars_id = (int) $_POST['wars_id'];
$status = $_POST['players_status'];
$time = cs_time();
if (empty($in_list)) {
$cells = array('wars_id', 'users_id', 'players_status', 'players_time');
$values = array($wars_id, $account['users_id'], $status, $time);
cs_sql_insert(__FILE__, 'players', $cells, $values);
} else {
$cells = array('players_status', 'players_time');
$values = array($status, $time);
cs_sql_update(__FILE__, 'players', $cells, $values, $players_id);
}
cs_redirect($cs_lang['success'], 'wars', 'view', 'id=' . $wars_id);
}
}
}
}
echo cs_subtemplate(__FILE__, $wars, 'wars', 'view');