Topic-icon Facebook and Linked in as ID verification

Active Subscriptions:

None
12 years 9 months ago #36313 by davlar
Hi!

You very kindly helped me with some code to place FB Verified and LinkedIn Verified links on my jomsocial profiles. Please see this post for the background: www.sourcecoast.com/forums/jfbconnect/jf...d-as-id-verification

Since updating to 5.1.1 that has broken. I get the error: Notice: Undefined property: stdClass::$fb_user_id in /home/profr192/public_html/beta2.profr.org/components/com_community/templates/default/modules/profile/userinfo.php on line 79

Could you possibly help me fix and ideally help me with the similar bit of code to for google plus verification? The code I was using was in jomsocial's userinfo.php module and looked like this:
<div style="clear:both" class="	cFloat-L" id="identity">
                <h5>Trust Indicators</h4>
                <ul>
                <?php 
$fbUserMap = JFBConnectModelUserMap::getUser($id); 
if ($fbUserMap->_data->fb_user_id != null) {
  echo '<li style="font-size:12px; color:#3B5998"><span class="fbverified" style="color:#3B5998 !important;">f</span>Facebook verified. <![if !IE]>✓<![endif]>
<!--[if gt IE 6]>✓<![endif]-->
<!--[if lt IE 7]><div style="font:bold 1.2em "wingdings 2"; text-align: center;">P</div><![endif]--></li>'; 
}
elseif ( $isMine) {
  echo '<li style="font-size:12px; color:rgba(102,102,102,0.5)" ><span class="fbverified">f</span>Facebook not verified<br/><a href="javascript:void(0)" onclick="jfbc.login.login_custom();">Verify now!</a></li>';
}
else {
	  echo '<li style="font-size:12px; color:rgba(102,102,102,0.5)" ><span class="fbverified">f</span>Facebook not verified</li>';    
}


include_once (JPATH_ADMINISTRATOR . '/components/com_jlinked/models/usermap.php'); 
$userMapModel = new JLinkedModelUserMap(); 
$liMemberId = $userMapModel->getMemberId($id); 
if ($liMemberId != null) { 

 echo '<li style="font-size:12px; color:#4875B4"><span class="linkedinverified" style="color:#4875B4;">in</span>LinkedIn verified <![if !IE]>✓<![endif]>
<!--[if gt IE 6]>✓<![endif]-->
<!--[if lt IE 7]><div style="font:bold 1.2em "wingdings 2"; text-align: center;">P</div><![endif]--></li>'; 
}
elseif ( $isMine) {
    echo '<li style="font-size:12px; color:rgba(102,102,102,0.5)" ><span class="linkedinverified">in</span>LinkedIn not verified<br/><a //href="javascript:void(0)" onclick="jlinked.login.login();">Verify now!</a></li>'; 
}
else {
	  echo '<li style="font-size:12px; color:rgba(102,102,102,0.5)" ><span class="linkedinverified">in</span>LinkedIn not verified</li>';  

}
 
?>
                </ul></div>
The topic has been locked.
Support Specialist
12 years 9 months ago #36392 by alzander
David,
Sorry for the delayed response. v5.1 updated the code a bit and should hopefully make things much easier developing going forward. Instead of:
$fbUserMap = JFBConnectModelUserMap::getUser($id); 
if ($fbUserMap->_data->fb_user_id != null) {
Switch that code to:
if (JFBCFactory::usermap()->getProviderUserId($id, 'facebook') ) {
You can replace 'facebook' with 'google' for the same check as well.

When we integrate LinkedIn later this year, it will work for that as well, but for now, leave the JLinked code intact.

I hope that helps, but if you have any questions, just let me know,
Alex
The topic has been locked.