Topic-icon Is there a way to alter or resize Image from Facebook Profile upon log

Active Subscriptions:

None
I have installed the latest the problem still persists. I even checked the files for the edits and they are there.
The topic has been locked.
Support Specialist
There's something strange going on then. On your site, the profile image is loading with a URL like:

profile.ak.fbcdn.net/hprofile-ak-ash2/11...3607_716436024_n.jpg

The new way the image should be loading is:

graph.facebook.com/1251253607/picture?width=150&height=150

I just tested multiple times and re-double checked the code and that is what should be happening. Can you:
* Clear your Joomla caches
* Ensure that the helper.php file has the line updated with 'false', as below:
$avatarURL = $provider->profile->getAvatarUrl($providerId, false, $params);
That line is basically what chooses which of those files above will be used... true is the first (what you have), false is the 2nd.
* Finally, make sure that you don't have a template override in /templates/<YOUR_TEMPLATE>/html/mod_sclogin/ that would be forcing the loading of the wrong image.

Let me know how that goes, and good luck,
Alex
The topic has been locked.
Active Subscriptions:

None
what is a template override?
The topic has been locked.
Active Subscriptions:

None
also you said line 201 but I think you mean 401. everything is refreshed and updated...
The topic has been locked.
Support Specialist
I definitely meant line 201 in the /modules/mod_sclogin/helper.php file. The full code for that function should look like:
function getProviderAvatar($provider)
    {
        $html = "";
        $providerId = $provider->getMappedUserId();

        if ($providerId)
        {
            $params = new JRegistry();
            $params->set('width', $this->params->get("profileWidth"));
            $params->set('height', $this->params->get("profileHeight"));
            $params->set('secure', JURI::getInstance()->getScheme() == 'https');

            $avatarURL = $provider->profile->getAvatarUrl($providerId, false, $params);
            $profileURL = $provider->profile->getProfileUrl($providerId);
            $html = $this->getSocialAvatarImage($avatarURL, $profileURL);
        }
        return $html;
    }
Check again and let me know.

A template override means a file located at /templates/<YOUR_TEMPLATE>/html/mod_sclogin/ If there are any files in that directory, try renaming or copying them to a new directory. Any files there 'override' the standard output that the SCLogin module would generate and could be changing the behavior altogether.

I hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
the file has spaces... this is what was there
function getProviderAvatar($provider)

    {

        $html = "";

        $providerId = $provider->getMappedUserId();



        if ($providerId)

        {

            $params = new JRegistry();

            $params->set('width', $this->params->get("profileWidth"));

            $params->set('height', $this->params->get("profileHeight"));

            $params->set('secure', JURI::getInstance()->getScheme() == 'https');



            $avatarURL = $provider->profile->getAvatarUrl($providerId, false, $params);

            $profileURL = $provider->profile->getProfileUrl($providerId);

            $html = $this->getSocialAvatarImage($avatarURL, $profileURL);

        }

        return $html;

    }

and no I am not using any override folders in my template folder
The topic has been locked.
Support Specialist
Christian,
I'm not sure why the extra spaces are being added to that PHP file. That's not something we've seen before and pretty strange that installing the extension adds them.. but it's likely not the problem.

I'm really clueless as to why the image is coming in with the wrong URL. Can you edit the /components/com_jfbconnect/libraries/profile/facebook.php file again. Around line 239, in our file, in the getAvatarUrl function, you'll see the following code:
$avatarUrl = 'graph.facebook.com/' . $providerUserId . '/picture?width=' . $width . "&height=" . $height;
        if ($secure)
            $avatarUrl = 'https://' . $avatarUrl . '&return_ssl_resources=1';
        else
            $avatarUrl = 'http://' . $avatarUrl;
Add the following return line after that:
return $avatarUrl;
That should guarantee that the avatar URL is the one using the width and height settings, not the one lower down that is fetched differently. The one lower down is important to work to if you're importing the avatar into another extension. If so, please just test this change temporarily. If you're not importing the avatar into another extension, and the above modification works, just leave it.

Let us know how that goes,
Alex
The topic has been locked.
Active Subscriptions:

None
that works.... thanks so much. on to the next bugs.
The topic has been locked.
Support Specialist
Awesome. Glad that got you going!

Thanks,
Alex
The topic has been locked.