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


PHP Model_Users::getUserType方法代碼示例

本文整理匯總了PHP中Model_Users::getUserType方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model_Users::getUserType方法的具體用法?PHP Model_Users::getUserType怎麽用?PHP Model_Users::getUserType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Model_Users的用法示例。


在下文中一共展示了Model_Users::getUserType方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: MAXactivatedAction

 public function MAXactivatedAction()
 {
     $request = $this->getRequest();
     //$this->view->advanced_url = WM_Router::create($request->getBaseUrl() . '?controller=search&action=advanced');
     $this->view->advanced_url = WM_Router::create($request->getBaseUrl() . '?controller=search&action=index');
     $page = (int) $request->getRequest('page');
     if ($page < 1) {
         $page = 1;
     }
     $id = $request->getRequest('id');
     //////////// Categories ////////////
     $this->view->categories = array();
     $categories = Model_Categories::getCategories(array('filter_status' => 1));
     foreach ($categories as $category) {
         $category['subcategories'] = Model_Categories::getSubcategories($category['category_id']);
         $this->view->categories[] = $category;
     }
     //////////// User Type ////////////
     $this->view->user_types = array();
     $user_types = Model_Users::getUserType(array('filter_status' => 1));
     //////////// Age ////////////
     $this->view->ages = array();
     $ages = Model_Users::getAge();
     $this->view->ages = $ages;
     //////////// Level ////////////
     $this->view->levels = array();
     $levels = Model_Users::getLevel();
     $this->view->levels = $levels;
     if ($request->issetPost('firstname')) {
         $this->view->firstname = $request->getPost('firstname');
     } else {
         $this->view->firstname = '';
     }
     $this->view->location = '';
     if ($request->issetPost('location')) {
         $this->view->location = $request->getPost('location');
     } else {
         $this->view->location = '';
     }
     $this->view->cat_title1 = '';
     $this->view->sport_category_1 = '';
     if ($request->issetPost('sport_category_1')) {
         $this->view->sport_category_1 = $request->getPost('sport_category_1');
         if ($request->getPost('sport_category_1') != "") {
             if ($request->getPost('sport_category_1') == 1) {
                 $this->view->cat_title1 = "Todo";
             } else {
                 $this->view->cat_title1 = Model_Boards::getCategoryTitle($request->getPost('sport_category_1'));
             }
         }
     } else {
         $this->view->sport_category_1 = '';
     }
     $this->view->cat_title2 = '';
     $this->view->sport_category_2 = '';
     if ($request->issetPost('sport_category_2')) {
         $this->view->sport_category_2 = $request->getPost('sport_category_2');
         if ($request->getPost('sport_category_2') != "") {
             if ($request->getPost('sport_category_2') == 1) {
                 $this->view->cat_title2 = "Todo";
             } else {
                 $this->view->cat_title2 = Model_Boards::getCategoryTitle($request->getPost('sport_category_2'));
             }
         }
     } else {
         $this->view->sport_category_2 = '';
     }
     $this->view->cat_title3 = '';
     $this->view->sport_category_3 = '';
     if ($request->issetPost('sport_category_3')) {
         $this->view->sport_category_3 = $request->getPost('sport_category_3');
         if ($request->getPost('sport_category_3') != "") {
             if ($request->getPost('sport_category_3') == 1) {
                 $this->view->cat_title3 = "Todo";
             } else {
                 $this->view->cat_title3 = Model_Boards::getCategoryTitle($request->getPost('sport_category_3'));
             }
         }
     } else {
         $this->view->sport_category_3 = '';
     }
     $this->view->usertype_title = '';
     $this->view->type_user = '';
     if ($request->issetPost('type_user')) {
         $this->view->type_user = $request->getPost('type_user');
         if ($request->getPost('type_user') != "") {
             $this->view->usertype_title = Model_Users::getUserTypeTitle($request->getPost('type_user'));
         }
     } else {
         $this->view->type_user = '';
     }
     //gender
     if ($request->issetPost('gender')) {
         $this->view->gender = $request->getRequest('gender');
     } elseif (isset($user_data['gender'])) {
         $this->view->gender = $user_data['gender'];
     } else {
         $this->view->gender = "";
     }
     //location
//.........這裏部分代碼省略.........
開發者ID:noikiy,項目名稱:amatteur,代碼行數:101,代碼來源:SearchController.php

示例2: usertypesAction

 public function usertypesAction()
 {
     //echo"entrando";
     $this->noViewRenderer(true);
     $request = $this->getRequest();
     $response = $this->getResponse();
     $page = (int) $request->getRequest('page');
     if ($page < 1) {
         $page = 1;
     }
     $callback = $request->getRequest('callback');
     if (!preg_match('/^([a-z0-9_.]{1,})$/', $callback)) {
         $callback = false;
     }
     $return = array();
     //////////// User Type ////////////
     $user_tipos = array();
     $user_types = Model_Users::getUserType(array('filter_status' => 1));
     foreach ($user_types as $user_type) {
         $user_type['subuser_types'] = Model_Users::getSubUserType($user_type['user_type_id']);
         $user_tipos[] = $user_type;
     }
     $return = array($user_tipos);
     if ($callback) {
         $return = $callback . '(' . JO_Json::encode($return) . ')';
     } else {
         $response->addHeader('Cache-Control: no-cache, must-revalidate');
         $response->addHeader('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
         $response->addHeader('Content-type: application/json; charset=utf-8');
         $return = JO_Json::encode($return);
     }
     $response->appendBody($return);
 }
開發者ID:noikiy,項目名稱:amatteur,代碼行數:33,代碼來源:Apiv1Controller.php

示例3: indexAction

 public function indexAction()
 {
     $request = $this->getRequest();
     //////////// Categories ////////////
     $this->view->categories = array();
     $categories = Model_Categories::getCategories(array('filter_status' => 1));
     foreach ($categories as $category) {
         $category['subcategories'] = Model_Categories::getSubcategories($category['category_id']);
         $this->view->categories[] = $category;
     }
     //////////// User Type ////////////
     $this->view->user_types = array();
     $user_types = Model_Users::getUserType(array('filter_status' => 1));
     foreach ($user_types as $user_type) {
         $user_type['subuser_types'] = Model_Users::getSubUserType($user_type['user_type_id']);
         $this->view->user_types[] = $user_type;
     }
     /////////// activate //////////
     $_SESSION["activate_url"] = WM_Router::create($request->getBaseUrl() . '?controller=settings');
     $this->view->popup_activate = WM_Router::create($request->getBaseUrl() . '?controller=users&action=activate');
     $_SESSION["deportes_url"] = WM_Router::create($request->getBaseUrl() . '?controller=settings');
     $this->view->deportes = WM_Router::create($request->getBaseUrl() . '?controller=users&action=deportes');
     $this->view->user_sports = array();
     $users_sports = Model_Users::getUserSports(JO_Session::get('user[user_id]'));
     $i = 0;
     foreach ($users_sports as $user_sports) {
         if ($user_sports['sport_category'] != 1) {
             if (!Model_Boards::isCategoryParent($user_sports['sport_category'])) {
                 $this->view->user_sports[] = Model_Boards::getCategoryTitle($user_sports['sport_category']);
                 $i++;
             }
         }
     }
     $this->view->sportcounter = $i;
     $user_data = Model_Users::getUser(JO_Session::get('user[user_id]'));
     $upload = new JO_Upload_SessionStore();
     $upload->setName('upload_avatar');
     $info = $upload->getFileInfo();
     if (JO_Session::get('successfu_edite')) {
         $this->view->successfu_edite = true;
         JO_Session::clear('successfu_edite');
     }
     if ($request->isPost()) {
         $validate = new Helper_Validate();
         $validate->_set_rules($request->getPost('username'), $this->translate('Username'), 'not_empty;min_length[3];max_length[100];username');
         $validate->_set_rules($request->getPost('firstname'), $this->translate('First name'), 'not_empty;min_length[3];max_length[100]');
         //$validate->_set_rules($request->getPost('lastname'), $this->translate('Last name'), 'not_empty;min_length[3];max_length[100]');
         $validate->_set_rules($request->getPost('email'), $this->translate('Email'), 'not_empty;min_length[5];max_length[100];email');
         if ($request->issetPost('type_user')) {
             if ($request->getPost('type_user') != 1 && $request->getPost('type_user') != 5 && $request->getPost('type_user') != 12) {
                 $validate->_set_rules($request->getPost('location'), $this->translate('Location'), 'not_empty;min_length[3];max_length[100]');
             }
         }
         $validate->_set_rules($request->getPost('sports'), $this->translate('Category_id1'), 'not_empty;min_length[3];max_length[100]');
         //is_nan() sino
         /*
                                 if($request->getPost('sport_category_1') == "" && $request->getPost('sport_category_2') == "" && $request->getPost('sport_category_3') == "") {
                                     $validate->_set_rules($request->getPost('sport_category'), $this->translate('Category_id'), 'not_empty;min_length[3];max_length[100]');
         
                                 }
                                  * */
         //$validate->_set_rules($request->getPost('sport_category_1'), $this->translate('Category_id1'), 'not_empty;min_length[3];max_length[100]');
         //$validate->_set_rules($request->getPost('sport_category_2'), $this->translate('Category_id2'), 'not_empty;min_length[3];max_length[100]');
         //$validate->_set_rules($request->getPost('sport_category_3'), $this->translate('Category_id3'), 'not_empty;min_length[3];max_length[100]');
         $validate->_set_rules($request->getPost('type_user'), $this->translate('User_type_id'), 'not_empty;min_length[1];max_length[100]');
         $data = $request->getPost();
         if ($validate->_valid_form()) {
             if (Model_Users::isExistEmail($request->getPost('email'), JO_Session::get('user[email]'))) {
                 $validate->_set_form_errors($this->translate('This e-mail address is already used'));
                 $validate->_set_valid_form(false);
             }
             if (Model_Users::isExistUsername($request->getPost('username'), JO_Session::get('user[username]'))) {
                 $validate->_set_form_errors($this->translate('This username is already used'));
                 $validate->_set_valid_form(false);
             }
         }
         if ($validate->_valid_form()) {
             $data['dont_search_index'] = (int) $request->issetPost('dont_search_index');
             $data['facebook_timeline'] = (int) $request->issetPost('facebook_timeline');
             if ($info) {
                 if (!@file_exists(BASE_PATH . '/cache/avatar/') || !is_dir(BASE_PATH . '/cache/avatar/')) {
                     mkdir(BASE_PATH . '/cache/avatar/');
                 }
                 $filename = BASE_PATH . '/cache/avatar/' . md5(mt_rand() . time()) . $upload->get_extension($info['name']);
                 if (file_put_contents($filename, $info['data'])) {
                     $data['avatar'] = $filename;
                 }
             }
             $new_email_key = md5(JO_Session::get('user[email]') . mt_rand() . time());
             if (JO_Session::get('user[email]') != $request->getPost('email')) {
                 $data['new_email_key'] = $new_email_key;
             } else {
                 $data['new_email_key'] = '';
             }
             $data['new_email'] = $data['email'];
             unset($data['email']);
             /*
             $lat = $data['lat'];
             $len = $data['len'];
             
//.........這裏部分代碼省略.........
開發者ID:noikiy,項目名稱:amatteur,代碼行數:101,代碼來源:SettingsController.php

示例4: registerAction

 public function registerAction()
 {
     $request = $this->getRequest();
     $_SESSION["deportes_url"] = WM_Router::create($request->getBaseUrl() . '?controller=users&action=register');
     $this->view->deportes = WM_Router::create($request->getBaseUrl() . '?controller=users&action=deportes');
     //////////// Categories ////////////
     $this->view->categories = array();
     $categories = Model_Categories::getCategories(array('filter_status' => 1));
     foreach ($categories as $category) {
         $category['subcategories'] = Model_Categories::getSubcategories($category['category_id']);
         $this->view->categories[] = $category;
     }
     //////////// User Type ////////////
     $this->view->user_types = array();
     $user_types = Model_Users::getUserType(array('filter_status' => 1));
     foreach ($user_types as $user_type) {
         $user_type['subuser_types'] = Model_Users::getSubUserType($user_type['user_type_id']);
         $this->view->user_types[] = $user_type;
     }
     $this->view->user_sports = array();
     $users_sports = Model_Users::getUserSports(0);
     $i = 0;
     foreach ($users_sports as $user_sports) {
         if ($user_sports['sport_category'] != 1) {
             if (!Model_Boards::isCategoryParent($user_sports['sport_category'])) {
                 $this->view->user_sports[] = Model_Boards::getCategoryTitle($user_sports['sport_category']);
                 $i++;
             }
         }
     }
     //$this->view->sportcounter = $i;
     if (JO_Session::get('user[user_id]')) {
         $this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=users&action=profile&user_id=' . JO_Session::get('user[user_id]')));
     }
     $shared_content = Model_Users::checkSharedContent($request->getParam('key'), $request->getParam('user_id'));
     if (!JO_Registry::get('enable_free_registration')) {
         if (!$shared_content) {
             $this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=landing'));
         }
     } else {
         $this->view->fb_register = null;
         $fb_ses = JO_Registry::get('facebookapi');
         $session = $fb_ses->getUser();
         if (JO_Registry::get('oauth_fb_key') && JO_Registry::get('oauth_fb_secret')) {
             $this->view->fb_register = $this->facebook->getLoginUrl(array('redirect_uri' => WM_Router::create($request->getBaseUrl() . '?controller=facebook&action=login'), 'req_perms' => 'email,user_birthday,status_update,user_videos,user_status,user_photos,offline_access,read_friendlists'));
         }
     }
     if (JO_Registry::get('oauth_in_key')) {
         $this->view->instagram_register = WM_Router::create($this->getRequest()->getBaseUrl() . '?controller=instagram&action=register&next=' . urlencode(WM_Router::create($request->getBaseUrl() . '?controller=instagram&action=register')));
     }
     $this->view->error = false;
     if ($request->isPost()) {
         $validate = new Helper_Validate();
         $validate->_set_rules($request->getPost('username'), $this->translate('Username'), 'not_empty;min_length[3];max_length[100];username');
         $validate->_set_rules($request->getPost('firstname'), $this->translate('First name'), 'not_empty;min_length[3];max_length[100]');
         //$validate->_set_rules($request->getPost('lastname'), $this->translate('Last name'), 'not_empty;min_length[3];max_length[100]');
         $validate->_set_rules($request->getPost('email'), $this->translate('Email'), 'not_empty;min_length[5];max_length[100];email');
         $validate->_set_rules($request->getPost('password'), $this->translate('Password'), 'not_empty;min_length[4];max_length[30]');
         $validate->_set_rules($request->getPost('password2'), $this->translate('Confirm password'), 'not_empty;min_length[4];max_length[30]');
         if (!isset($_SESSION['token'])) {
             if ($request->issetPost('type_user')) {
                 if ($request->getPost('type_user') != 1 && $request->getPost('type_user') != 5 && $request->getPost('type_user') != 12) {
                     $validate->_set_rules($request->getPost('location'), $this->translate('Location'), 'not_empty;min_length[3];max_length[100]');
                 }
             }
             //is_nan() sino
             /* if($request->getPost('sport_category_1') == "" && $request->getPost('sport_category_2') == "" && $request->getPost('sport_category_3') == "") {
                           $validate->_set_rules($request->getPost('sport_category'), $this->translate('Category_id'), 'not_empty;min_length[3];max_length[100]');
             
                           } */
             $validate->_set_rules($request->getPost('sports'), $this->translate('Category_id1'), 'not_empty;min_length[3];max_length[100]');
             //$validate->_set_rules($request->getPost('sport_category_2'), $this->translate('Category_id2'), 'not_empty;min_length[3];max_length[100]');
             //$validate->_set_rules($request->getPost('sport_category_3'), $this->translate('Category_id3'), 'not_empty;min_length[3];max_length[100]');
             $validate->_set_rules($request->getPost('type_user'), $this->translate('User_type_id'), 'not_empty;min_length[1];max_length[100]');
         }
         if ($validate->_valid_form()) {
             if (md5($request->getPost('password')) != md5($request->getPost('password2'))) {
                 $validate->_set_form_errors($this->translate('Password and Confirm Password should be the same'));
                 $validate->_set_valid_form(false);
             }
             if (Model_Users::isExistEmail($request->getPost('email'))) {
                 $validate->_set_form_errors($this->translate('This e-mail address is already used'));
                 $validate->_set_valid_form(false);
             }
             if (Model_Users::isExistUsername($request->getPost('username'))) {
                 $validate->_set_form_errors($this->translate('This username is already used'));
                 $validate->_set_valid_form(false);
             }
         }
         if ($validate->_valid_form()) {
             $reg_key = sha1($request->getPost('email') . $request->getPost('username'));
             $lat = $request->getPost('lat');
             $len = $request->getPost('len');
             /*
             while (Model_Users::getUsersLatLen($lat, $len))
             {
             
                 $posLat = strpos($lat, ".");
                 $longLat = strlen(substr((string) $lat, $posLat));
                 $cantLat = 0;
//.........這裏部分代碼省略.........
開發者ID:noikiy,項目名稱:amatteur,代碼行數:101,代碼來源:UsersController.php


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