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


PHP Model_Users::createUsersLocation方法代碼示例

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


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

示例1: registerAction


//.........這裏部分代碼省略.........
                     $location = 'location' . $i;
                     $lat = 'lat' . $i;
                     $len = 'len' . $i;
                     if ($request->issetPost($location)) {
                         if ($request->getPost($location) != "") {
                             $lat = $request->getPost($lat);
                             $len = $request->getPost($len);
                             while (Model_Users::getLocationUsersLatLen($lat, $len)) {
                                 $posLat = strpos($lat, ".");
                                 $longLat = strlen(substr((string) $lat, $posLat));
                                 $cantLat = 0;
                                 for ($x = 0; $x < $longLat - 4; $x++) {
                                     if ($x == 0) {
                                         $cantLat .= ".0";
                                     } else {
                                         $cantLat .= "0";
                                     }
                                 }
                                 $cantLat .= "1";
                                 $lat = $lat + $cantLat;
                                 $posLen = strpos($len, ".");
                                 $longLen = strlen(substr((string) $len, $posLen));
                                 $cantLen = 0;
                                 for ($y = 0; $y < $longLen - 4; $y++) {
                                     if ($y == 0) {
                                         $cantLen .= ".0";
                                     } else {
                                         $cantLen .= "0";
                                     }
                                 }
                                 $cantLen .= "1";
                                 $len = $len + $cantLen;
                             }
                             if (Model_Users::createUsersLocation($result, $request->getPost($location), $lat, $len)) {
                             }
                         }
                     }
                 }
                 for ($i = 0; $i < 350; $i++) {
                     //option1
                     if ($request->issetPost('option' . $i)) {
                         $this->view->successfu_edite = false;
                         $sport = $request->getPost('option' . $i);
                         if (Model_Users::createUsersSports($result, $sport)) {
                             $this->view->successfu_edite = true;
                         }
                     }
                 }
                 if (self::sendMail($result)) {
                     //self::loginInit($result);
                 }
                 $return = array('id' => $result);
                 //['user_id']);
             } else {
                 $return = array('error' => 3, 'description' => $this->translate('There was a problem with the record. Please try again!'));
             }
         } else {
             $return = array('error' => 4, 'description' => str_replace("<br />", ". ", $validate->_get_error_messages()));
         }
     }
     $this->view->baseUrl = $request->getBaseUrl();
     if ($request->issetPost('email')) {
         $this->view->email = $request->getRequest('email');
     } else {
         if (isset($shared_content['email'])) {
             $this->view->email = $shared_content['email'];
開發者ID:noikiy,項目名稱:amatteur,代碼行數:67,代碼來源:Apiv1Controller.php

示例2: indexAction


//.........這裏部分代碼省略.........
                         $location = 'location' . $i;
                         $lat = 'lat' . $i;
                         $len = 'len' . $i;
                         if ($request->issetPost($location)) {
                             if ($request->getPost($location) != "") {
                                 $lat = $request->getPost($lat);
                                 $len = $request->getPost($len);
                                 while (Model_Users::getLocationUsersLatLen($lat, $len)) {
                                     $posLat = strpos($lat, ".");
                                     $longLat = strlen(substr((string) $lat, $posLat));
                                     $cantLat = 0;
                                     for ($i = 0; $i < $longLat - 4; $i++) {
                                         if ($i == 0) {
                                             $cantLat .= ".0";
                                         } else {
                                             $cantLat .= "0";
                                         }
                                     }
                                     $cantLat .= "1";
                                     $lat = $lat + $cantLat;
                                     $posLen = strpos($len, ".");
                                     $longLen = strlen(substr((string) $len, $posLen));
                                     $cantLen = 0;
                                     for ($i = 0; $i < $longLen - 4; $i++) {
                                         if ($i == 0) {
                                             $cantLen .= ".0";
                                         } else {
                                             $cantLen .= "0";
                                         }
                                     }
                                     $cantLen .= "1";
                                     $len = $len + $cantLen;
                                 }
                                 if (Model_Users::createUsersLocation(JO_Session::get('user[user_id]'), $request->getPost($location), $lat, $len)) {
                                 }
                             }
                         }
                     }
                 }
                 $this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=settings'));
             } else {
                 $this->view->error = $this->translate('There was a problem with the record. Please try again!');
             }
         } else {
             $this->view->error = $validate->_get_error_messages();
         }
         foreach ($data as $k => $v) {
             if (isset($user_data[$k])) {
                 $user_data[$k] = $v;
             }
         }
     }
     if ($info) {
         $user_data['avatar'] = WM_Router::create($request->getBaseUrl() . '?controller=settings&action=temporary_avatar&s=' . microtime(true));
         $user_data['has_avatar'] = true;
     } else {
         $avatar = Helper_Uploadimages::avatar($user_data, '_B');
         $user_data['avatar'] = $avatar['image'] . '?s=' . microtime(true);
         $user_data['has_avatar'] = @getimagesize($user_data['avatar']) ? true : false;
     }
     //////////// User location ////////////
     $this->view->user_location = array();
     $this->view->user_lat = array();
     $this->view->user_len = array();
     $this->view->locationcounter = 0;
     if ($request->issetPost('location1')) {
開發者ID:noikiy,項目名稱:amatteur,代碼行數:67,代碼來源:SettingsController.php

示例3: registerAction


//.........這裏部分代碼省略.........
                                $posLat = strpos($lat, ".");
                                $longLat = strlen(substr((string) $lat, $posLat));
                                $cantLat = 0;
                                for ($x = 0; $x < ($longLat - 4); $x++)
                                {
                                    if ($x == 0)
                                    {
                                        $cantLat .= ".0";
                                    } else
                                    {
                                        $cantLat .= "0";
                                    }
                                }
                                $cantLat .= "1";
                                $lat = $lat + $cantLat;
                             
                                $posLen = strpos($len, ".");
                                $longLen = strlen(substr((string) $len, $posLen));
                                $cantLen = 0;
                                for ($y = 0; $y < ($longLen - 4); $y++)
                                {
                                    if ($y == 0)
                                    {
                                        $cantLen .= ".0";
                                    } else
                                    {
                                        $cantLen .= "0";
                                    }
                                }
                                $cantLen .= "1";
                                $len = $len + $cantLen;
                                                             }
                             */
                             if (Model_Users::createUsersLocation($result, $request->getPost($location), $lat, $len)) {
                             }
                         }
                     }
                 }
                 if (Model_Users::editUserSports($result)) {
                 }
                 if (self::sendMail($result)) {
                     self::loginInit($result);
                 }
             } else {
                 $this->view->error = $this->translate('There was a problem with the record. Please try again!');
             }
         } else {
             $this->view->error = $validate->_get_error_messages();
         }
     }
     $this->view->baseUrl = $request->getBaseUrl();
     if ($request->issetPost('email')) {
         $this->view->email = $request->getPost('email');
     } else {
         if (isset($shared_content['email'])) {
             $this->view->email = $shared_content['email'];
         } else {
             $this->view->email = '';
         }
     }
     if ($request->issetPost('firstname')) {
         $this->view->firstname = $request->getPost('firstname');
     } else {
         $this->view->firstname = '';
     }
     if ($request->issetPost('lastname')) {
開發者ID:noikiy,項目名稱:amatteur,代碼行數:67,代碼來源:UsersController.php


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