Topic-icon Use JFBConnect instead of CB Connect on CB Profilebook

Support Specialist
Ughh.. stupid bug on our part. I actually tested the code now and the below should work:
$router = JRouter::getInstance('site'); 
$juri = new JURI($href); 
$queryVars = $router->parse($juri); 
$option = isset($queryVars['option']) ? $queryVars['option'] : null; 
$task = isset($queryVars['task']) ? $queryVars['task'] : null; 
if ($option == 'com_comprofiler') 
{ 
   $user_id = $queryVars['user']; 
}
The only difference there is the "new JURI($href)" used to be "new JURI($url)".

Test again, and hope that helps!
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 1 week ago #43313 by lyljov
Hi Alex,

Thanks! This works now. For reference, I edited ./components/com_jfbconnect/controllers/social.php and changed the function rewardAlphaUserPoints with the following code:
private function rewardAlphaUserPoints($enabled, $href, $type)
    {
        if ($enabled)
        {
        $router = JRouter::getInstance('site');
        $juri = new JURI($href);
        $queryVars = $router->parse($juri);
        $option = isset($queryVars['option']) ? $queryVars['option'] : null;
        $task = isset($queryVars['task']) ? $queryVars['task'] : null;
if ($option == 'com_comprofiler' && $task == 'userprofile')
{
 $user_id = $queryVars['user'];
}

            $api_AUP = JPATH_SITE . '/components/com_alphauserpoints/helper.php';
            if (file_exists($api_AUP))
            {
                require_once ($api_AUP);
                if ($user_id)
                {
                $aupid = AlphaUserPointsHelper::getAnyUserReferreID( $user_id );
                }
                if ($aupid)
                {
                        AlphaUserPointsHelper::newpoints('plgjfbconnect_'.$type.'_new', $aupid, $href);
                }
                else AlphaUserPointsHelper::newpoints('plgjfbconnect_'.$type.'_new', '', $href);
            }
        }
    }

Thanks for the help. My next problem would be the metadata passing of JFBConnect once Joomla decides to add ItemId to the original URL (e.g. mysite.com/index.php?option=com_comprofiler&task=userprofile&user=1000&Itemid=744) but we're still checking with CB if Itemid can be removed from querying userlists.I'll probably open up a new thread.
The topic has been locked.
Support Specialist
Awesome! Glad to hear we got you going. Should you need anything else, just let us know!

Thanks,
Alex
The topic has been locked.