本文整理汇总了PHP中Guest::language方法的典型用法代码示例。如果您正苦于以下问题:PHP Guest::language方法的具体用法?PHP Guest::language怎么用?PHP Guest::language使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Guest
的用法示例。
在下文中一共展示了Guest::language方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: profileRename
/**
*
* @param string : lastname
* @param string : firstname
* @param int : gender
* @param string : phone number
* @param string : language
* @param int : user id, not used
*/
function profileRename($lastname, $firstname, $gender, $phone, $language, $id = 0)
{
$link = Link::get_link('mastercommand');
if ($gender != 1) {
$gender = 0;
}
$langList = Guest::language();
if (empty($langList[$language])) {
$language = $this->getLanguage();
}
$sql = 'UPDATE user
SET lastname= :lastname,
firstname= :firstname,
gender= :gender,
phone= :phone,
language= :language
WHERE user_id=:user_id';
$req = $link->prepare($sql);
$req->bindValue(':lastname', $lastname, PDO::PARAM_STR);
$req->bindValue(':firstname', $firstname, PDO::PARAM_STR);
$req->bindValue(':gender', $gender, PDO::PARAM_INT);
$req->bindValue(':phone', $phone, PDO::PARAM_STR);
$req->bindValue(':language', $language, PDO::PARAM_STR);
$req->bindValue(':user_id', $this->getId(), PDO::PARAM_INT);
$req->execute() or die(error_log(serialize($req->errorInfo())));
}
示例2: action
static function action($token, $request)
{
$answer = array('request' => array(), 'id' => 0, 'level' => 0, 'language' => '', 'design' => 0);
if (!empty($token)) {
$co = Guest::connect($token);
$answer['id'] = $co['id'];
$answer['level'] = $co['level'];
$answer['language'] = $co['language'];
$answer['design'] = $co['design'];
} elseif (!empty($request)) {
if (!empty($request['connection']) && !empty($request['connection'][0]) && !empty($request['connection'][1])) {
$rep = Guest::connexion($request['connection'][0], $request['connection'][1]);
$answer['request']['connection'] = $rep;
if (!empty($rep) && $rep['id'] > 0) {
$answer['id'] = $rep['id'];
$answer['level'] = $rep['level'];
$answer['language'] = $rep['language'];
$answer['design'] = $rep['design'];
}
} elseif (!empty($request['confCheckResetKey'])) {
if (!empty($request['confCheckResetKey'][0])) {
$res = Guest::confCheckResetKey($request['confCheckResetKey'][0]);
} else {
$res = False;
}
$answer['request']['confCheckResetKey'] = $res;
} elseif (!empty($request['confResetPassword']) && !empty($request['confResetPassword'][0]) && !empty($request['confResetPassword'][1])) {
$res = Guest::confResetPassword($request['confResetPassword'][0], $request['confResetPassword'][1]);
$answer['request']['confResetPassword'] = $res;
}
}
if ($answer['id'] > 0) {
//Fix pour ne pas détruire la réponse lors de la connexion
if (!empty($request['connection'])) {
unset($request['connection']);
}
/**
* 1: User
* 2: Admin
* 3: SuperAdmin
*/
switch ($answer['level']) {
case 1:
$user = new User($answer['id']);
break;
case 2:
$user = new Admin($answer['id']);
break;
case 3:
$user = new Root($answer['id']);
break;
default:
//Error
exit;
break;
}
$user->setLevel($answer['level']);
$user->setLanguage($answer['language']);
if (empty($request)) {
$user->activity();
}
if (!defined('LOCALE')) {
defineLocale($answer['language']);
}
if (!empty($request) && is_array($request)) {
foreach ($request as $action => $var) {
$res = null;
switch ($action) {
/*** Disconnect ***/
case 'disconnect':
$res = $user->disconnect($token);
break;
/*** Profile ***/
/*** Profile ***/
case 'profileList':
$res = $user->profileList();
break;
case 'profileInfo':
if (empty($var[0])) {
$var[0] = 0;
}
$res = $user->profileInfo($var[0]);
break;
case 'profileNew':
if (!empty($var[0]) && !empty($var[1])) {
$res = $user->profileNew($var[0], $var[1]);
}
break;
case 'profileRemove':
if (empty($var[0])) {
$var[0] = 0;
}
$res = $user->profileRemove($var[0]);
break;
case 'profileRename':
if (empty($var[0])) {
$var[0] = '';
}
if (empty($var[1])) {
$var[1] = '';
//.........这里部分代码省略.........
示例3: profileRename
/**
*
* @param string : lastname
* @param string : firstname
* @param int : gender
* @param string : email
* @param string : phone number
* @param string : language
* @param int : timeZone
* @param int : user id, not used
*/
function profileRename($lastname, $firstname, $gender, $email, $phone, $language, $timeZone, $id = 0)
{
$link = Link::get_link('domoleaf');
if ($gender != 1) {
$gender = 0;
}
$langList = Guest::language();
if (empty($langList[$language])) {
$language = $this->getLanguage();
}
if (empty($timeZone) || !($timeZone > 0 && $timeZone < 42)) {
$timeZone = 1;
}
$sql = 'UPDATE mcuser
SET lastname= :lastname,
firstname= :firstname,
gender= :gender,
mcuser_mail= :email,
phone= :phone,
language= :language,
timezone= :timezone
WHERE mcuser_id=:user_id';
$req = $link->prepare($sql);
$req->bindValue(':lastname', $lastname, PDO::PARAM_STR);
$req->bindValue(':firstname', $firstname, PDO::PARAM_STR);
$req->bindValue(':gender', $gender, PDO::PARAM_INT);
$req->bindValue(':email', $email, PDO::PARAM_STR);
$req->bindValue(':phone', $phone, PDO::PARAM_STR);
$req->bindValue(':language', $language, PDO::PARAM_STR);
$req->bindValue(':timezone', $timeZone, PDO::PARAM_INT);
$req->bindValue(':user_id', $this->getId(), PDO::PARAM_INT);
$req->execute() or die(error_log(serialize($req->errorInfo())));
}
示例4: action
static function action($token, $request)
{
$answer = array('request' => array(), 'id' => 0, 'level' => 0, 'language' => '', 'design' => 0);
if (!empty($token)) {
$co = Guest::connect($token);
$answer['id'] = $co['id'];
$answer['level'] = $co['level'];
$answer['language'] = $co['language'];
$answer['design'] = $co['design'];
} elseif (!empty($request)) {
if (!empty($request['connection']) && !empty($request['connection'][0]) && !empty($request['connection'][1])) {
$rep = Guest::connexion($request['connection'][0], $request['connection'][1]);
$answer['request']['connection'] = $rep;
if (!empty($rep) && $rep['id'] > 0) {
$answer['id'] = $rep['id'];
$answer['level'] = $rep['level'];
$answer['language'] = $rep['language'];
$answer['design'] = $rep['design'];
}
}
}
if ($answer['id'] > 0) {
//Fix pour ne pas détruire la réponse lors de la connexion
if (!empty($request['connection'])) {
unset($request['connection']);
}
/**
* 1: User
* 2: Admin
* 3: SuperAdmin
*/
switch ($answer['level']) {
case 1:
$user = new User($answer['id']);
break;
case 2:
$user = new Admin($answer['id']);
break;
case 3:
$user = new Root($answer['id']);
break;
default:
//Error
exit;
break;
}
$user->setLevel($answer['level']);
$user->setLanguage($answer['language']);
$user->activity();
if (!defined('LOCALE')) {
defineLocale($answer['language']);
}
if (!empty($request) && is_array($request)) {
foreach ($request as $action => $var) {
$res = null;
switch ($action) {
/*** Disconnect ***/
case 'disconnect':
$res = $user->disconnect($token);
break;
/*** Profile ***/
/*** Profile ***/
case 'profileList':
$res = $user->profileList();
break;
case 'profileInfo':
if (empty($var[0])) {
$var[0] = 0;
}
$res = $user->profileInfo($var[0]);
break;
case 'profileNew':
if (!empty($var[0]) && !empty($var[1])) {
$res = $user->profileNew($var[0], $var[1]);
}
break;
case 'profileRemove':
if (empty($var[0])) {
$var[0] = 0;
}
$res = $user->profileRemove($var[0]);
break;
case 'profileRename':
if (empty($var[0])) {
$var[0] = '';
}
if (empty($var[1])) {
$var[1] = '';
}
if (empty($var[2])) {
$var[2] = '';
}
if (empty($var[3])) {
$var[3] = '';
}
if (empty($var[4])) {
$var[4] = '';
}
if (empty($var[5])) {
$var[5] = 0;
//.........这里部分代码省略.........