当前位置: 首页>>代码示例>>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;未经允许,请勿转载。