当前位置: 首页>>代码示例>>PHP>>正文


PHP Model_Users::addSharedContent方法代码示例

本文整理汇总了PHP中Model_Users::addSharedContent方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Users::addSharedContent方法的具体用法?PHP Model_Users::addSharedContent怎么用?PHP Model_Users::addSharedContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model_Users的用法示例。


在下文中一共展示了Model_Users::addSharedContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 public function indexAction()
 {
     $request = $this->getRequest();
     if (JO_Session::get('user[user_id]')) {
         $this->redirect(WM_Router::create($this->getRequest()->getBaseUrl()));
     }
     if (Helper_Config::get('enable_free_registration')) {
         $this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=users&action=register'));
     }
     $this->view->login = WM_Router::create($request->getBaseUrl() . '?controller=users&action=login');
     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('email'), $this->translate('Email'), 'not_empty;min_length[5];max_length[100];email');
         if ($validate->_valid_form()) {
             $shared_contentObject = new Model_Users_Invate();
             $shared_content = $shared_contentObject->isInvatedByEmail($request->getPost('email'));
             if ($shared_content == 1) {
                 $this->view->error = $this->translate('This e-mail address is already registered');
             } else {
                 if ($shared_content == 2) {
                     $this->view->error = $this->translate('This e-mail address is already registered');
                 } else {
                     if (($key = Model_Users::addSharedContent($request->getPost('email'))) !== false) {
                         JO_Session::set('successfu_edite', true);
                         if (Helper_Config::get('not_ri')) {
                             Model_Email::send(Helper_Config::get('report_mail'), Helper_Config::get('noreply_mail'), $this->translate('New invitation request'), $this->translate('Hello, there is new invitation request in ') . ' ' . Helper_Config::get('site_name'));
                         }
                         $this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=landing'));
                     } else {
                         $this->view->error = $this->translate('There was an error. Please try again later!');
                     }
                 }
             }
         } else {
             $this->view->error = $validate->_get_error_messages();
         }
     }
     $this->view->children = array('header_part' => 'layout/header_part', 'footer_part' => 'layout/footer_part');
 }
开发者ID:NareshChennuri,项目名称:pyng,代码行数:43,代码来源:LandingController.php

示例2: indexAction

 public function indexAction()
 {
     $request = $this->getRequest();
     if (JO_Session::get('user[user_id]')) {
         $this->redirect(WM_Router::create($this->getRequest()->getBaseUrl()));
     }
     if (JO_Registry::get('enable_free_registration')) {
         $this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=users&action=register'));
     }
     if ($this->getLayout()->meta_title) {
         $this->getLayout()->placeholder('title', $this->getLayout()->meta_title . ' - ' . JO_Registry::get('meta_title'));
     } else {
         $this->getLayout()->placeholder('title', JO_Registry::get('meta_title'));
     }
     if ($this->getLayout()->meta_description) {
         $this->getLayout()->placeholder('description', $this->getLayout()->meta_description);
     } else {
         $this->getLayout()->placeholder('description', JO_Registry::get('meta_description'));
     }
     if ($this->getLayout()->meta_keywords) {
         $this->getLayout()->placeholder('keywords', $this->getLayout()->meta_keywords);
     } else {
         $this->getLayout()->placeholder('keywords', JO_Registry::get('meta_keywords'));
     }
     $this->getLayout()->placeholder('site_name', JO_Registry::get('site_name'));
     $this->view->site_name = JO_Registry::get('site_name');
     $this->view->meta_title = JO_Registry::get('meta_title');
     $this->getLayout()->placeholder('google_analytics', html_entity_decode(JO_Registry::get('google_analytics'), ENT_QUOTES, 'utf-8'));
     $this->view->baseUrl = $request->getBaseUrl();
     $this->view->site_logo = $request->getBaseUrl() . 'data/images/logo.png';
     if (JO_Registry::get('site_logo') && file_exists(BASE_PATH . '/uploads' . JO_Registry::get('site_logo'))) {
         $this->view->site_logo = $request->getBaseUrl() . 'uploads' . JO_Registry::get('site_logo');
     }
     $this->view->login = WM_Router::create($request->getBaseUrl() . '?controller=users&action=login');
     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('email'), $this->translate('Email'), 'not_empty;min_length[5];max_length[100];email');
         if ($validate->_valid_form()) {
             $shared_content = Model_Users::sharedContentInvate($request->getPost('email'));
             if ($shared_content == 1) {
                 $this->view->error = $this->translate('This e-mail address is already registered');
             } else {
                 if ($shared_content == 2) {
                     $this->view->error = $this->translate('This e-mail address is already registered');
                 } else {
                     if (($key = Model_Users::addSharedContent($request->getPost('email'))) !== false) {
                         JO_Session::set('successfu_edite', true);
                         if (JO_Registry::get('not_ri')) {
                             Model_Email::send(JO_Registry::get('report_mail'), JO_Registry::get('noreply_mail'), $this->translate('New invitation request'), $this->translate('Hello, there is new invitation request in ') . ' ' . JO_Registry::get('site_name'));
                         }
                         $this->redirect(WM_Router::create($request->getBaseUrl() . '?controller=landing'));
                     } else {
                         $this->view->error = $this->translate('There was an error. Please try again later!');
                     }
                 }
             }
         } else {
             $this->view->error = $validate->_get_error_messages();
         }
     }
     //        $this->view->children = array(
     //            'header_part'     => 'layout/header_part',
     //            'footer_part'     => 'layout/footer_part'
     //        );
 }
开发者ID:noikiy,项目名称:amatteur,代码行数:69,代码来源:LandingController.php


注:本文中的Model_Users::addSharedContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。