Topic-icon Like button to link jomsocial profile on facebook

Active Subscriptions:

None
11 years 11 months ago #45302 by dangr
Hi Alexander.

We have used the JFB Connect package for some time now - a fantastic tool !

We have a jomsocial site, and we just renewed it and made a better and faster version.
In this process we have new developers.

On our old site we had the "LIKE" button on a jomsocial profile page, and when pressed,
the profile was posted on facebook - stating "John Smith is on xxxxxxxxx - Click here to enter xxxxxxx".
So - stating the jomsocial profile name and picture - and linking to the site - wich then utilizes the JFB connect sign in/up process
wich works 100%.

Our new developers are having trouble to find this feature - running newest JFB - subscription number 09938 - and Joomla 3.2.3 Stable and Jomsocial 3.2.0.3.

Can you please help us find a way to do this again ?

Thanks.

Danny
The topic has been locked.
Support Specialist
11 years 11 months ago #45388 by alzander
Danny,
Sorry for the delay in getting back to this post.

Adding the Like Button
To add the Like button, you'll want to edit the JomSocial user profile info module. This is usually at /components/com_community/templates/default/modules/profile/userinfo.php . In that file, add the following Easy Tag where you want the button to show:
{JFBCLike href=<?php echo 'http://yourdomain.com' . JRoute::_('index.php?option=com_community&view=profile&userid=' . $profile->id) ?>}
There are a lot of options available for that tag for the styling and other tidbits, but that should get you started. Also, check the HTML on the page and make sure the data-href="..." value is proper for the user profile page (or that the previous Like count from before when you upgraded shows properly). If the URLs are different, the like count will be reset, so you'll want to make sure you're generating the same URL as before.

Changing the title in the feed
On the same page, add the following tag, which will have JFBConnect set your title how you'd like:
{SCOpenGraph title=<?php echo $profile->name; ?> is on xxxxxxxxx - Click here to enter xxxxxxx".}
You can also change the description for the page to:
{SCOpenGraph description=<?php echo $profile->name; ?> uses xxxx because it's a great way to mingle with other martians.}

I hope that helps, but keep us posted if you run into any issues or have any questions.

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

None
11 years 11 months ago #45408 by dangr
Hi Alex.

Thanks for the answer.

I myself have no knowledge of this :) -But i will forward this to my developers.

Is the code you wrote all we need to complete the task or do they need to add some custom code ?

All we need is :

Like button will when pressed post jomsocial profile on facebook with picture and "John Smith is on xxxxxx"
Then when clicked on on facebook - the user will be guided to the login process via JFB on our site.

This worked on our old site - but we dont have a copy of the setup anymore.

I am sorry if i repeat myself - but my new developers have not tried this before and are not familiar with
JFB like my old developers.

Thanks.

Danny
The topic has been locked.
Support Specialist
11 years 11 months ago #45415 by alzander
Yes, generally speaking, adding the following code to your JomSocial template file should work:
{JFBCLike href=<?php echo 'http://yourdomain.com' . JRoute::_('index.php?option=com_community&view=profile&userid=' . $profile->id) ?>}
{SCOpenGraph title=<?php echo $profile->name; ?> is on xxxxxxxxx - Click here to enter xxxxxxx".}
The only issues you may run into with that are:
1) the $profile variable may not be defined, depending on the template file you choose. You'll need the user's ID and name to add the Like button. There are other ways to do it, like using JUser (they can ask questions if they run into issues).
2) The URL should be checked in the HTML output for the Like button to make sure it's correct.

Let me know if you have questions, but that should get you going,
Alex
The topic has been locked.