本文整理汇总了PHP中Hubzero\User\Profile类的典型用法代码示例。如果您正苦于以下问题:PHP Profile类的具体用法?PHP Profile怎么用?PHP Profile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Profile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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('&', '&', $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
示例16: foreach
?>
</a>
</td>
</tr>
</table>
<?php
if (count($this->latest) > 0) {
?>
<?php
foreach ($this->latest as $post) {
?>
<table id="course-discussions" width="650" cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse;">
<tr>
<td width="75" style="padding: 10px 0;">
<img width="50" src="<?php
echo Request::root() . \Hubzero\User\Profile::getInstance($post->created_by)->getPicture();
?>
" />
</td>
<td style="padding: 10px 0;">
<div style="position: relative; border: 1px solid #CCCCCC; padding: 12px; -webkit-border-radius: 7px; -moz-border-radius: 7px; border-radius: 7px;">
<div style="background: #FFFFFF; border: 1px solid #CCCCCC; width: 15px; height: 15px;
position: absolute; top: 50%; left: -10px; margin-top: -7px;
transform:rotate(45deg); -ms-transform:rotate(45deg); -webkit-transform:rotate(45deg);"></div>
<div style="background: #FFFFFF; width: 11px; height: 23px; position: absolute; top: 50%; left: -1px; margin-top: -10px;"></div>
<div style="color: #AAAAAA; font-size: 11px; text-align:center;">
<?php
echo User::getInstance($post->created_by)->get('name');
?>
| created: <?php
echo Date::of($post->created)->toLocal('M j, Y g:i:s a');
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:31,代码来源:digest_html.php
示例17: collectAuthorData
/**
* Collect author data
*
* @access public
* @return string
*/
public function collectAuthorData($author, $ordering, $uid, &$item)
{
$firstName = NULL;
$lastName = NULL;
$org = NULL;
$error = NULL;
// Check that user ID exists
if (trim($uid)) {
if (!intval($uid)) {
$error = Lang::txt('COM_PUBLICATIONS_BATCH_ITEM_ERROR_INVALID_USER_ID') . ': ' . trim($uid);
$item['errors'][] = $error;
} else {
$profile = \Hubzero\User\Profile::getInstance($uid);
if (!$profile || !$profile->get('uidNumber')) {
$error = Lang::txt('COM_PUBLICATIONS_BATCH_ITEM_ERROR_USER_NOT_FOUND') . ': ' . trim($uid);
$item['errors'][] = $error;
} else {
$firstName = $profile->get('givenName');
$lastName = $profile->get('lastName');
$org = $profile->get('organization');
}
}
}
$pAuthor = new Tables\Author($this->database);
$pAuthor->user_id = trim($uid);
$pAuthor->ordering = $ordering;
$pAuthor->credit = '';
$pAuthor->role = '';
$pAuthor->status = 1;
$pAuthor->organization = isset($author->organization) && $author->organization ? trim($author->organization) : $org;
$pAuthor->firstName = isset($author->firstname) && $author->firstname ? trim($author->firstname) : $firstName;
$pAuthor->lastName = isset($author->lastname) && $author->lastname ? trim($author->lastname) : $lastName;
$pAuthor->name = trim($pAuthor->firstName . ' ' . $pAuthor->lastName);
// Check if project member
$objO = $this->project->table('Owner');
$owner = $objO->getOwnerId($this->project->get('id'), $uid, $pAuthor->name);
$pAuthor->project_owner_id = $owner;
if (!$pAuthor->name) {
$item['errors'][] = Lang::txt('COM_PUBLICATIONS_BATCH_ITEM_ERROR_AUTHOR_NAME_REQUIRED');
}
// Add author record
$authorRecord = array('author' => $pAuthor, 'owner' => $owner, 'error' => $error);
$item['authors'][] = $authorRecord;
}
开发者ID:sumudinie,项目名称:hubzero-cms,代码行数:50,代码来源:batchcreate.php
示例18: __construct
/**
* Constructor
*
* @param integer $id Member ID
* @return void
*/
public function __construct($oid = null)
{
$this->_obj = \Hubzero\User\Profile::getInstance($oid);
$this->_baselink = 'index.php?option=com_members&id=' . $this->_obj->get('uidNumber') . '&active=collections';
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:11,代码来源:member.php
示例19: _delete
/**
* Mark an entry as deleted
*
* @return string HTML
*/
private function _delete()
{
//verify were authorized
if ($this->authorized != 'manager') {
$this->setError(Lang::txt('PLG_GROUPS_ANNOUNCEMENTS_ONLY_MANAGERS_CAN_DELETE'));
return $this->_list();
}
// Incoming
$id = Request::getInt('id', 0);
//announcement model
$announcement = new \Hubzero\Item\Announcement($this->database);
$announcement->load($id);
//load created by user profile
$profile = \Hubzero\User\Profile::getInstance($announcement->created_by);
//make sure we are the one who created it
if ($announcement->created_by != User::get('id')) {
$this->setError(Lang::txt('PLG_GROUPS_ANNOUNCEMENTS_ONLY_MANAGER_CAN_DELETE', $profile->get('name')));
return $this->_list();
}
//set to deleted state
$announcement->archive();
//attempt to delete announcement
if (!$announcement->save($announcement)) {
$this->setError(Lang::txt('PLG_GROUPS_ANNOUNCEMENTS_UNABLE_TO_DELETE'));
return $this->_list();
}
App::redirect(Route::url('index.php?option=' . $this->option . '&cn=' . $this->group->get('cn') . '&active=announcements'), Lang::txt('PLG_GROUPS_ANNOUNCEMENTS_SUCCESSFULLY_DELETED'), 'success');
return;
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:34,代码来源:announcements.php
示例20:
<li>
<a class="group-edit" href="<?php
echo Route::url('index.php?option=com_groups&cn=' . $this->group->get('cn') . '&task=edit');
?>
">
<?php
echo Lang::txt('COM_GROUPS_TOOLBAR_EDIT');
?>
</a>
</li>
<?php
}
?>
<?php
if (!$isManager && \Hubzero\User\Profile::userHasPermissionForGroupAction($this->group, 'group.pages')) {
?>
<li>
<a class="group-pages" href="<?php
echo Route::url('index.php?option=com_groups&cn=' . $this->group->get('cn') . '&task=pages');
?>
">
<?php
echo Lang::txt('COM_GROUPS_TOOLBAR_PAGES');
?>
</a>
</li>
<?php
}
?>
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:30,代码来源:_toolbar.php
注:本文中的Hubzero\User\Profile类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论