本文整理汇总了PHP中helper::u_agent方法的典型用法代码示例。如果您正苦于以下问题:PHP helper::u_agent方法的具体用法?PHP helper::u_agent怎么用?PHP helper::u_agent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper
的用法示例。
在下文中一共展示了helper::u_agent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add($userId, $reason = "")
{
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$currentTime = time();
$ip_addr = helper::ip_addr();
$u_agent = helper::u_agent();
$stmt = $this->db->prepare("INSERT INTO profile_blacklist (blockedByUserId, blockedUserId, reason, createAt, ip_addr, u_agent) value (:blockedByUserId, :blockedUserId, :reason, :createAt, :ip_addr, :u_agent)");
$stmt->bindParam(":blockedByUserId", $this->requestFrom, PDO::PARAM_INT);
$stmt->bindParam(":blockedUserId", $userId, PDO::PARAM_INT);
$stmt->bindParam(":reason", $reason, PDO::PARAM_STR);
$stmt->bindParam(":createAt", $currentTime, PDO::PARAM_INT);
$stmt->bindParam(":ip_addr", $ip_addr, PDO::PARAM_STR);
$stmt->bindParam(":u_agent", $u_agent, PDO::PARAM_STR);
if ($stmt->execute()) {
$result = array("error" => false, "error_code" => ERROR_SUCCESS);
$my_profile = new profile($this->db, $this->requestFrom);
if ($my_profile->is_friend_exists($userId)) {
$friends = new friends($this->db, $this->requestFrom);
$friends->remove($userId);
unset($friends);
} else {
if ($my_profile->is_follower_exists($userId)) {
// Unfollow
$my_profile->addFollower($userId);
}
$profile = new profile($this->db, $userId);
if ($profile->is_follower_exists($this->requestFrom)) {
$profile->addFollower($this->requestFrom);
}
unset($profile);
}
unset($my_profile);
}
return $result;
}
示例2: add
public function add($mode, $comment, $originImgUrl = "", $previewImgUrl = "", $imgUrl = "", $photoArea = "", $photoCountry = "", $photoCity = "", $photoLat = "", $photoLng = "")
{
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
if (strlen($originImgUrl) == 0 && strlen($previewImgUrl) == 0 && strlen($imgUrl) == 0) {
return $result;
}
if (strlen($comment) != 0) {
$comment = $comment . " ";
}
$currentTime = time();
$ip_addr = helper::ip_addr();
$u_agent = helper::u_agent();
$stmt = $this->db->prepare("INSERT INTO photos (fromUserId, accessMode, comment, originImgUrl, previewImgUrl, imgUrl, area, country, city, lat, lng, createAt, ip_addr, u_agent) value (:fromUserId, :accessMode, :comment, :originImgUrl, :previewImgUrl, :imgUrl, :area, :country, :city, :lat, :lng, :createAt, :ip_addr, :u_agent)");
$stmt->bindParam(":fromUserId", $this->requestFrom, PDO::PARAM_INT);
$stmt->bindParam(":accessMode", $mode, PDO::PARAM_INT);
$stmt->bindParam(":comment", $comment, PDO::PARAM_STR);
$stmt->bindParam(":originImgUrl", $originImgUrl, PDO::PARAM_STR);
$stmt->bindParam(":previewImgUrl", $previewImgUrl, PDO::PARAM_STR);
$stmt->bindParam(":imgUrl", $imgUrl, PDO::PARAM_STR);
$stmt->bindParam(":area", $photoArea, PDO::PARAM_STR);
$stmt->bindParam(":country", $photoCountry, PDO::PARAM_STR);
$stmt->bindParam(":city", $photoCity, PDO::PARAM_STR);
$stmt->bindParam(":lat", $photoLat, PDO::PARAM_STR);
$stmt->bindParam(":lng", $photoLng, PDO::PARAM_STR);
$stmt->bindParam(":createAt", $currentTime, PDO::PARAM_INT);
$stmt->bindParam(":ip_addr", $ip_addr, PDO::PARAM_STR);
$stmt->bindParam(":u_agent", $u_agent, PDO::PARAM_STR);
if ($stmt->execute()) {
$result = array("error" => false, "error_code" => ERROR_SUCCESS, "photoId" => $this->db->lastInsertId(), "photo" => $this->info($this->db->lastInsertId()));
$account = new account($this->db, $this->requestFrom);
$account->updateCounters();
unset($account);
}
return $result;
}
示例3: createTicket
public function createTicket($accountId, $email, $subject, $text, $clientId = 0)
{
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$currentTime = time();
$ip_addr = helper::ip_addr();
$u_agent = helper::u_agent();
$stmt = $this->db->prepare("INSERT INTO support (clientId, accountId, email, subject, text, createAt, ip_addr, u_agent) value (:clientId, :accountId, :email, :subject, :text, :createAt, :ip_addr, :u_agent)");
$stmt->bindParam(":clientId", $clientId, PDO::PARAM_INT);
$stmt->bindParam(":accountId", $accountId, PDO::PARAM_INT);
$stmt->bindParam(":email", $email, PDO::PARAM_STR);
$stmt->bindParam(":subject", $subject, PDO::PARAM_STR);
$stmt->bindParam(":text", $text, PDO::PARAM_STR);
$stmt->bindParam(":createAt", $currentTime, PDO::PARAM_INT);
$stmt->bindParam(":ip_addr", $ip_addr, PDO::PARAM_STR);
$stmt->bindParam(":u_agent", $u_agent, PDO::PARAM_STR);
if ($stmt->execute()) {
$result = array("error" => false, "error_code" => ERROR_SUCCESS);
}
return $result;
}
示例4: create
public function create($accountId, $clientId = 0)
{
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$currentTime = time();
// Current time
$u_agent = helper::u_agent();
$ip_addr = helper::ip_addr();
$accessToken = md5(uniqid(rand(), true));
$stmt = $this->db->prepare("INSERT INTO access_data (accountId, accessToken, clientId, createAt, u_agent, ip_addr) value (:accountId, :accessToken, :clientId, :createAt, :u_agent, :ip_addr)");
$stmt->bindParam(":accountId", $accountId, PDO::PARAM_INT);
$stmt->bindParam(":accessToken", $accessToken, PDO::PARAM_STR);
$stmt->bindParam(":clientId", $clientId, PDO::PARAM_INT);
$stmt->bindParam(":createAt", $currentTime, PDO::PARAM_INT);
$stmt->bindParam(":u_agent", $u_agent, PDO::PARAM_STR);
$stmt->bindParam(":ip_addr", $ip_addr, PDO::PARAM_STR);
if ($stmt->execute()) {
$result = array('error' => false, 'error_code' => ERROR_SUCCESS, 'accessToken' => $accessToken, 'accountId' => $accountId);
}
return $result;
}
示例5: restorePointCreate
public function restorePointCreate($email, $clientId)
{
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$restorePointInfo = $this->restorePointInfo();
if ($restorePointInfo['error'] === false) {
return $restorePointInfo;
}
$currentTime = time();
// Current time
$u_agent = helper::u_agent();
$ip_addr = helper::ip_addr();
$hash = md5(uniqid(rand(), true));
$stmt = $this->db->prepare("INSERT INTO restore_data (accountId, hash, email, clientId, createAt, u_agent, ip_addr) value (:accountId, :hash, :email, :clientId, :createAt, :u_agent, :ip_addr)");
$stmt->bindParam(":accountId", $this->id, PDO::PARAM_INT);
$stmt->bindParam(":hash", $hash, PDO::PARAM_STR);
$stmt->bindParam(":email", $email, PDO::PARAM_STR);
$stmt->bindParam(":clientId", $clientId, PDO::PARAM_INT);
$stmt->bindParam(":createAt", $currentTime, PDO::PARAM_INT);
$stmt->bindParam(":u_agent", $u_agent, PDO::PARAM_STR);
$stmt->bindParam(":ip_addr", $ip_addr, PDO::PARAM_STR);
if ($stmt->execute()) {
$result = array('error' => false, 'error_code' => ERROR_SUCCESS, 'accountId' => $this->id, 'hash' => $hash, 'email' => $email);
}
return $result;
}
示例6: create
public function create($toUserId, $chatId, $message = "", $imgUrl = "")
{
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
if (strlen($imgUrl) == 0 && strlen($message) == 0) {
return $result;
}
if ($chatId == 0) {
$chatId = $this->getChatId($this->getRequestFrom(), $toUserId);
if ($chatId == 0) {
$chatId = $this->createChat($this->getRequestFrom(), $toUserId);
}
}
$currentTime = time();
$ip_addr = helper::ip_addr();
$u_agent = helper::u_agent();
$stmt = $this->db->prepare("INSERT INTO messages (chatId, fromUserId, toUserId, message, imgUrl, createAt, ip_addr, u_agent) value (:chatId, :fromUserId, :toUserId, :message, :imgUrl, :createAt, :ip_addr, :u_agent)");
$stmt->bindParam(":chatId", $chatId, PDO::PARAM_INT);
$stmt->bindParam(":fromUserId", $this->requestFrom, PDO::PARAM_INT);
$stmt->bindParam(":toUserId", $toUserId, PDO::PARAM_INT);
$stmt->bindParam(":message", $message, PDO::PARAM_STR);
$stmt->bindParam(":imgUrl", $imgUrl, PDO::PARAM_STR);
$stmt->bindParam(":createAt", $currentTime, PDO::PARAM_INT);
$stmt->bindParam(":ip_addr", $ip_addr, PDO::PARAM_STR);
$stmt->bindParam(":u_agent", $u_agent, PDO::PARAM_STR);
if ($stmt->execute()) {
$msgId = $this->db->lastInsertId();
$result = array("error" => false, "error_code" => ERROR_SUCCESS, "chatId" => $chatId, "msgId" => $msgId, "message" => $this->info($msgId));
$gcm = new gcm($this->db, $toUserId);
$gcm->setData(GCM_NOTIFY_MESSAGE, "You have new message", $chatId);
$gcm->send();
}
return $result;
}