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


PHP Avatar::normalize方法代码示例

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


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

示例1: get

 /**
  * Gets the avatar information for the user.  The avatars are provided by
  * plugins that can integrate with a variety of services like gravatar.com,
  * LDAP, Social Identities, etc.
  *
  * If logged in user doesn't have access to view avatars or not avatar is found,
  * then a default avatar will be used.
  *
  * Note that the provided user id may no longer has a corresponding user in the
  * system, if the user was deleted.
  *
  * @param integer $p_user_id  The user id.
  * @param integer $p_size     The desired width/height of the avatar.
  *
  * @return array The array with avatar information.
  */
 public static function get($p_user_id, $p_size = 80)
 {
     $t_enabled = config_get('show_avatar') !== OFF;
     $t_avatar = null;
     if ($t_enabled) {
         $t_user_exists = user_exists($p_user_id);
         if ($t_user_exists && access_has_project_level(config_get('show_avatar_threshold'), null, $p_user_id)) {
             $t_avatar = event_signal('EVENT_USER_AVATAR', array($p_user_id, $p_size));
         }
         if ($t_avatar === null) {
             $t_avatar = new Avatar();
         }
         $t_avatar->normalize($p_user_id, $t_user_exists);
     }
     return $t_avatar;
 }
开发者ID:spring,项目名称:spring-website,代码行数:32,代码来源:Avatar.class.php


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