Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatar display in a wrong size #179

Open
itdap opened this issue Jan 23, 2014 · 1 comment
Open

Avatar display in a wrong size #179

itdap opened this issue Jan 23, 2014 · 1 comment

Comments

@itdap
Copy link

itdap commented Jan 23, 2014

I found on the /user/models/YumUser.php file in the following function an extra space that will cause the image size problem.(avatarThumbnailWidth . ' px;'); & avatarDisplayWidth . 'px;');
this is the correct function:

    public function getAvatar($thumb = false)
    {
            if (Yum::hasModule('avatar') && $this->profile) {
                    $options = array();
                    if ($thumb)
                            $options = array('class' => 'avatar', 'style' => 'width: ' . Yum::module('avatar')->avatarThumbnailWidth . 'px;');
                    else
                            $options = array('class' => 'avatar', 'style' => 'width: ' . Yum::module('avatar')->avatarDisplayWidth . 'px;');

                    $return = '<div class="avatar">';

                    if(Yum::module('avatar')->enableGravatar && $this->avatar == 'gravatar')
                            return CHtml::image(
                                            'http://www.gravatar.com/avatar/'. $this->getGravatarHash(),
                                            Yum::t('Avatar image'),
                                            $options);

                    if (isset($this->avatar) && $this->avatar)
                            $return .= CHtml::image(Yii::app()->baseUrl . '/'
                                            . $this->avatar, 'Avatar', $options);
                    else
                            $return .= CHtml::image(Yii::app()->getAssetManager()->publish(
                                                    Yii::getPathOfAlias('YumAssets.images') . ($thumb
                                                            ? '/no_avatar_available_thumb.jpg' : '/no_avatar_available.jpg'),
                                                    Yum::t('No image available'),
                                                    $options));
                    $return .= '</div><!-- avatar -->';
                    return $return;
            }
    }

}

@bouiboui
Copy link

I guess it has been corrected, I tried to find the error and couldn't.
(close the issue, maybe?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants