开发者

jomsocial module facebook connect not working on other pages

I m able to login 开发者_开发知识库into the website via FB if i m on the home page of the jomsocial,

but when i m on the pages of the website, then if i want to try using that button, it's not able to bring the popup window of facebook to login.

Please help

thanks in advance

Dave


That's usually caused when another extensions is also trying to load the Facebook library in addition to JomSocial. Search the HTML of your page for appId. This should be the Facebook application ID you're using in JomSocial, and it should only come up once in the page like: appId: '12345'

If it comes up twice, or especially is different both times, then there's likely going to be confusion when communicating with Facebook.

Also look for any instances of "featureloader.js.php". This is Facebook's very old library, which is incompatible with the new one (all.js). If it's in there, that's another extension you'll have to remove.

Finally, if you're using an extension like JFBConnect, which has additional Facebook features and functionality over JomSocial, you'll simply want to remove the API/Secret keys from JomSocial and configure JFBConnect like normal. That will disable JomSocial so it doesn't conflict with JFBConnect.

For more information about JFBConnect, see: Joomla Facebook Connect


I got the solution for my problem,

thanks anyways!!!!

it was only the appid was missing form the code.


If your Joomsocial component is old then there is issue in code level I solved by this in file components\com_community\controllers\connect.php in function changes code in else part like this

           function ajaxUpdate{
           if(){
             //same as it is
            }
           } else {

        $my = CFactory::getUser($connectTable->userid);
        //$myuser = JFactory::getUser($connectTable->userid);
        $myuser = new JUser($connectTable->userid);
        if (COwnerHelper::isCommunityAdmin($connectTable->userid)) {

            $tmpl = new CTemplate();
            $content = $tmpl->fetch('facebook.link.notallowed');
            $buttons = '<input type="button" value="' . JText::_('COM_COMMUNITY_BUTTON_CLOSE_BUTTON') . '" class="btn" onclick="cWindowHide();" />';
            $response->addScriptCall('cWindowAddContent', $content, $buttons);
            return $response->sendResponse();
        }else{

        }

        // Generate a joomla password format for the user so we can log them in.
        $password = JUserHelper::genRandomPassword();

        $userData = array();
        $userData['password'] = $password;
        $userData['password2'] = $password;

        if (!$myuser->bind($userData)) {
            echo $myuser->getError(); die();
        }
        if (!$myuser->save()) {
            echo $myuser->getError(); die();
        }


        //$my->bind($userData);




        // User object must be saved again so the password change get's reflected.
        //$my->save();
        //$myuser->save();


        $mainframe->login(array('username' => $my->username, 'password' => $password));

        if ($config->get('fbloginimportprofile')) {

            $this->_facebook->mapProfile($userInfo, $my->id);

        }

        $tmpl = new CTemplate();
        $tmpl->set('my', $my);
        $tmpl->set('userInfo', $userInfo);


        $content = $tmpl->fetch('facebook.existinguser');
        //echo "<pre>"; print_r($content);  
        $actions = '<input type="button" class="btn btn-primary" onclick="joms.connect.importData();" value="' . JText::_('COM_COMMUNITY_CONTINUE_BUTTON') . '"/>';

        // Update page token since the userid is changed now.
        $session = JFactory::getSession();
        $token = $session->getFormToken(false);

        $response->addScriptCall('jax_token_var="' . $token . '";');

        // Add invite button
        $response->addAssign('cwin_logo', 'innerHTML', $config->get('sitename'));
        $response->addScriptCall('cWindowAddContent', $content, $actions);
        //die();
        $response->sendResponse();
    }

}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