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


PHP UserProfile::getAvatar方法代码示例

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


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

示例1: getMember

 /**
  * Returns the data of a member.
  * 
  * @param	array		$row
  * @return	array 
  */
 protected function getMember($row)
 {
     $user = new UserProfile(null, $row);
     $username = StringUtil::encodeHTML($row['username']);
     $protectedProfile = $user->protectedProfile && WCF::getUser()->userID != $user->userID;
     $userData = array('user' => $user, 'encodedUsername' => $username, 'protectedProfile' => $protectedProfile);
     foreach ($this->activeFields as $field) {
         switch ($field) {
             // default fields
             case 'username':
                 $userData['username'] = '<div class="containerIconSmall">';
                 if ($user->isOnline()) {
                     $title = WCF::getLanguage()->get('wcf.user.online', array('$username' => $username));
                     $userData['username'] .= '<img src="' . StyleManager::getStyle()->getIconPath('onlineS.png') . '" alt="' . $title . '" title="' . $title . '" />';
                 } else {
                     $title = WCF::getLanguage()->get('wcf.user.offline', array('$username' => $username));
                     $userData['username'] .= '<img src="' . StyleManager::getStyle()->getIconPath('offlineS.png') . '" alt="' . $title . '" title="' . $title . '" />';
                 }
                 $userData['username'] .= '</div><div class="containerContentSmall">';
                 $title = WCF::getLanguage()->get('wcf.user.viewProfile', array('$username' => $username));
                 $userData['username'] .= '<p><a href="index.php?page=User&amp;userID=' . $row['userID'] . SID_ARG_2ND . '" title="' . $title . '">' . $username . '</a></p>';
                 if (MODULE_USER_RANK == 1 && $user->getUserTitle()) {
                     $userData['username'] .= '<p class="smallFont">' . $user->getUserTitle() . ' ' . ($user->getRank() ? $user->getRank()->getImage() : '') . '</p>';
                 }
                 $userData['username'] .= '</div>';
                 break;
             case 'registrationDate':
                 $userData['registrationDate'] = DateUtil::formatDate(null, $row['registrationDate']);
                 break;
             case 'lastActivity':
                 $userData['lastActivity'] = '';
                 if ($user->invisible != 1 || WCF::getUser()->getPermission('admin.general.canViewInvisible')) {
                     $userData['lastActivity'] = DateUtil::formatTime(null, $row['lastActivityTime']);
                 }
                 break;
             case 'avatar':
                 if ($user->getAvatar() && ($row['userID'] == WCF::getUser()->userID || WCF::getUser()->getPermission('user.profile.avatar.canViewAvatar'))) {
                     $user->getAvatar()->setMaxHeight(50);
                     $title = WCF::getLanguage()->get('wcf.user.viewProfile', array('$username' => $username));
                     $userData['avatar'] = '<a href="index.php?page=User&amp;userID=' . $row['userID'] . SID_ARG_2ND . '" title="' . $title . '">' . $user->getAvatar()->__toString() . '</a>';
                 } else {
                     $userData['avatar'] = '';
                 }
                 break;
             case 'language':
                 if ($row['languageID'] && $row['languageCode']) {
                     $userData['language'] = '<img src="' . RELATIVE_WCF_DIR . 'icon/language' . ucfirst($row['languageCode']) . 'S.png" alt="' . WCF::getLanguage()->get('wcf.global.language.' . $row['languageCode']) . '" title="' . WCF::getLanguage()->get('wcf.global.language.' . $row['languageCode']) . '" />';
                 } else {
                     $userData['language'] = '';
                 }
                 break;
                 // user options
             // user options
             default:
                 $userData[$field] = '';
                 $option = $this->userOptions->getOptionValue($field, $user);
                 if (!$protectedProfile && $option) {
                     $userData[$field] = $option['optionValue'];
                 }
         }
     }
     return $userData;
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:69,代码来源:MembersListPage.class.php


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