Topic-icon using JFBC and Jlinked as ID verification

Active Subscriptions:

None
13 years 1 week ago #33477 by davlar
hi - sorry to keep badgering. Any thoughts on this?
The topic has been locked.
Support Specialist
13 years 1 week ago #33513 by alzander
David,
Let's try the following code. I did a little more testing and this should get you going:
include_once (JPATH_ADMINISTRATOR . '/components/com_jlinked/models/usermap.php');
$userMapModel = new JLinkedModelUserMap();
$liMemberId = $userMapModel->getMemberId($id); 
if ($liMemberId != null) {
    .... // Member is connected
}
Please try that for LinkedIn. If you do get an error, please post it but also call out exactly what line xyz is that the error is thrown on so I know where it is.

Hopefully, that gets you going, but if not, we'll be able to respond quicker going forward. Things settled down last week after a busy few days.

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

None
13 years 5 days ago #33572 by davlar
This worked well. Many thanks for your help. The final piece of the puzzle is retrieving or storing the number of contacts/friends. If you have any final advice on that I would greatly appreciate it.

If anyone else wants the final code to achieve fb and linked in connected badges, this inserted into jomsocial's userinfo.php works well:
<style>
.fbverified{color:rgba(255,255,255,0.3);  font-size:18px; padding:0px 10px 4px 6px; font-weight:700; text-shadow: 0px 1px 0px rgba(255,255,255,0.2), 0px -1px 0px rgba(0,0,0,0.2);} 
.linkedinverified { color:rgba(255,255,255,0.3); padding:0px 5px 0px 0px; font-size:18px; font-weight:700; text-shadow: 0px 1px 0px rgba(255,255,255,0.2), 0px -1px 0px rgba(0,0,0,0.2);}
</style>
<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 11 months ago #33740 by alzander
David,
Thanks for sharing what worked for you and for your patience in letting us get you an answer.

Above, I mentioned the following option:
One thing to note is that, with JLinked at least, there is the option to import "Number of Connections" into the user's profile. You could import that into the user's JomSocial profile when they register and then show that in their profile. We don't have a similar option for JFBConnect to import friend count right now, and I'm not sure how easy that will be to get.

Hopefully, that's a viable solution. You could make the field unpublished in JomSocial but still import the value(s) from Facebook/LinkedIn into it for "Friend Count" for those networks. Then, on your profile page, with some code, you could fetch the friend count value and display it however you want even though it's not published. That way, you have full control.

To get the LinkedIn count, that's already a field in the JLinked Profiles area. Just import it into any JomSocial field you created.

For JFBConnect, you'll need to make the following modification to show the field in the drop down. To do so, edit the /components/com_jfbconnect/libraries/profile.php file. Around line 20, you'll see:
'middle_name' => 'User - Middle Name',
        'last_name' => 'User - Last Name',
        'profile_url' => 'User - Profile Link',
        'hometown_location.city' => 'Basic Info - Hometown City',
Insert the following line in there (anywhere):
'friend_count' => 'User - Friend Count',
When done, it will look like:
'middle_name' => 'User - Middle Name',
        'last_name' => 'User - Last Name',
        'profile_url' => 'User - Profile Link',
        'friend_count' => 'User - Friend Count',
        'hometown_location.city' => 'Basic Info - Hometown City',
Then, in the profiles area you will be able to import that field during registration or login and display the count however you want.

I've added it to our to-do list to add this field in the next release as well, but please let us know if that works for you.

If you have any questions or comments, just let us know. Hopefully, the above is all you've been dreaming off, but if not, we'll be here.

Thanks,
Alex
The topic has been locked.