Documentation & Tutorials. We have a great selection of tutorials to help you make the most of your theme.

Facebook Like Mod

Mick in Mods on Apr 22, 2010

Facebook Like Mod
Facebook Like v.1.2
By BlueDevil

COMPATIBLE WITH SMF RC3
[/center]


Bug Fixes / Updates
1.) Created v.1.1 on April 21 2010
2.) Added board permissions v.1.2 April 25 2010


An Error Has Occurred!



This mod installs the Facebook "Like" button on every topic. When the Facebook user clicks on it, a link with title will be posted in the Facebook users Recent Activity wall.

It will work on any custom theme that does NOT have display.template.php.

NOTE***  Just like Facebook settings, you can only view the names of those youre friends with.










PHP blocks for your portal ;)   

*Replace yoursite.com in the code with your own domain.
*Adjust height & width to your likings
*Replace light for light themes or dark for dark themes.

Recent Activity:

The Activity Feed plugin displays the most interesting recent activity taking place on your site. Since the content is hosted by Facebook, the plugin can display personalized content whether or not the user has logged into your site. The activity feed displays stories both when users like  content on your site and when users share content from your site back to Facebook. If a user is logged into Facebook, the plugin will be personalized to highlight content from their friends. If the user is logged out, the activity feed will show recommendations from your site, and give the user the option to log in to Facebook.

The plugin is filled with activity from the user's friends. If there isn't enough friend activity to fill the plugin, it is backfilled with recommendations. If you set the recommendations param to true, the plugin is split in half, showing friends activity in the top half, and recommendations in the bottom half. If there is not enough friends activity to fill half of the plugin, it will include more recommendations.




		// Facebook Recent Activity

echo '
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: \'\', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement(\'script\'); e.async = true;
    e.src = document.location.protocol +
      \'//connect.facebook.net/en_US/all.js\';
    document.getElementById(\'fb-root\').appendChild(e);
  }());
</script>

<div align="center"><fb:activity site="yoursite.com" width="170" height="300" header="true" colorscheme="light" /></fb:activity></div>';

//  End Of Facebook Recent Activity

Recommendations:

The Recommendations plugin shows personalized recommendations to your users. Since the content is hosted by Facebook, the plugin can display personalized recommendations whether or not the user has logged into your site. To generate the recommendations, the plugin considers all the social interactions with URLs from your site. For a logged in Facebook user, the plugin will give preference to and highlight objects her friends have interacted with.




		// Facebook Recommedations

echo '
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: \'\', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement(\'script\'); e.async = true;
    e.src = document.location.protocol +
      \'//connect.facebook.net/en_US/all.js\';
    document.getElementById(\'fb-root\').appendChild(e);
  }());
</script>

<div align="center"><fb:recommendations site="yoursite.com" width="170" height="300" header="true" colorscheme="light" /></fb:recommendations></div>';

//  End Of Facebook Recommendations


Comments

The Comments Box easily enables your users to comment on your site's content whether it's for a web page, article, photo, or other piece of content. Then the user can share the comment on Facebook on their Wall and in their friends' streams.

To be used in PHP articles and/or pages.




		// Facebook Comments

echo '
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: \'\', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement(\'script\'); e.async = true;
    e.src = document.location.protocol +
      \'//connect.facebook.net/en_US/all.js\';
    document.getElementById(\'fb-root\').appendChild(e);
  }());
</script>

<div align="center"><fb:comments></fb:comments></div>';

//  End Of Facebook Comments

Tagged with: facebook rc4 mod Thanks 


Mick

Mick G

idesignsmf.com

    

Mick is an American theme designer for Simple Machines Forum software currently living in South Florida, USA. He runs idesignSMF and started tinkering with SMF in 2006 where he created several SMF forums of his own before he founded idesignSMF in 2009 to which he is dedicated full time and has a weakness for Tacos and Pizza.


39 Comments

In the center looks fine because if you move it to the right...it may mess up the Sleepy Arcade's FB Connect mod.

Just one request....
Add board permission and you are all set
1

In the center looks fine because if you move it to the right...it may mess up the Sleepy Arcade's FB Connect mod.

Just one request....
Add board permission and you are all set

Um, i dont use sleepy's FB connect.    Really? board permissions? i didnt think it was necessary.
2

Um, i dont use sleepy's FB connect.    Really? board permissions? i didnt think it was necessary.
Because there are private boards which will still show up on facebook but on Fb it will look like this:
Nathan likes "Login"
3

Because there are private boards which will still show up on facebook but on Fb it will look like this:
Nathan likes "Login"

I see that.... let me see what i can do.
4

I added board permissions ;)

v.1.2
5

No link? Guess I have to wait for SMF approval then...  :-\
6

Ooops.... look in first post.
7

interesting, I was thinking of a better permission like this, more easier.
 
8

UPDATE: It does not work with FB Connect installed as it's conflit with each other somehow.
With FB Connect the "Link" button won't show up.
9

UPDATE: It does not work with FB Connect installed as it's conflit with each other somehow.
With FB Connect the "Link" button won't show up.

SA uses an older Facebook .js SDK
10

SA uses an older Facebook .js SDK
Anyhow to get it to work together? Tell me where to change the code to the new facebook.js SDK
11

Anyhow to get it to work together? Tell me where to change the code to the new facebook.js SDK

That's the thing, in order to make SA's mod to work with the new FB javascript, his code needs to be rewritten.
12

Is it possible to make the text light? It doesn't fare well on dark themes.

And also, if the topic title is long it will remove the title.
13

Is it possible to make the text light? It doesn't fare well on dark themes.

And also, if the topic title is long it will remove the title.

Yes, in display.template.php find:

light

Replace with:

dark

or


evil

I noticed titles get cutoff too.  Moving the button is the best choice.
14



Connect with us:


Improve SMF

If you wish to contribute to the development of SMF you can contribute to the coding discussions taking place on Github. You are also welcome to suggest features which you would like to see added to the software in the Feature Requests board.

  Receive our monthly newsletter right in your inbox.
Commitment issues? Unsubscribe at any time.


Get 100% complete access to our entire collection and find out why SMF owners prefer our themes





Latest Discussions

Join the conversation