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


PHP User\Profile类代码示例

本文整理汇总了PHP中Hubzero\User\Profile的典型用法代码示例。如果您正苦于以下问题:PHP Profile类的具体用法?PHP Profile怎么用?PHP Profile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: up

 /**
  * Up
  **/
 public function up()
 {
     $query = "describe jos_citations uid";
     $this->db->setQuery($query);
     $uidField = $this->db->loadObject();
     // if we have an INT already, were good to go
     if (strtolower($uidField->Type) == 'int(11)') {
         return;
     }
     // load all citations
     $query = "SELECT id, uid FROM `jos_citations`";
     $this->db->setQuery($query);
     $citations = $this->db->loadObjectList();
     foreach ($citations as $citation) {
         if (!is_numeric($citation->uid)) {
             $newId = 62;
             $profile = \Hubzero\User\Profile::getInstance($citation->uid);
             if (is_object($profile)) {
                 $newId = $profile->get('uidNumber');
             }
             $query = "UPDATE `jos_citations` SET uid=" . $this->db->quote($newId) . " WHERE id=" . $this->db->quote($citation->id);
             $this->db->setQuery($query);
             $this->db->query();
         }
     }
     // change column name
     $query = "ALTER TABLE `jos_citations` CHANGE uid uid INT(11);";
     $this->db->setQuery($query);
     $this->db->query();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:33,代码来源:Migration20140624123157ComCitations.php

示例2: __construct

 /**
  * Constructor
  *
  * @param   integer  $scope_id  Scope ID (group, course, etc.)
  * @return  void
  */
 public function __construct($referenceid = 0)
 {
     $this->set('referenceid', $referenceid)->set('category', 'user')->set('option', $this->_segments['option']);
     $this->_segments['id'] = $referenceid;
     $this->_segments['active'] = 'wishlist';
     $this->_item = \Hubzero\User\Profile::getInstance($this->get('scope_id'));
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:13,代码来源:user.php

示例3: display

 /**
  * Display module content
  *
  * @return  void
  */
 public function display()
 {
     $this->verified = 0;
     if (!User::isGuest()) {
         $profile = Profile::getInstance(User::get('id'));
         if ($profile->get('emailConfirmed') == 1 || $profile->get('emailConfirmed') == 3) {
             $this->verified = 1;
         }
     }
     // Figure out whether this is a guess or temporary account created during the auth_link registration process
     if (User::isGuest() || is_numeric(User::get('username')) && User::get('username') < 0) {
         $this->guestOrTmpAccount = true;
     } else {
         $this->guestOrTmpAccount = false;
     }
     $this->referrer = Request::getVar('REQUEST_URI', '', 'server');
     $this->referrer = str_replace('&amp;', '&', $this->referrer);
     $this->referrer = base64_encode($this->referrer);
     $browser = new Detector();
     $this->os = $browser->platform();
     $this->os_version = $browser->platformVersion();
     $this->browser = $browser->name();
     $this->browser_ver = $browser->version();
     $this->css()->js()->js('jQuery(document).ready(function(jq) { HUB.Modules.ReportProblems.initialize("' . $this->params->get('trigger', '#tab') . '"); });');
     $this->supportParams = Component::params('com_support');
     require $this->getLayoutPath();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:32,代码来源:helper.php

示例4: plgSupportCaptcha

 /**
  * Constructor
  *
  * @param      object &$subject Event observer
  * @param      array  $config   Optional config values
  * @return     void
  */
 public function plgSupportCaptcha(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
     if (!User::isGuest()) {
         $profile = \Hubzero\User\Profile::getInstance(User::get('id'));
         if ($profile->get('emailConfirmed') == 1 || $profile->get('emailConfirmed') == 3) {
             $this->_verified = true;
         }
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:18,代码来源:captcha.php

示例5: __construct

 /**
  * Constructor
  *
  * @param      integer $scope_id Scope ID (group, course, etc.)
  * @return     void
  */
 public function __construct($scope_id = 0)
 {
     $this->set('scope_id', $scope_id);
     $this->_segments['id'] = $scope_id;
     $this->_segments['active'] = 'blog';
     $this->_item = Profile::getInstance($scope_id);
     $config = Plugin::params('members', 'blog');
     $id = String::pad($this->get('scope_id'));
     $this->set('path', str_replace('{{uid}}', $id, $config->get('uploadpath', '/site/members/{{uid}}/blog')));
     $this->set('scope', $this->get('scope_id') . '/blog');
     $this->set('option', $this->_segments['option']);
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:18,代码来源:member.php

示例6: onAfterRoute

 /**
  * Hook for after parsing route
  *
  * @return void
  */
 public function onAfterRoute()
 {
     if (App::isSite() && !User::isGuest()) {
         $exceptions = ['com_users.logout', 'com_users.userlogout', 'com_support.tickets.save.index', 'com_support.tickets.new.index', 'com_members.media.download.profiles', 'com_members.register.unconfirmed.profiles', 'com_members.register.change.profiles', 'com_members.register.resend.profiles', 'com_members.register.confirm.profiles'];
         $current = Request::getWord('option', '');
         $current .= ($controller = Request::getWord('controller', false)) ? '.' . $controller : '';
         $current .= ($task = Request::getWord('task', false)) ? '.' . $task : '';
         $current .= ($view = Request::getWord('view', false)) ? '.' . $view : '';
         $xprofile = \Hubzero\User\Profile::getInstance(User::get('id'));
         if (is_object($xprofile) && $xprofile->get('emailConfirmed') != 1 && $xprofile->get('emailConfirmed') != 3 && !in_array($current, $exceptions)) {
             Request::setVar('option', 'com_members');
             Request::setVar('controller', 'register');
             Request::setVar('task', 'unconfirmed');
             $this->event->stop();
         }
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:22,代码来源:unconfirmed.php

示例7: creator

 /**
  * Get the creator of this entry
  *
  * Accepts an optional property name. If provided
  * it will return that property value. Otherwise,
  * it returns the entire user object
  *
  * @return     mixed
  */
 public function creator($property = null)
 {
     if (!$this->_creator instanceof Profile) {
         $this->_creator = Profile::getInstance($this->get('addedBy'));
         if (!$this->_creator) {
             $this->_creator = new Profile();
         }
     }
     if ($property) {
         $property = $property == 'id' ? 'uidNumber' : $property;
         if ($property == 'picture') {
             return $this->_creator->getPicture();
         }
         return $this->_creator->get($property);
     }
     return $this->_creator;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:26,代码来源:job.php

示例8: run

 /**
  * Generate module contents
  *
  * @return  void
  */
 public function run()
 {
     include_once Component::path('com_members') . DS . 'tables' . DS . 'profile.php';
     include_once Component::path('com_members') . DS . 'tables' . DS . 'association.php';
     $database = \App::get('db');
     $this->row = null;
     $this->profile = null;
     // Randomly choose one
     $filters = array('limit' => 1, 'show' => trim($this->params->get('show')), 'start' => 0, 'sortby' => "RAND()", 'search' => '', 'authorized' => false, 'show' => trim($this->params->get('show')));
     if ($min = $this->params->get('min_contributions')) {
         $filters['contributions'] = $min;
     }
     $mp = new \Components\Members\Tables\Profile($database);
     $rows = $mp->getRecords($filters, false);
     if (count($rows) > 0) {
         $this->row = $rows[0];
     }
     // Load their bio
     $this->profile = Profile::getInstance($this->row->uidNumber);
     if (trim(strip_tags($this->profile->get('bio'))) == '') {
         return '';
     }
     // Did we have a result to display?
     if ($this->row) {
         $this->cls = trim($this->params->get('moduleclass_sfx'));
         $this->txt_length = trim($this->params->get('txt_length'));
         $config = Component::params('com_members');
         $rparams = new Registry($this->profile->get('params'));
         $this->params = $config;
         $this->params->merge($rparams);
         if ($this->params->get('access_bio') == 0 || $this->params->get('access_bio') == 1 && !User::isGuest()) {
             $this->txt = $this->profile->getBio('parsed');
         } else {
             $this->txt = '';
         }
         // Member profile
         $this->title = $this->row->name;
         if (!trim($this->title)) {
             $this->title = $this->row->givenName . ' ' . $this->row->surname;
         }
         $this->id = $this->row->uidNumber;
         $this->thumb = $this->profile->getPicture();
         $this->filters = $filters;
         require $this->getLayoutPath();
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:51,代码来源:helper.php

示例9: creator

 /**
  * Get the creator of this entry
  *
  * Accepts an optional property name. If provided
  * it will return that property value. Otherwise,
  * it returns the entire object
  *
  * @param   string  $property  Property to retrieve
  * @param   mixed   $default   Default value if property not set
  * @return  mixed
  */
 public function creator($property = null, $default = null)
 {
     if (!$this->_creator instanceof Profile) {
         $this->_creator = Profile::getInstance($this->get('created_by'));
         if (!$this->_creator) {
             $this->_creator = new Profile();
         }
         if ($this->_creator->get('uidNumber') && !trim($this->_creator->get('name'))) {
             $user = User::getInstance($this->_creator->get('uidNumber'));
             $this->_creator->set('name', $user->get('name', Lang::txt('(unknown)')));
         }
     }
     if ($property) {
         $property = $property == 'id' ? 'uidNumber' : $property;
         return $this->_creator->get($property, $default);
     }
     return $this->_creator;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:29,代码来源:base.php

示例10: displaySite

 /**
  * Display module contents
  *
  * @return  void
  */
 public function displaySite()
 {
     // Get all sessions
     $sessions = SessionHelper::getAllSessions(array('distinct' => 1, 'client' => 0));
     // Vars to hold guests & logged in members
     $this->guestCount = 0;
     $this->loggedInCount = 0;
     $this->loggedInList = array();
     // Get guest and logged in counts/list
     foreach ($sessions as $session) {
         if ($session->guest == 1) {
             $this->guestCount++;
         } else {
             $this->loggedInCount++;
             $profile = Profile::getInstance($session->userid);
             if ($profile) {
                 $this->loggedInList[] = $profile;
             }
         }
     }
     // Render view
     require $this->getLayoutPath('default');
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:28,代码来源:helper.php

示例11: creator

 /**
  * Get the creator of this entry
  *
  * Accepts an optional property name. If provided
  * it will return that property value. Otherwise,
  * it returns the entire JUser object
  *
  * @return     mixed
  */
 public function creator($property = null)
 {
     if (!$this->_creator instanceof \Hubzero\User\Profile) {
         $this->_creator = \Hubzero\User\Profile::getInstance($this->get('user_id'));
         if (!$this->_creator) {
             $this->_creator = new \Hubzero\User\Profile();
         }
     }
     if ($property) {
         $property = $property == 'id' ? 'uidNumber' : $property;
         if ($property == 'picture') {
             return $this->_creator->getPicture($this->get('anonymous'));
         }
         return $this->_creator->get($property);
     }
     return $this->_creator;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:26,代码来源:review.php

示例12: _authorCheck

 /**
  * Split a user's name into its parts if not already done
  *
  * @param      integer $id User ID
  * @return     void
  */
 private function _authorCheck($id)
 {
     $xprofile = Profile::getInstance($id);
     if ($xprofile->get('givenName') == '' && $xprofile->get('middleName') == '' && $xprofile->get('surname') == '') {
         $bits = explode(' ', $xprofile->get('name'));
         $xprofile->set('surname', array_pop($bits));
         if (count($bits) >= 1) {
             $xprofile->set('givenName', array_shift($bits));
         }
         if (count($bits) >= 1) {
             $xprofile->set('middleName', implode(' ', $bits));
         }
     }
 }
开发者ID:sumudinie,项目名称:hubzero-cms,代码行数:20,代码来源:authors.php

示例13: profileExpander

 /**
  * Function to return profile object 
  * 
  * @param   integer  $uidNumber  User identifier
  * @return  object   Profile object
  */
 private function profileExpander($uidNumber)
 {
     return Profile::getInstance($uidNumber);
 }
开发者ID:mined-gatech,项目名称:framework,代码行数:10,代码来源:ObjectExpander.php

示例14: owner

 /**
  * Get the owner of this entry
  *
  * Accepts an optional property name. If provided
  * it will return that property value. Otherwise,
  * it returns the entire object
  *
  * @param   string  $property  What data to return
  * @param   mixed   $default   Default value
  * @return  mixed
  */
 public function owner($property = null, $default = null)
 {
     if (!$this->_owner instanceof Profile) {
         $this->_owner = Profile::getInstance($this->get('assigned'));
         if (!$this->_owner) {
             $this->_owner = new Profile();
         }
     }
     if ($property) {
         $property = $property == 'id' ? 'uidNumber' : $property;
         if ($property == 'picture') {
             return $this->_owner->getPicture();
         }
         return $this->_owner->get($property, $default);
     }
     return $this->_owner;
 }
开发者ID:zooley,项目名称:hubzero-cms,代码行数:28,代码来源:wish.php

示例15: creator

 /**
  * Get the creator of this entry
  *
  * Accepts an optional property name. If provided
  * it will return that property value. Otherwise,
  * it returns the entire object
  *
  * @param   string  $property  Property to retrieve
  * @param   mixed   $default   Default value if property not set
  * @return  mixed
  */
 public function creator($property = null, $default = null)
 {
     if (!$this->_creator instanceof Profile) {
         $this->_creator = Profile::getInstance($this->get('taggerid'));
         if (!$this->_creator) {
             $this->_creator = new Profile();
         }
     }
     if ($property) {
         $property = $property == 'id' ? 'uidNumber' : $property;
         return $this->_creator->get($property, $default);
     }
     return $this->_creator;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:25,代码来源:object.php


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