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


PHP DiscussHelper::uploadAvatar方法代码示例

本文整理汇总了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'])) {
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:67,代码来源:user.php

示例2: _upload

 function _upload($profile, $type = 'profile')
 {
     $newAvatar = '';
     //can do avatar upload for post in future.
     $newAvatar = DiscussHelper::uploadAvatar($profile);
     return $newAvatar;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:7,代码来源:profile.php


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