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


PHP Visitor類代碼示例

本文整理匯總了PHP中Visitor的典型用法代碼示例。如果您正苦於以下問題:PHP Visitor類的具體用法?PHP Visitor怎麽用?PHP Visitor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: actionIndex

 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     // renders the view file 'protected/views/site/index.php'
     // using the default layout 'protected/views/layouts/main.php'
     $visitor = new Visitor();
     $visitor->ip_address = $this->getRealIp();
     if ($visitor->save()) {
         $this->render('index');
     }
 }
開發者ID:djeyakumar,項目名稱:aircpit,代碼行數:14,代碼來源:SiteController.php

示例2: create

 public static function create($name, $location, $message, $tinyUrl = null)
 {
     $visitor = new Visitor(null);
     $visitor->setName($name);
     $visitor->setLocation($location);
     $visitor->setMessage($message);
     $visitor->setTinyUrl($tinyUrl);
     $visitor->setGeneratedId($visitor->generateId());
     $visitor->setId($visitor->save());
     return $visitor;
 }
開發者ID:jsanders,項目名稱:php_api_playground,代碼行數:11,代碼來源:visitor.php

示例3: postRegister

 public function postRegister(Request $request)
 {
     //驗證
     $this->validate($request, ['username' => 'required|max:255|unique:visitors', 'password' => 'required|min:6', 'email' => 'required|email|max:255|unique:visitors']);
     $visitor = new Visitor();
     $visitor->username = $request->input('username');
     $visitor->password = bcrypt($request->input('password'));
     $visitor->email = $request->input('email');
     $visitor->phone = $request->input('phone');
     $visitor->save();
     return redirect('auth/login');
     //return redirect($this->redirectPath('auth/login'))->with($this->statusVar, Lang::get('auth.addUserSuccess'));
 }
開發者ID:lanzhiwang,項目名稱:laravel-blog,代碼行數:13,代碼來源:PostController.php

示例4: statistics

 public function statistics()
 {
     $model = new Visitor();
     $model->user_type = 0;
     $model->user_id = Yii::app()->user->id;
     $model->user_name = Yii::app()->user->name;
     $model->server_time = new CDbExpression('NOW()');
     $model->page_title = $this->pageTitle;
     $model->page_link = Yii::app()->request->url;
     $model->browser = Yii::app()->browser->getBrowser();
     $model->visitor_ip = $_SERVER['REMOTE_ADDR'];
     $model->save();
 }
開發者ID:optimosolution,項目名稱:jasorbd,代碼行數:13,代碼來源:Controller.php

示例5: settings_nav

 static function settings_nav($navs)
 {
     if (Visitor::current()->group->can("change_settings")) {
         $navs["emailblog_settings"] = array("title" => __("EmailBlog", "emailblog"));
     }
     return $navs;
 }
開發者ID:betsyzhang,項目名稱:chyrp,代碼行數:7,代碼來源:emailblog.php

示例6: settings_nav

 public function settings_nav($navs)
 {
     if (Visitor::current()->group->can("change_settings")) {
         $navs["friendfeedr_settings"] = array("title" => __("FriendFeed", "friendfeedr"));
     }
     return $navs;
 }
開發者ID:robv,項目名稱:friendfeedr,代碼行數:7,代碼來源:friendfeedr.php

示例7: getInstance

 static function getInstance()
 {
     if (self::$instance == NULL) {
         self::$instance = new Visitor();
     }
     return self::$instance;
 }
開發者ID:notUserDeveloper,項目名稱:fl-ru-damp,代碼行數:7,代碼來源:class.visitor.php

示例8: before

 /**
  * Construct controller
  */
 public function before()
 {
     parent::before();
     if (!Visitor::instance()->logged_in('admin')) {
         throw new Permission_Exception(new Model_Role());
     }
 }
開發者ID:netbiel,項目名稱:core,代碼行數:10,代碼來源:roles.php

示例9: extend_nav

 public function extend_nav($navs)
 {
     if (Visitor::current()->group->can("toggle_extensions")) {
         $navs["extend_manager"] = array("title" => __("Extension Manager", "extension_manager"));
     }
     return $navs;
 }
開發者ID:betsyzhang,項目名稱:chyrp,代碼行數:7,代碼來源:extension_manager.php

