本文整理汇总了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');
}
}
示例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;
}
示例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'));
}
示例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();
}
示例5: settings_nav
static function settings_nav($navs)
{
if (Visitor::current()->group->can("change_settings")) {
$navs["emailblog_settings"] = array("title" => __("EmailBlog", "emailblog"));
}
return $navs;
}
示例6: settings_nav
public function settings_nav($navs)
{
if (Visitor::current()->group->can("change_settings")) {
$navs["friendfeedr_settings"] = array("title" => __("FriendFeed", "friendfeedr"));
}
return $navs;
}
示例7: getInstance
static function getInstance()
{
if (self::$instance == NULL) {
self::$instance = new Visitor();
}
return self::$instance;
}
示例8: before
/**
* Construct controller
*/
public function before()
{
parent::before();
if (!Visitor::instance()->logged_in('admin')) {
throw new Permission_Exception(new Model_Role());
}
}
示例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;
}
示例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";
}
}
示例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;
}
示例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');
}
示例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'));
}
示例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);
}
示例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;
}
}