예제 #1
0
 /**
  * gets the image path for a users avatar
  * @param \UserInfo $uo
  * @param bool $withNoCacheStr
  * @return bool|string $src
  */
 public function getImagePath($uo, $withNoCacheStr = true)
 {
     if (!$uo->hasAvatar()) {
         return false;
     }
     $avatar = $uo->getUserAvatar();
     return $avatar->getPath();
 }
예제 #2
0
파일: Avatar.php 프로젝트: ceko/concrete5-1
 /**
  * gets the image path for a users avatar
  * @param \UserInfo $uo
  * @param bool $withNoCacheStr
  * @return bool|string $src
  */
 public function getImagePath($uo, $withNoCacheStr = true)
 {
     if (!$uo->hasAvatar()) {
         return false;
     }
     $fsl = StorageLocation::getDefault();
     $fs = $fsl->getFileSystemObject();
     if ($fs->has(REL_DIR_FILES_AVATARS . '/' . $uo->getUserID() . '.jpg')) {
         $configuration = $fsl->getConfigurationObject();
         $src = $configuration->getPublicURLToFile(REL_DIR_FILES_AVATARS . '/' . $uo->getUserID() . '.jpg');
         $cacheStr = "?" . time();
         if ($withNoCacheStr) {
             $src .= $cacheStr;
         }
         return $src;
     }
 }