本文整理汇总了PHP中settings::getIntValue方法的典型用法代码示例。如果您正苦于以下问题:PHP settings::getIntValue方法的具体用法?PHP settings::getIntValue怎么用?PHP settings::getIntValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings
的用法示例。
在下文中一共展示了settings::getIntValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: signup
public function signup($username, $fullname, $password, $email, $sex, $year, $month, $day, $language = '')
{
$result = array("error" => true);
$helper = new helper($this->db);
if (!helper::isCorrectLogin($username)) {
$result = array("error" => true, "error_code" => ERROR_UNKNOWN, "error_type" => 0, "error_description" => "Incorrect login");
return $result;
}
if ($helper->isLoginExists($username)) {
$result = array("error" => true, "error_code" => ERROR_LOGIN_TAKEN, "error_type" => 0, "error_description" => "Login already taken");
return $result;
}
if (empty($fullname)) {
$result = array("error" => true, "error_code" => ERROR_UNKNOWN, "error_type" => 3, "error_description" => "Empty user full name");
return $result;
}
if (!helper::isCorrectPassword($password)) {
$result = array("error" => true, "error_code" => ERROR_UNKNOWN, "error_type" => 1, "error_description" => "Incorrect password");
return $result;
}
if (!helper::isCorrectEmail($email)) {
$result = array("error" => true, "error_code" => ERROR_UNKNOWN, "error_type" => 2, "error_description" => "Wrong email");
return $result;
}
if ($helper->isEmailExists($email)) {
$result = array("error" => true, "error_code" => ERROR_EMAIL_TAKEN, "error_type" => 2, "error_description" => "User with this email is already registered");
return $result;
}
if ($sex < 0 || $sex > 1) {
$sex = 0;
}
$salt = helper::generateSalt(3);
$passw_hash = md5(md5($password) . $salt);
$currentTime = time();
$ip_addr = helper::ip_addr();
$accountState = ACCOUNT_STATE_ENABLED;
$default_user_balance = DEFAULT_BALANCE;
$stmt = $this->db->prepare("INSERT INTO users (state, login, fullname, passw, email, salt, balance, bYear, bMonth, bDay, sex, regtime, ip_addr) value (:state, :username, :fullname, :password, :email, :salt, :balance, :bYear, :bMonth, :bDay, :sex, :createAt, :ip_addr)");
$stmt->bindParam(":state", $accountState, PDO::PARAM_INT);
$stmt->bindParam(":username", $username, PDO::PARAM_STR);
$stmt->bindParam(":fullname", $fullname, PDO::PARAM_STR);
$stmt->bindParam(":password", $passw_hash, PDO::PARAM_STR);
$stmt->bindParam(":email", $email, PDO::PARAM_STR);
$stmt->bindParam(":salt", $salt, PDO::PARAM_STR);
$stmt->bindParam(":balance", $default_user_balance, PDO::PARAM_INT);
$stmt->bindParam(":bYear", $year, PDO::PARAM_INT);
$stmt->bindParam(":bMonth", $month, PDO::PARAM_INT);
$stmt->bindParam(":bDay", $day, PDO::PARAM_INT);
$stmt->bindParam(":sex", $sex, PDO::PARAM_INT);
$stmt->bindParam(":createAt", $currentTime, PDO::PARAM_INT);
$stmt->bindParam(":ip_addr", $ip_addr, PDO::PARAM_INT);
if ($stmt->execute()) {
$this->setId($this->db->lastInsertId());
$settings = new settings($this->db);
$this->setAdmob($settings->getIntValue("admob"));
unset($settings);
$this->setLanguage("en");
$result = array("error" => false, 'accountId' => $this->id, 'username' => $username, 'password' => $password, 'error_code' => ERROR_SUCCESS, 'error_description' => 'SignUp Success!');
return $result;
}
return $result;
}
示例2: 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);
$settings = new settings($dbo);
$admin = new admin($dbo);
$default = $settings->getIntValue("admob");
if (isset($_GET['act'])) {
$accessToken = isset($_GET['access_token']) ? $_GET['access_token'] : 0;
$act = isset($_GET['act']) ? $_GET['act'] : '';
if ($accessToken === admin::getAccessToken() && !APP_DEMO) {
switch ($act) {
case "global_off":
$settings->setValue("admob", 0);
header("Location: /admin/admob.php");
break;
case "global_on":
$settings->setValue("admob", 1);
header("Location: /admin/admob.php");
break;
case "on":
$admin->setAdmobValueForAccounts(1);