本文整理汇总了PHP中DiscussHelper::uploadAvatar方法的典型用法代码示例。如果您正苦于以下问题:PHP DiscussHelper::uploadAvatar方法的具体用法?PHP DiscussHelper::uploadAvatar怎么用?PHP DiscussHelper::uploadAvatar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DiscussHelper
的用法示例。
在下文中一共展示了DiscussHelper::uploadAvatar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: apply
//.........这里部分代码省略.........
}
// If updating self, load the new user object into the session
if (DiscussHelper::getJoomlaVersion() <= '1.5') {
// If updating self, load the new user object into the session
if ($user->get('id') == $my->get('id')) {
// Get an ACL object
$acl = JFactory::getACL();
// Get the user group from the ACL
$grp = $acl->getAroGroup($user->get('id'));
// Mark the user as logged in
$user->set('guest', 0);
$user->set('aid', 1);
// Fudge Authors, Editors, Publishers and Super Administrators into the special access group
if ($acl->is_group_child_of($grp->name, 'Registered') || $acl->is_group_child_of($grp->name, 'Public Backend')) {
$user->set('aid', 2);
}
// Set the usertype based on the ACL group name
$user->set('usertype', $grp->name);
$session = JFactory::getSession();
$session->set('user', $user);
}
}
$post = JRequest::get('post');
if ($isNew) {
// if this is a new account, we unset the id so
// that profile jtable will add new record properly.
unset($post['id']);
}
$profile = DiscussHelper::getTable('Profile');
$profile->load($user->id);
$profile->bind($post);
$file = JRequest::getVar('Filedata', '', 'Files', 'array');
if (!empty($file['name'])) {
$newAvatar = DiscussHelper::uploadAvatar($profile, true);
$profile->avatar = $newAvatar;
}
//save params
$userparams = DiscussHelper::getRegistry('');
if (isset($post['facebook'])) {
$userparams->set('facebook', $post['facebook']);
}
if (isset($post['show_facebook'])) {
$userparams->set('show_facebook', $post['show_facebook']);
}
if (isset($post['twitter'])) {
$userparams->set('twitter', $post['twitter']);
}
if (isset($post['show_twitter'])) {
$userparams->set('show_twitter', $post['show_twitter']);
}
if (isset($post['linkedin'])) {
$userparams->set('linkedin', $post['linkedin']);
}
if (isset($post['show_linkedin'])) {
$userparams->set('show_linkedin', $post['show_linkedin']);
}
if (isset($post['skype'])) {
$userparams->set('skype', $post['skype']);
}
if (isset($post['show_skype'])) {
$userparams->set('show_skype', $post['show_skype']);
}
if (isset($post['website'])) {
$userparams->set('website', $post['website']);
}
if (isset($post['show_website'])) {
示例2: _upload
function _upload($profile, $type = 'profile')
{
$newAvatar = '';
//can do avatar upload for post in future.
$newAvatar = DiscussHelper::uploadAvatar($profile);
return $newAvatar;
}