Topic-icon SCLogin not following user mappin

Active Subscriptions:

None
11 years 2 months ago #31249 by johnnydement
Ok, I'll try it tonight when I make it home. ;)

In fact, I see it as in improvement rather than a bug fix, I think it 's the correct approach, if I' m logged out not should have no relevance for connecting again or not. Also you do one less check ;)
The topic has been locked.
Support Specialist
11 years 2 months ago #31251 by alzander
The original thinking behind why we checked if the user was logged into Facebook as well was because some features require the user to be logged in. Like, Comment, Activity, Recommendations, Open Graph Actions, etc. So, that button is there in case you login with 'just Joomla', you have an easy way to also login to Facebook so that everything works as expected.

However, with the current text of "Connect this to your social network" or whatever, that's extra confusing.

Hope that makes sense, and of course, feedback is welcome now that you know the origins :)

Alex
The topic has been locked.
Active Subscriptions:

None
11 years 2 months ago #31252 by johnnydement
Wouldn't better then if not logged in Facebook, for those actions to load a pup when trying to use them urging to login to use? Maybe grey them and popular saying you must be logged, dunno... I see it confusing otherwise, I will still not be able to use them, but can not notice why... Or if you don't use likes, comments, etc plugins you're doing an unnecessary check don't you think?
The topic has been locked.
Support Specialist
11 years 2 months ago #31260 by alzander
Some features you can do that with, others, like automatically posting if a user is reading something, isn't as do-able since it defeats the 'automatically' purpose. Other widgets, like the Like and Comment button actually already do present a Login button when used while not logged in. Long ago, they didn't. So, I think our check is simply outdated for the features that Facebook currently has.

Definitely let us know how your testing goes and any other feedback you may have.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 2 months ago #31261 by johnnydement
Ok, so result with the new code is:

Facebook button still there

Now LinkedIn button is there also ;)
The topic has been locked.
Support Specialist
11 years 2 months ago #31307 by alzander
My first block above was the wrong code. I told you to modify the getJLinkedConnectButton when you should be changing the getJFBConnectButton. Re-modify things. When done, the JLinkedButton code should be back to original and both functions should look like:
function getJFBCConnectButton()
    {
        $buttonHtml = ""; 
        $userMapModel = new JFBConnectModelUserMap(); 
        $jUser = JFactory::getUser(); 

        $fbMapping = $userMapModel->getFacebookUserId($jUser->get('id')); 
        if (!empty($fbMapping)) 
        {
            $buttonHtml = '<div class="fb_connect_user">';
            $buttonHtml .= '<div class="fb-login-button" onlogin="javascript:jfbc.login.on_login();">' . JText::_('MOD_SCLOGIN_CONNECT_BUTTON') .'</div>';
            $buttonHtml .= '</div>';
        }
        return $buttonHtml;
    }

    function getJLinkedConnectButton()
    {
        $buttonHtml = "";
        if (!$this->jlinkedLibrary->getMappedLinkedInUserId())
        {
            $buttonHtml = '<link rel="stylesheet" href="components/com_jlinked/assets/jlinked.css" type="text/css" />';
            $buttonHtml .= '<div class="li_connect_user">';
            $buttonHtml .= '<div class="jLinkedLogin"><a href="' . $this->jlinkedLibrary->getLoginURL() . '"><span class="jlinkedButton"></span><span class="jlinkedLoginButton">'.JText::_('MOD_SCLOGIN_CONNECT_BUTTON').'</span></a></div>';
            $buttonHtml .= '</div>';
        }
        return $buttonHtml;
    }
Sorry about that silly mixup! Let us know how that goes,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 2 months ago #31323 by johnnydement
Opps, sorry, I posted in the wrong thread :blush:

Anyway, result, jlinked works normally again, facebook button still missbehaves :(

I'm returning it to the "stock" code for next try ;)
The topic has been locked.
Support Specialist
11 years 1 month ago #31438 by alzander
Johnny,
Alright. Actually got into the code to test what I was dishing out above. There's one minor, minor code issue with what I posted.. but of course, that's enough. You'll need to re-implement the code above, but where we check for "if (!empty($fbMapping))", there shouldn't be the ! in there. So, the getJFBCConnectButton function should look like:
function getJFBCConnectButton()
    {
        $buttonHtml = "";
        $userMapModel = new JFBConnectModelUserMap();
        $jUser = JFactory::getUser();

        $fbMapping = $userMapModel->getFacebookUserId($jUser->get('id'));
        if (empty($fbMapping))
        {
            $buttonHtml = '<div class="fb_connect_user">';
            $buttonHtml .= '<div class="fb-login-button" onlogin="javascript:jfbc.login.on_login();">' . JText::_('MOD_SCLOGIN_CONNECT_BUTTON') . '</div>';
            $buttonHtml .= '</div>';
        }
        return $buttonHtml;
    }
Test it out and let us know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 1 month ago #31462 by johnnydement
Aparently, this fixed it :) have to test for a while more, but I just loaded the page and the connect button wasn't there anymore ;)

Are you implementing it or should I go with overrides?
The topic has been locked.
Support Specialist
11 years 1 month ago #31470 by alzander
There's another user we referred to this thread as well. I'd like to hear that it works from them as well and do a little more thought and testing. I'm pretty confident this will make it into the next SCLogin release, which is going to be a big overhaul of the design (it'll look a lot nicer with more template designs built in). We're expecting it out in mid/late March.

Thanks for the feedback,
Alex
The topic has been locked.