當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Guest::language方法代碼示例

本文整理匯總了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())));
    }
開發者ID:AdrienCourtois,項目名稱:Domoleaf,代碼行數:35,代碼來源:User.class.php

示例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] = '';
//.........這裏部分代碼省略.........
開發者ID:bonion,項目名稱:Domoleaf,代碼行數:101,代碼來源:Api.class.php

示例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())));
    }
開發者ID:bonion,項目名稱:Domoleaf,代碼行數:44,代碼來源:User.class.php

示例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;
//.........這裏部分代碼省略.........
開發者ID:AdrienCourtois,項目名稱:Domoleaf,代碼行數:101,代碼來源:Api.class.php


注:本文中的Guest::language方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。