本文整理汇总了PHP中getTimeStamp函数的典型用法代码示例。如果您正苦于以下问题:PHP getTimeStamp函数的具体用法?PHP getTimeStamp怎么用?PHP getTimeStamp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getTimeStamp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: finishAuth
public static function finishAuth()
{
Social_Client::init();
$network_name = trim(strip_tags(Social_Client::$request["sa_login_finish"]));
$network = Social_Auth::prepare($network_name);
if (!$network) {
Social_Logger::error("Invalid parameter given on sa_login_finish");
$network->adapter->disconnectUser();
header("HTTP/1.0 404 Not Found");
die("Invalid parameter given on sa_login_finish. Try login again");
}
try {
Social_Logger::info("Login finish: {$network_name}");
$network->adapter->finishLogin();
$user_profile = $network->adapter->getUserProfile();
if ($network_name == 'facebook') {
$user_profile->photoURL = $user_profile->photoURL . '&ts=' . getTimeStamp();
}
$user_profile->network_name = $network_name;
$userid = socialLogin($user_profile);
Social_Auth::session()->set("SA_USER", $user_profile);
} catch (Exception $e) {
$network->adapter->disconnectUser();
}
Social_Logger::info("Returned to callback");
$network->goToCallbackPage();
die;
}
开发者ID:albertoneto,项目名称:localhost,代码行数:28,代码来源:Client.php
示例2: formatMessage
private function formatMessage($level, $msgFormat, $params = null)
{
$message = "[";
switch ($level) {
case self::LOG_DEBUG:
$message .= 'debug';
break;
case self::LOG_INFO:
$message .= 'info';
break;
case self::LOG_ERROR:
$message .= 'error';
break;
case self::LOG_FATAL:
$message .= 'fatal';
break;
default:
return '';
}
$parts = explode(' ', microtime());
$message .= '][' . getTimeStamp() . "-" . floatval($parts[0]) * 100000000 . '] ';
if (is_array($params)) {
$message .= vsprintf($msgFormat, $params);
} elseif (!is_null($params)) {
$message .= sprintf($msgFormat, $params);
} else {
$message .= $msgFormat;
}
return $message;
}
开发者ID:GameCrusherTechnology,项目名称:HeroTowerServer,代码行数:30,代码来源:Logger.class.php
示例3: chatroomsusers
function chatroomsusers()
{
$sql = "delete from cometchat_chatrooms_users where lastactivity < (" . getTimeStamp() . "-3600)";
$query = mysqli_query($GLOBALS['dbh'], $sql);
if (defined('DEV_MODE') && DEV_MODE == '1') {
echo mysqli_error($GLOBALS['dbh']);
}
}
开发者ID:networksoft,项目名称:goldenquick.pekcellgold.com,代码行数:8,代码来源:cron.php
示例4: clearGuestEntries
function clearGuestEntries()
{
$sql = "delete from cometchat_guests where id in (select userid from cometchat_status where (" . mysqli_real_escape_string($GLOBALS['dbh'], getTimeStamp()) . "-cometchat_status.lastactivity)>10800)";
$query = mysqli_query($GLOBALS['dbh'], $sql);
if (defined('DEV_MODE') && DEV_MODE == '1') {
echo mysqli_error($GLOBALS['dbh']);
}
}
开发者ID:albertoneto,项目名称:localhost,代码行数:8,代码来源:cron.php
示例5: onlineusers
function onlineusers()
{
global $db;
$sql = "select count(distinct(cometchat.from)) users from cometchat where ('" . mysqli_real_escape_string($GLOBALS['dbh'], getTimeStamp()) . "'-cometchat.sent)<300";
$query = mysqli_query($GLOBALS['dbh'], $sql);
$chat = mysqli_fetch_assoc($query);
return $chat['users'];
}
开发者ID:albertoneto,项目名称:localhost,代码行数:8,代码来源:index.php
示例6: chatroomsusers
function chatroomsusers()
{
$sql = "delete from cometchat_chatrooms_users where (" . getTimeStamp() . "-lastactivity)>3600";
$query = mysql_query($sql);
if (defined('DEV_MODE') && DEV_MODE == '1') {
echo mysql_error();
}
echo "All inactive chatroom users have been deleted.<br />";
}
开发者ID:quachvancam,项目名称:sugardating,代码行数:9,代码来源:cron.php
示例7: getDBDateValue
/**
* Get db prepared dateTime value
* @param String textValue
* @param String dateFormat
* @return String
*/
function getDBDateValue($textValue, $dateFormat)
{
if (!$textValue) {
return NULL;
}
$timeStamp = getTimeStamp($textValue, $dateFormat);
if ($timeStamp === FALSE) {
return NULL;
}
$time = localtime($timeStamp, true);
return $time["tm_year"] + 1900 . "-" . ($time["tm_mon"] + 1) . "-" . $time["tm_mday"] . " " . $time["tm_hour"] . ":" . $time["tm_min"] . ":" . $time["tm_sec"];
}
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:18,代码来源:import_functions.php
示例8: publish
function publish($args)
{
if (!($args['channel'] && $args['message'])) {
echo 'Missing Channel or Message';
return false;
}
$channel = $args['channel'];
$message = json_encode($args['message']);
$sql = "insert into cometchat_comethistory (channel,message,sent) values ( '" . mysqli_real_escape_string($GLOBALS['dbh'], $channel) . "', '" . mysqli_real_escape_string($GLOBALS['dbh'], serialize($args['message'])) . "','" . getTimeStamp() . "')";
mysqli_query($GLOBALS['dbh'], $sql);
$string_to_sign = implode('/', array($this->PUBLISH_KEY, $this->SUBSCRIBE_KEY, $this->SECRET_KEY, $channel, $message));
$signature = $this->SECRET_KEY ? md5($string_to_sign) : '0';
if (strlen($message) > $this->LIMIT) {
echo 'Message TOO LONG (' . $this->LIMIT . ' LIMIT)';
return array(0, 'Message Too Long.');
}
return $this->_request(array('publish', $this->PUBLISH_KEY, $this->SUBSCRIBE_KEY, $signature, $channel, '0', $message));
}
开发者ID:networksoft,项目名称:oficina.pekcellgold.com,代码行数:18,代码来源:comet.php
示例9: isSubscriber
/**
* 查询用户是否订阅,订阅是否过期。
* @param $appInstanceId 用户订阅的app实例id
*
* @return
* 1. 用户没有订阅,返回false
* 2. 用户已订阅,但是已过期,返回订阅结束的时间
* 3. 用户已订阅,并且没有过期,返回true
*
*/
public static function isSubscriber($appInstanceId)
{
$sip_sessionid = session_id();
$result = RESTRequestHelper::postRequest('alisoft.getSubscCtrl', array('appInstanceId' => $appInstanceId), $sip_sessionid);
writeDebug("getSubscCtrl of appInstance {$appInstanceId} result:" . $result);
if ($result == null || strlen($result) < 1) {
return false;
}
$xml = new SimpleXMLElement($result);
$endDate = $xml->gmtEnd;
writeDebug('End date of subscribe:' . $endDate);
$endDate = substr($endDate, 0, 10);
$currentDate = getTimeStamp('Y-m-d');
if ($endDate <= $currentDate) {
return $endDate;
}
return true;
}
开发者ID:GameCrusherTechnology,项目名称:HeroTowerServer,代码行数:28,代码来源:AlisoftValidateUserService.class.php
示例10: finishAuth
public static function finishAuth()
{
Social_Client::init();
$network_name = trim(strip_tags(Social_Client::$request["sa_login_finish"]));
$network = Social_Auth::prepare($network_name);
if (!$network) {
Social_Logger::error("Invalid parameter given on sa_login_finish");
$network->adapter->disconnectUser();
header("HTTP/1.0 404 Not Found");
die("Invalid parameter given on sa_login_finish. Try login again");
}
try {
Social_Logger::info("Login finish: {$network_name}");
$network->adapter->finishLogin();
$user_profile = $network->adapter->getUserProfile();
if ($network_name == 'facebook') {
$user_profile->photoURL = $user_profile->photoURL . '&ts=' . getTimeStamp();
}
$sql = "select " . DB_USERTABLE . "." . DB_USERTABLE_USERID . " from " . DB_USERTABLE . " where " . DB_USERTABLE . "." . DB_USERTABLE_USERNAME . " = '" . mysqli_real_escape_string($GLOBALS['dbh'], $network_name) . "_" . mysqli_real_escape_string($GLOBALS['dbh'], $user_profile->identifier) . "'";
$result = mysqli_query($GLOBALS['dbh'], $sql);
if ($row = mysqli_fetch_assoc($result)) {
$sql = "update " . DB_USERTABLE . " set " . DB_USERTABLE . "." . DB_USERTABLE_NAME . "='" . mysqli_real_escape_string($GLOBALS['dbh'], $user_profile->firstName) . "'," . DB_AVATARFIELD . "='" . mysqli_real_escape_string($GLOBALS['dbh'], $user_profile->photoURL) . "'," . DB_USERTABLE . "." . DB_LINKFIELD . "='" . mysqli_real_escape_string($GLOBALS['dbh'], $user_profile->profileURL) . "' where " . DB_USERTABLE . "." . DB_USERTABLE_USERNAME . "='" . mysqli_real_escape_string($GLOBALS['dbh'], $network_name) . "_" . mysqli_real_escape_string($GLOBALS['dbh'], $user_profile->identifier) . "'";
mysqli_query($GLOBALS['dbh'], $sql);
if (!empty($row[DB_USERTABLE_USERID])) {
$userid = $row[DB_USERTABLE_USERID];
}
} else {
$sql = "insert into " . DB_USERTABLE . " (" . DB_USERTABLE . "." . DB_USERTABLE_USERNAME . "," . DB_USERTABLE . "." . DB_USERTABLE_NAME . "," . DB_AVATARFIELD . "," . DB_USERTABLE . "." . DB_LINKFIELD . "," . DB_USERTABLE . "." . DB_GROUPFIELD . ") values ( '" . mysqli_real_escape_string($GLOBALS['dbh'], $network_name) . "_" . mysqli_real_escape_string($GLOBALS['dbh'], $user_profile->identifier) . "','" . mysqli_real_escape_string($GLOBALS['dbh'], $user_profile->firstName) . "','" . mysqli_real_escape_string($GLOBALS['dbh'], $user_profile->photoURL) . "','" . mysqli_real_escape_string($GLOBALS['dbh'], $user_profile->profileURL) . "','" . mysqli_real_escape_string($GLOBALS['dbh'], ucfirst($network_name)) . "')";
mysqli_query($GLOBALS['dbh'], $sql);
$userid = mysqli_insert_id($GLOBALS['dbh']);
}
$_SESSION['cometchat']['userid'] = $userid;
$_SESSION['cometchat']['ccauth'] = '1';
Social_Auth::session()->set("SA_USER", $user_profile);
} catch (Exception $e) {
$network->adapter->disconnectUser();
}
Social_Logger::info("Returned to callback");
$network->goToCallbackPage();
die;
}
开发者ID:hughnguy,项目名称:php,代码行数:41,代码来源:Client.php
示例11: postRequest
/**
* 向阿里REST服务器发送调用请求。
*
* @param string $apiname api名字
* @param string $appInstanceId 用户订购的appid
* @param string $userId 用户id
* @param string $token 阿里平台产生的请求token
* @param string $sip_sessionid 用户的session id
* @param string $sip_format 请求结果格式,xml或者json,默认xml。
* @param string $otherParams 其他附加的参数。
* @return string 请求结果字符串。
*/
public static function postRequest($apiname, $appParams = null, $sip_sessionid = null, $sip_format = null)
{
//准备本次请求参数
$timestamp = getTimeStamp();
/* REST request url. Use snoopy to submit a request
$url = $this->SIP_URL_PRE."?sip_timestamp=".date("Y-m-d H:i:s")
.'&sip_appkey='.$this->APP_ID.'&appId='.$this->APP_ID.'&sip_sign='.$sip_sign.
'&token='.$token.'&appInstanceId='.$appInstanceId
.'&userId='.$userId.'&sip_apiname=alisoft.validateUser'.'&sip_sessionid='.$sip_sessionid;
*/
$formVars['sip_appkey'] = APP_ID;
$formVars['sip_apiname'] = $apiname;
$formVars['sip_timestamp'] = $timestamp;
$formVars['appId'] = APP_ID;
if (isset($sip_sessionid)) {
$formVars['sip_sessionid'] = $sip_sessionid;
}
if (isset($sip_format)) {
$formVars['sip_format'] = $sip_format;
}
if (isset($appParams) && is_array($appParams)) {
$formVars = array_merge($formVars, $appParams);
//writeDebug('form var before encode:' . print_r($formVars,true));
//$encodeParams = self::encodeParams($appParams);
}
// 生成签名
$sip_sign = SignGenerator::generateSign($formVars);
$formVars['sip_sign'] = $sip_sign;
//$formVars = array_merge($formVars,$encodeParams);
writeDebug(sprintf("API: %s\nParams: %s", $apiname, print_r($formVars, true)));
$proxy = new Snoopy();
//$proxy->set_submit_multipart();
//向AEP发出服务端请求
$proxy->submit(SIP_REST_URI, $formVars);
WriteDebug("http header:" . print_r($proxy->headers, true));
self::handleError($proxy->headers);
// 返回请求结果
return $proxy->results;
}
开发者ID:GameCrusherTechnology,项目名称:HeroTowerServer,代码行数:51,代码来源:RESTRequestHelper.class.php
示例12: getGuestID
function getGuestID()
{
$_SESSION['guestMode'] = 1;
global $cookiePrefix;
$userid = 0;
if (!empty($_COOKIE[$cookiePrefix . 'guest'])) {
$checkId = base64_decode($_COOKIE[$cookiePrefix . 'guest']);
$sql = "select id from cometchat_guests where id = '" . mysqli_real_escape_string($GLOBALS['dbh'], $checkId) . "'";
$query = mysqli_query($GLOBALS['dbh'], $sql);
$result = mysqli_fetch_assoc($query);
if (!empty($result['id'])) {
$userid = $result['id'];
}
}
if (empty($userid)) {
$random = rand(10000, 99999);
$sql = "insert into cometchat_guests (name,lastactivity) values ('" . mysqli_real_escape_string($GLOBALS['dbh'], $random) . "','" . mysqli_real_escape_string($GLOBALS['dbh'], getTimeStamp()) . "')";
$query = mysqli_query($GLOBALS['dbh'], $sql);
$userid = mysqli_insert_id($GLOBALS['dbh']);
setcookie($cookiePrefix . 'guest', base64_encode($userid), time() + 3600 * 24 * 365, "/");
}
return $userid;
}
开发者ID:kostastzo,项目名称:Cometchat,代码行数:23,代码来源:cometchat_guests.php
示例13: updateGuestLastActivity
function updateGuestLastActivity($userid)
{
$sql = "update `cometchat_guests` set lastactivity = '" . getTimeStamp() . "' where id = '" . mysql_real_escape_string($userid) . "'";
return $sql;
}
开发者ID:rezarahimi4861,项目名称:icmf,代码行数:5,代码来源:cometchat_guests.php
示例14: md5
<ul class="games">
\t{$games_language[13]}
</ul>
<div style="clear:both"></div>
</div>
</div>
</div>
</body>
</html>
EOD;
} else {
if ($_GET['action'] == 'request') {
$random_from = md5(getTimeStamp() + $userid + 'from');
$random_to = md5(getTimeStamp() + intval($_GET['toId']) + 'to');
$random_order = $random_from . ',' . $random_to;
$toId = intval($_GET['toId']);
$baseData = $_REQUEST['basedata'];
$embed = '';
$embedcss = '';
$close = "setTimeout('window.close()',2000);";
if (!empty($_GET['embed']) && $_GET['embed'] == 'web') {
$embed = 'web';
$embedcss = 'embed';
$close = "parent.closeCCPopup('games_init');";
}
if (!empty($_GET['embed']) && $_GET['embed'] == 'desktop') {
$embed = 'desktop';
$embedcss = 'embed';
$close = "parentSandboxBridge.closeCCPopup('games_init');";
开发者ID:rodino25,项目名称:tsv2,代码行数:30,代码来源:index.php
示例15: updateLastActivity
function updateLastActivity($userid)
{
$sql = "update `" . TABLE_PREFIX . DB_USERTABLE . "` set " . DB_USERTABLE_LASTACTIVITY . " = '" . getTimeStamp() . "' where " . DB_USERTABLE_USERID . " = '" . mysql_real_escape_string($userid) . "'";
return $sql;
}
开发者ID:Sywooch,项目名称:forums,代码行数:5,代码来源:integration.php
示例16: parseEnvelope
/**
* @param string $read
* @param integer $i
* @param object $hdr MessageHeader object
* @return object MessageHeader object
*/
function parseEnvelope($read, &$i, $hdr)
{
$arg_no = 0;
$arg_a = array();
++$i;
for ($cnt = strlen($read); $i < $cnt && $read[$i] != ')'; ++$i) {
$char = strtoupper($read[$i]);
switch ($char) {
case '"':
$arg_a[] = $this->parseQuote($read, $i);
++$arg_no;
break;
case '{':
$arg_a[] = $this->parseLiteral($read, $i);
/* temp bugfix (SM 1.5 will have a working clean version)
too much work to implement that version right now */
// --$i;
++$arg_no;
break;
case 'N':
/* probably NIL argument */
if (strtoupper(substr($read, $i, 3)) == 'NIL') {
$arg_a[] = '';
++$arg_no;
$i += 2;
}
break;
case '(':
/* Address structure (with group support)
* Note: Group support is useless on SMTP connections
* because the protocol doesn't support it
*/
$addr_a = array();
$group = '';
$a = 0;
for (; $i < $cnt && $read[$i] != ')'; ++$i) {
if ($read[$i] == '(') {
$addr = $this->parseAddress($read, $i);
if ($addr->host == '' && $addr->mailbox != '') {
/* start of group */
$group = $addr->mailbox;
$group_addr = $addr;
$j = $a;
} else {
if ($group && $addr->host == '' && $addr->mailbox == '') {
/* end group */
if ($a == $j + 1) {
/* no group members */
$group_addr->group = $group;
$group_addr->mailbox = '';
$group_addr->personal = "{$group}: Undisclosed recipients;";
$addr_a[] = $group_addr;
$group = '';
}
} else {
$addr->group = $group;
$addr_a[] = $addr;
}
}
++$a;
}
}
$arg_a[] = $addr_a;
break;
default:
break;
}
}
if (count($arg_a) > 9) {
$d = strtr($arg_a[0], array(' ' => ' '));
$d_parts = explode(' ', $d);
if (!$arg_a[1]) {
$arg_a[1] = _("(no subject)");
}
$hdr->date = getTimeStamp($d_parts);
/* argument 1: date */
$hdr->date_unparsed = strtr($d, '<>', ' ');
/* original date */
$hdr->subject = $arg_a[1];
/* argument 2: subject */
$hdr->from = is_array($arg_a[2]) ? $arg_a[2][0] : '';
/* argument 3: from */
$hdr->sender = is_array($arg_a[3]) ? $arg_a[3][0] : '';
/* argument 4: sender */
$hdr->reply_to = is_array($arg_a[4]) ? $arg_a[4][0] : '';
/* argument 5: reply-to */
$hdr->to = $arg_a[5];
/* argument 6: to */
$hdr->cc = $arg_a[6];
/* argument 7: cc */
$hdr->bcc = $arg_a[7];
/* argument 8: bcc */
$hdr->in_reply_to = $arg_a[8];
/* argument 9: in-reply-to */
//.........这里部分代码省略.........
开发者ID:teammember8,项目名称:roundcube,代码行数:101,代码来源:Message.class.php
示例17: newchatroomprocess
function newchatroomprocess()
{
global $ts;
$chatroom = $_POST['chatroom'];
$type = $_POST['type'];
$password = $_POST['ppassword'];
if (!empty($password) && ($type == 1 || $type == 2)) {
$password = sha1($password);
} else {
$password = '';
}
if (!empty($chatroom)) {
$sql = "insert into cometchat_chatrooms (name,createdby,lastactivity,password,type) values ('" . mysqli_real_escape_string($GLOBALS['dbh'], sanitize_core($chatroom)) . "', '0','" . mysqli_real_escape_string($GLOBALS['dbh'], getTimeStamp()) . "','" . mysqli_real_escape_string($GLOBALS['dbh'], $password) . "','" . mysqli_real_escape_string($GLOBALS['dbh'], $type) . "')";
$query = mysqli_query($GLOBALS['dbh'], $sql);
}
header("Location: ?module=chatrooms&ts={$ts}");
}
开发者ID:kostastzo,项目名称:Cometchat,代码行数:17,代码来源:chatrooms.m.php
示例18: updateLastSeen
function updateLastSeen($userid)
{
$sql = "insert into cometchat_status (userid,lastseen) values ('" . mysqli_real_escape_string($GLOBALS['dbh'], $userid) . "','" . getTimeStamp() . "') on duplicate key update lastseen = '" . getTimeStamp() . "'";
return $sql;
}
开发者ID:albertoneto,项目名称:localhost,代码行数:5,代码来源:cometchat_shared.php
示例19: typingTo
function typingTo()
{
global $response;
global $userid;
global $db;
global $messages;
$timestamp = 0;
global $chromeReorderFix;
if (USE_COMET == 1) {
return;
}
$sql = "select GROUP_CONCAT(userid, ',') from cometchat_status where typingto = '" . mysqli_real_escape_string($GLOBALS['dbh'], $userid) . "' and ('" . getTimeStamp() . "'-typingtime < 10)";
$query = mysqli_query($GLOBALS['dbh'], $sql);
if (defined('DEV_MODE') && DEV_MODE == '1') {
echo mysqli_error($GLOBALS['dbh']);
}
$chat = mysqli_fetch_assoc($query);
if (!empty($chat[0])) {
$response['tt'] = $chat[0];
} else {
$response['tt'] = '';
}
}
开发者ID:rodino25,项目名称:tsv2,代码行数:23,代码来源:cometchat_receive.php
示例20: newannouncementprocess
function newannouncementprocess()
{
global $ts;
$announcement = $_POST['announcement'];
$zero = '0';
if ($_POST['sli'] == 0) {
$zero = '-1';
}
$message = mysqli_real_escape_string($GLOBALS['dbh'], $announcement);
$sent = mysqli_real_escape_string($GLOBALS['dbh'], getTimeStamp());
$zero = mysqli_real_escape_string($GLOBALS['dbh'], $zero);
$sql = "insert into cometchat_announcements (announcement,time,`to`) values ('" . $message . "', '" . $sent . "','" . $zero . "')";
$query = mysqli_query($GLOBALS['dbh'], $sql);
$insertedid = mysqli_insert_id($GLOBALS['dbh']);
parsePusherAnn($zero, $sent, $message, 1, $insertedid);
removeCache('latest_announcement');
header("Location: ?module=announcements&ts={$ts}");
}
开发者ID:kostastzo,项目名称:Cometchat,代码行数:18,代码来源:announcements.m.php
注:本文中的getTimeStamp函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论