/** * Generate a link to an user image of a social platform. * * <code> * $options = array( * "size" => "small", * "default" => "media/com_userideas/images/no-profile.png" * ); * * $avatar = JHtml::_("userideas.avatar", $socialProfiles, $userId, $options); * </code> * * @param stdClass $socialProfiles Social profiles object. * @param integer $userId User ID * @param array $options Options that will be used to integration. * * @return string */ public static function avatar($socialProfiles, $userId, $options = array()) { $avatarSize = Joomla\Utilities\ArrayHelper::getValue($options, 'size', 'small'); $default = Joomla\Utilities\ArrayHelper::getValue($options, 'default'); $link = !$socialProfiles ? null : $socialProfiles->getAvatar($userId, $avatarSize); // Set the link to default picture if (!$link and $default !== null) { $link = $default; } return $link; }