Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Default Cover showed instead of User uploaded Cover

9 years 7 months ago
Licenses:
JomSocial Expired

User Cover is not showed after Upload! instead the Default Cover is used but only with 25% height..

tested with firefox
link to respective profile in "Misc Information"

9 years 7 months ago
Licenses:

Hi Testcouch,

this is a valid bug. but after cronjob run, the cover will not default any more.
please wait for the fixes.

Regards,
Albert

9 years 7 months ago
Licenses:

Hi,

please edit /components/com_community/libraries/user.php
and replace getCover() function with this one

public function getCover() {
        $storages['file'] = 'file';
        $storages['s3'] = 's3';
        $config = CFactory::getConfig();

        $storage = CStorage::getStorage($config->get('user_avatar_storage'));

        if(!$storage->exists($this->_cover)){
            unset($storages[$config->get('user_avatar_storage')]);
            $storages = array_pop($storages);

             $storage = CStorage::getStorage($storages);
        }

        if (empty($this->_cover) || !$storage->exists($this->_cover)) {

            $profileModel = CFactory::getModel('Profile');
            $gender = $profileModel->getGender($this->id);

            $tGender = strtoupper($gender);

            /* Not use translate string yet */
            if (strpos($tGender, 'COM_COMMUNITY_') === false) {
                /* But it must be default English string */
                $tGender = 'COM_COMMUNITY_' . $tGender; /* Adding prefix translate string */
            }

            /* Now we have translate string already. Let's determine gender  ( No shemale here ) */
            switch ($tGender) {
                case 'COM_COMMUNITY_MALE' :
                    $gender = 'male-default';
                    break;
                case 'COM_COMMUNITY_FEMALE':
                    $gender = 'female-default';
                    break;
                default:
                    $gender = 'undefined-default';
                    break;
            }

            $template = new CTemplateHelper();
            $asset = $template->getTemplateAsset('cover-' . $gender . '.png', 'images');
            $uri = $asset->url;
            return $uri;
        } else { /* if not local storage than get remote storage */
            if ($this->_storage != 'file') {
                $storage = CStorage::getStorage($this->_storage);
                return $storage->getURI($this->_cover);
            }
        }

        $avatar = CUrlHelper::coverURI($this->_cover, '');

        return $avatar;
    }

this fixes will be included at 3.2.1.5

Regards,
Albert

The following user(s) said Thank You: testcouch
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW