Topic-icon Update to Document; Posting To User's Wall

Active Subscriptions:

None
10 years 5 months ago #56156 by scosaw
Looking to update an old module I created... the code was very basic (on a really old version of JFBC) to confirm if a user was logged in via facebook or not...

I now need to update the code, which I am getting out of the documentation;

require_once JPATH_ROOT.DS.'components'.DS.'com_jfbconnect'.DS.'libraries'.DS.'facebook.php';
$jfbcLibrary = JFBConnectFacebookLibrary::getInstance();
if ($jfbcLibrary->getUserId()) // Check if there is a Facebook user logged in


But am getting two PHP errors...

1) The file does not exist. If I point the include to librarier/providers/facebook.php, that clears
2) Fatal error: Class 'JFBConnectFacebookLibrary' not found in...

Any help is appreciated.
The topic has been locked.
Support Specialist
10 years 5 months ago #56168 by alzander
Sorry the documentation is out of date. Can you tell me where you found that code? It is indeed old and we'd like to update it.

As to the actual question, to check if the current user is currently logged into Facebook, you can just use this code:
if (JFBCFactory::provider('facebook')->getProviderUserId() )
You don't need to require any files first to use that. However, please be aware that will check if they are currently logged in to Facebook. If you want to check if they have linked their account to Facebook, but may just have logged in with their Joomla account currently, that would be different code.

I hope that helps get you going, but let us know if you need anything else.

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

None
10 years 5 months ago #56192 by scosaw
Thanks Alex! That's exactly what I needed. I found the content at the following link;

www.sourcecoast.com/jfbconnect/docs/gene...osting-to-users-wall
The topic has been locked.