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.

New users cover photos doesn't shown

11 years 10 months ago
  • Enes's Avatar
    Topic Author
  • Enes
  • Offline
  • Fresh Boarder
  • Posts: 53
  • Thank you received: 1
Licenses:
JomSocial Active Socialize Expired

Hi everyone,

New users can successfully upload their cover photos but it always return to defaults cover photo after uploading. There is no problem at cover photo upload but it doesn't show on as a cover photo.

I have try to use this solve but it didnt work. I have also uptaded jomsocial to version 3.1.2.4

www.jomsocial.com/forum/photos-videos/20...-user-uploaded-cover

Thank you !

11 years 10 months ago
Licenses:

Hi, Enes.

I assign developer to this thread, hr'll response you at Monday.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
The following user(s) said Thank You: Enes
11 years 10 months ago
  • Enes's Avatar
    Topic Author
  • Enes
  • Offline
  • Fresh Boarder
  • Posts: 53
  • Thank you received: 1
Licenses:
JomSocial Active Socialize Expired

Thanks Michal, I'm waiting for an answer.

Have a good weekend ! :)

11 years 10 months ago
Licenses:

Hi Enes,

please apply this fix.
www.jomsocial.com/forum/technical-issues...doesn-t-stick#102711

Regards,
Albert

11 years 10 months ago
  • Enes's Avatar
    Topic Author
  • Enes
  • Offline
  • Fresh Boarder
  • Posts: 53
  • Thank you received: 1
Licenses:
JomSocial Active Socialize Expired

Hi Albertus,

I have just tried that solution but it didn't work. After that I turned to url.php file to its original.

11 years 10 months ago
Licenses:

Hi Enes,

I put the fixes at /components/com_community/libraries/user.php for getCover fucntion:
From

public function getCover() {
    $config = CFactory::getConfig();

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

    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;
}
To
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;
}

after that I put the fixes from my prev post.

Regards,
Albert

The following user(s) said Thank You: Enes
11 years 10 months ago
  • Enes's Avatar
    Topic Author
  • Enes
  • Offline
  • Fresh Boarder
  • Posts: 53
  • Thank you received: 1
Licenses:
JomSocial Active Socialize Expired

Thank you very much for quick solution :)

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