本文整理汇总了PHP中helper::clearInt方法的典型用法代码示例。如果您正苦于以下问题:PHP helper::clearInt方法的具体用法?PHP helper::clearInt怎么用?PHP helper::clearInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper
的用法示例。
在下文中一共展示了helper::clearInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeAll
public function removeAll($accountId)
{
$accountId = helper::clearInt($accountId);
$currentTime = time();
//current time
$stmt = $this->db->prepare("UPDATE access_data SET removeAt = (:removeAt) WHERE accountId = (:accountId)");
$stmt->bindParam(":accountId", $accountId, PDO::PARAM_INT);
$stmt->bindParam(":removeAt", $currentTime, PDO::PARAM_INT);
if ($stmt->execute()) {
return true;
}
return false;
}
示例2: isset
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$clientId = isset($_POST['clientId']) ? $_POST['clientId'] : 0;
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : '';
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$profileId = isset($_POST['profileId']) ? $_POST['profileId'] : '';
$chatId = isset($_POST['chatId']) ? $_POST['chatId'] : 0;
$msgId = isset($_POST['msgId']) ? $_POST['msgId'] : 0;
$clientId = helper::clearInt($clientId);
$accountId = helper::clearInt($accountId);
$profileId = helper::clearInt($profileId);
$chatId = helper::clearInt($chatId);
$msgId = helper::clearInt($msgId);
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$messages = new messages($dbo);
$messages->setRequestFrom($accountId);
if ($chatId == 0) {
$chatId = $messages->getChatId($accountId, $profileId);
}
if ($chatId != 0) {
$result = $messages->getPreviousMessages($chatId, $msgId);
}
echo json_encode($result);
exit;
示例3: isset
* qascript@ifsoft.co.uk
*
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$clientId = isset($_POST['clientId']) ? $_POST['clientId'] : 0;
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$profileId = isset($_POST['profileId']) ? $_POST['profileId'] : 0;
$photoId = isset($_POST['photoId']) ? $_POST['photoId'] : 0;
$clientId = helper::clearInt($clientId);
$accountId = helper::clearInt($accountId);
$profileId = helper::clearInt($profileId);
$photoId = helper::clearInt($photoId);
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$photos = new photos($dbo);
$photos->setRequestFrom($accountId);
$accessMode = 0;
if ($accountId == $profileId) {
$accessMode = 1;
}
$result = $photos->get($profileId, $photoId, $accessMode);
echo json_encode($result);
exit;
}
示例4: isset
<?php
/*!
* ifsoft.co.uk engine v1.0
*
* http://ifsoft.com.ua, http://ifsoft.co.uk
* qascript@ifsoft.co.uk
*
* Copyright 2012-2015 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$allowMessages = isset($_POST['allowMessages']) ? $_POST['allowMessages'] : 0;
$allowMessages = helper::clearInt($allowMessages);
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$result = array("error" => false, "error_code" => ERROR_SUCCESS);
$account = new account($dbo, $accountId);
$account->setAllowMessages($allowMessages);
$result['allowMessages'] = $account->getAllowMessages();
echo json_encode($result);
exit;
}
示例5: isset
if (!empty($_POST)) {
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : '';
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$query = isset($_POST['query']) ? $_POST['query'] : '';
$userId = isset($_POST['userId']) ? $_POST['userId'] : 0;
$gender = isset($_POST['gender']) ? $_POST['gender'] : -1;
$online = isset($_POST['online']) ? $_POST['online'] : -1;
$ageFrom = isset($_POST['ageFrom']) ? $_POST['ageFrom'] : 13;
$ageTo = isset($_POST['ageTo']) ? $_POST['ageTo'] : 110;
$query = helper::clearText($query);
$query = helper::escapeText($query);
$userId = helper::clearInt($userId);
if ($gender != -1) {
$gender = helper::clearInt($gender);
}
if ($online != -1) {
$online = helper::clearInt($online);
}
$ageFrom = helper::clearInt($ageFrom);
$ageTo = helper::clearInt($ageTo);
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$search = new search($dbo);
$search->setRequestFrom($accountId);
$result = $search->query($query, $userId, $gender, $online, $ageFrom, $ageTo);
echo json_encode($result);
exit;
}
示例6: isset
/*!
* ifsoft.co.uk engine v1.0
*
* http://ifsoft.com.ua, http://ifsoft.co.uk
* qascript@ifsoft.co.uk
*
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$clientId = isset($_POST['clientId']) ? $_POST['clientId'] : 0;
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$photoId = isset($_POST['photoId']) ? $_POST['photoId'] : 0;
$abuseId = isset($_POST['abuseId']) ? $_POST['abuseId'] : 0;
$clientId = helper::clearInt($clientId);
$accountId = helper::clearInt($accountId);
$photoId = helper::clearInt($photoId);
$abuseId = helper::clearInt($abuseId);
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$report = new report($dbo);
$report->setRequestFrom($accountId);
$result = $report->photo($photoId, $abuseId);
echo json_encode($result);
exit;
}
示例7: isset
<?php
/*!
* ifsoft.co.uk engine v1.0
*
* http://ifsoft.com.ua, http://ifsoft.co.uk
* qascript@ifsoft.co.uk
*
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$funds = isset($_POST['funds']) ? $_POST['funds'] : 0;
$funds = helper::clearInt($funds);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$account = new account($dbo, $accountId);
$result = $account->setBalance($account->getBalance() + $funds);
if ($result['error'] === false) {
$result['balance'] = $account->getBalance();
}
echo json_encode($result);
exit;
}
示例8: isset
/*!
* ifsoft.co.uk engine v1.0
*
* http://ifsoft.com.ua, http://ifsoft.co.uk
* qascript@ifsoft.co.uk
*
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$profileId = isset($_POST['profileId']) ? $_POST['profileId'] : 0;
$reason = isset($_POST['reason']) ? $_POST['reason'] : 0;
$profileId = helper::clearInt($profileId);
$reason = helper::clearInt($reason);
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$profile = new profile($dbo, $profileId);
$profile->setRequestFrom($accountId);
if ($reason >= 0 && $reason < 4) {
$result = $profile->reportAbuse($reason);
}
echo json_encode($result);
exit;
}
示例9: isset
if (!empty($_POST)) {
$authToken = isset($_POST['authenticity_token']) ? $_POST['authenticity_token'] : '';
$username = isset($_POST['username']) ? $_POST['username'] : '';
$fullname = isset($_POST['fullname']) ? $_POST['fullname'] : '';
$location = isset($_POST['location']) ? $_POST['location'] : '';
$balance = isset($_POST['balance']) ? $_POST['balance'] : 0;
$fb_page = isset($_POST['fb_page']) ? $_POST['fb_page'] : '';
$instagram_page = isset($_POST['instagram_page']) ? $_POST['instagram_page'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';
$username = helper::clearText($username);
$username = helper::escapeText($username);
$fullname = helper::clearText($fullname);
$fullname = helper::escapeText($fullname);
$location = helper::clearText($location);
$location = helper::escapeText($location);
$balance = helper::clearInt($balance);
$fb_page = helper::clearText($fb_page);
$fb_page = helper::escapeText($fb_page);
$instagram_page = helper::clearText($instagram_page);
$instagram_page = helper::escapeText($instagram_page);
$email = helper::clearText($email);
$email = helper::escapeText($email);
if ($authToken === helper::getAuthenticityToken()) {
$account->setUsername($username);
$account->setFullname($fullname);
$account->setLocation($location);
$account->setBalance($balance);
$account->setFacebookPage($fb_page);
$account->setInstagramPage($instagram_page);
$account->setEmail($email);
}
示例10: isset
$gcm_regId = isset($_POST['gcm_regId']) ? $_POST['gcm_regId'] : '';
$facebookId = isset($_POST['facebookId']) ? $_POST['facebookId'] : '';
$username = isset($_POST['username']) ? $_POST['username'] : '';
$fullname = isset($_POST['fullname']) ? $_POST['fullname'] : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';
$user_sex = isset($_POST['sex']) ? $_POST['sex'] : 0;
$user_year = isset($_POST['year']) ? $_POST['year'] : 0;
$user_month = isset($_POST['month']) ? $_POST['month'] : 0;
$user_day = isset($_POST['day']) ? $_POST['day'] : 0;
$language = isset($_POST['language']) ? $_POST['language'] : '';
$clientId = helper::clearInt($clientId);
$user_sex = helper::clearInt($user_sex);
$user_year = helper::clearInt($user_year);
$user_month = helper::clearInt($user_month);
$user_day = helper::clearInt($user_day);
$facebookId = helper::clearText($facebookId);
$gcm_regId = helper::clearText($gcm_regId);
$username = helper::clearText($username);
$fullname = helper::clearText($fullname);
$password = helper::clearText($password);
$email = helper::clearText($email);
$language = helper::clearText($language);
$facebookId = helper::escapeText($facebookId);
$gcm_regId = helper::escapeText($gcm_regId);
$username = helper::escapeText($username);
$fullname = helper::escapeText($fullname);
$password = helper::escapeText($password);
$email = helper::escapeText($email);
$language = helper::escapeText($language);
if ($clientId != CLIENT_ID) {
示例11: header
case 'remove':
$gift->db_remove($id);
header("Location: /admin/gifts.php");
break;
default:
header("Location: /admin/gifts.php");
break;
}
}
}
if (!empty($_POST)) {
$authToken = isset($_POST['authenticity_token']) ? $_POST['authenticity_token'] : '';
$cost = isset($_POST['cost']) ? $_POST['cost'] : 3;
$category = isset($_POST['category']) ? $_POST['category'] : 0;
$cost = helper::clearInt($cost);
$category = helper::clearInt($category);
if ($authToken === helper::getAuthenticityToken() && !APP_DEMO) {
if (isset($_FILES['uploaded_file']['name'])) {
$uploaded_file = $_FILES['uploaded_file']['tmp_name'];
$uploaded_file_name = basename($_FILES['uploaded_file']['name']);
$uploaded_file_ext = pathinfo($_FILES['uploaded_file']['name'], PATHINFO_EXTENSION);
$gift_next_id = $gift->db_getMaxId();
$gift_next_id++;
if (move_uploaded_file($_FILES['uploaded_file']['tmp_name'], GIFTS_PATH . $gift_next_id . "." . $uploaded_file_ext)) {
$gift->db_add($cost, $category, APP_URL . "/" . GIFTS_PATH . $gift_next_id . "." . $uploaded_file_ext);
}
}
}
header("Location: /admin/gifts.php");
}
helper::newAuthenticityToken();
示例12: isset
<?php
/*!
* ifsoft.co.uk engine v1.0
*
* http://ifsoft.com.ua, http://ifsoft.co.uk
* qascript@ifsoft.co.uk
*
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$allowMessagesGCM = isset($_POST['allowMessagesGCM']) ? $_POST['allowMessagesGCM'] : 0;
$allowMessagesGCM = helper::clearInt($allowMessagesGCM);
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$result = array("error" => false, "error_code" => ERROR_SUCCESS);
$account = new account($dbo, $accountId);
$account->setAllowMessagesGCM($allowMessagesGCM);
$result['allowMessagesGCM'] = $account->getAllowMessagesGCM();
echo json_encode($result);
exit;
}
示例13: header
/*!
* ifsoft.co.uk engine v1.0
*
* http://ifsoft.com.ua, http://ifsoft.co.uk
* qascript@ifsoft.co.uk
*
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
if (!admin::isSession()) {
header("Location: /admin/login.php");
}
$stats = new stats($dbo);
$admin = new admin($dbo);
$report = new report($dbo);
$photoId = 0;
$photoInfo = array();
if (isset($_GET['id'])) {
$photoId = isset($_GET['id']) ? $_GET['id'] : 0;
$accessToken = isset($_GET['access_token']) ? $_GET['access_token'] : '';
$fromUserId = isset($_GET['fromUserId']) ? $_GET['fromUserId'] : 0;
$photoId = helper::clearInt($photoId);
$fromUserId = helper::clearInt($fromUserId);
$photos = new photos($dbo);
$photos->setRequestFrom($fromUserId);
$photos->remove($photoId);
$report->removePhotoReports($photoId);
} else {
header("Location: /admin/main.php");
exit;
}
示例14: preg_replace
$location = helper::clearText($location);
$location = helper::escapeText($location);
$facebookPage = helper::clearText($facebookPage);
$facebookPage = helper::escapeText($facebookPage);
$instagramPage = helper::clearText($instagramPage);
$instagramPage = helper::escapeText($instagramPage);
$bio = helper::clearText($bio);
$bio = preg_replace("/[\r\n]+/", " ", $bio);
//replace all new lines to one new line
$bio = preg_replace('/\\s+/', ' ', $bio);
//replace all white spaces to one space
$bio = helper::escapeText($bio);
$sex = helper::clearInt($sex);
$year = helper::clearInt($year);
$month = helper::clearInt($month);
$day = helper::clearInt($day);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$account = new account($dbo, $accountId);
$account->setLastActive();
$account->setFullname($fullname);
$account->setLocation($location);
$account->setStatus($bio);
$account->setSex($sex);
$account->setBirth($year, $month, $day);
$account->set_iStatus($iStatus);
$account->set_iPoliticalViews($politicalViews);
$account->set_iWorldView($worldViews);
示例15: header
*
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
if (!admin::isSession()) {
header("Location: /admin/login.php");
}
$stats = new stats($dbo);
$admin = new admin($dbo);
$postId = 0;
$chatInfo = array();
if (isset($_GET['id'])) {
$chatId = isset($_GET['id']) ? $_GET['id'] : 0;
$accessToken = isset($_GET['access_token']) ? $_GET['access_token'] : 0;
$act = isset($_GET['act']) ? $_GET['act'] : '';
$chatId = helper::clearInt($chatId);
$messages = new messages($dbo);
$chatInfo = $messages->getFull($chatId);
if ($chatInfo['error'] === true) {
header("Location: /admin/main.php");
exit;
}
} else {
header("Location: /admin/main.php");
exit;
}
$page_id = "chat";
$error = false;
$error_message = '';
$css_files = array("admin.css");
$page_title = "Chat";