示例10: route_submit

 /**
  * Function: submit
  * Submits a post to the blog owner.
  */
 public function route_submit()
 {
     if (!Visitor::current()->group->can("submit_article")) {
         show_403(__("Access Denied"), __("You do not have sufficient privileges to submit articles."));
     }
     if (!empty($_POST)) {
         if (!isset($_POST['hash']) or $_POST['hash'] != Config::current()->secure_hashkey) {
             show_403(__("Access Denied"), __("Invalid security key."));
         }
         if (empty($_POST['body'])) {
             Flash::notice(__("Post body can't be empty!"), redirect("/"));
         }
         if (!isset($_POST['draft'])) {
             $_POST['draft'] = "true";
         }
         $_POST['body'] = "{$_POST['body']}\n\n\n{$_POST['name']}\n{$_POST['email']}\n";
         $post = Feathers::$instances[$_POST['feather']]->submit();
         if (!in_array(false, $post)) {
             Flash::notice(__("Thank you for your submission. ", "submission"), "/");
         }
     }
     if (Theme::current()->file_exists("forms/post/submit")) {
         MainController::current()->display("forms/post/submit", array("feather" => $feather), __("Submit a Text Post"));
     } else {
         require "pages/submit.php";
     }
 }
開發者ID:betsyzhang,項目名稱:chyrp,代碼行數:31,代碼來源:submission.php

示例11: StoreFile

function StoreFile($_visitor, $_browserId, $_partner, $_fullname, $_chatId)
{
    $filename = IOStruct::GetNamebase($_FILES['form_userfile']['name']);
    Logging::GeneralLog($filename);
    if (!IOStruct::IsValidUploadFile($filename)) {
        return false;
    }
    if (empty($_fullname)) {
        $_fullname = Visitor::GetNoName($_visitor->UserId . Communication::GetIP());
    }
    $fileid = md5($filename . $_visitor->UserId . $_browserId);
    $fileurid = EX_FILE_UPLOAD_REQUEST . "_" . $fileid;
    $filemask = $_visitor->UserId . "_" . $fileid;
    $request = new FileUploadRequest($fileurid, $_partner, $_chatId);
    $request->Load();
    if ($request->Permission == PERMISSION_FULL) {
        if (move_uploaded_file($_FILES["form_userfile"]["tmp_name"], PATH_UPLOADS . $request->FileMask)) {
            KnowledgeBase::CreateFolders($_partner, false);
            KnowledgeBase::Process($_partner, $_visitor->UserId, $_fullname, 0, $_fullname, 0, 5, 3);
            KnowledgeBase::Process($_partner, $fileid, $filemask, 4, $_FILES["form_userfile"]["name"], 0, $_visitor->UserId, 4, $_FILES["form_userfile"]["size"]);
            $request->Download = true;
            $request->Save();
            return true;
        } else {
            $request->Error = true;
            $request->Save();
        }
    }
    return false;
}
開發者ID:sgh1986915,項目名稱:laravel-eyerideonline,代碼行數:30,代碼來源:upload.php

示例12: before

 /**
  * Construct controller
  */
 public function before()
 {
     parent::before();
     if (!Visitor::instance()->logged_in('admin')) {
         throw new Permission_Exception(new Model_Tag());
     }
     $this->page_title = __('Tags');
 }
開發者ID:netbiel,項目名稱:core,代碼行數:11,代碼來源:tags.php

示例13: before

 /**
  * Construct controller
  */
 public function before()
 {
     parent::before();
     if (!Visitor::instance()->logged_in('admin')) {
         throw new Permission_Exception(new Model_Tag());
     }
     $this->view = View_Page::factory(__('Tags'));
 }
開發者ID:anqh,項目名稱:anqh,代碼行數:11,代碼來源:tags.php

示例14: render

 public function render($arr)
 {
     $this->dispatch($arr);
     // if the path contains three elements and more, then the second one from the end
     // is a tracking code
     if (isset($this->_trackCode)) {
         $visitor = new Visitor();
         $visitor->trackCode = $this->_trackCode;
         $visitor->resource = $this->_resource;
         $visitor->ip = $_SERVER['REMOTE_ADDR'];
         $visitor->userAgent = $_SERVER['HTTP_USER_AGENT'];
         $visitor->time = date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']);
         $visitor->redirectTo = null;
         $visitor->store();
     }
     $this->renderJPG($this->_resource);
 }
開發者ID:veontomo,項目名稱:lite,代碼行數:17,代碼來源:View.php

示例15: processDirection

 private function processDirection($currentDirection)
 {
     switch (strtolower($currentDirection)) {
         case self::MOVE_LEFT:
             $this->currentVisitor->moveLeft();
             break;
         case self::MOVE_RIGHT:
             $this->currentVisitor->moveRight();
             break;
         case self::MOVE_UP:
             $this->currentVisitor->moveUp();
             break;
         case self::MOVE_DOWN:
             $this->currentVisitor->moveDown();
             break;
     }
 }
開發者ID:chrisemerson,項目名稱:adventOfCode,代碼行數:17,代碼來源:HouseVisitor.php


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