Customizing SMF > Modifications and Packages

Facebook Like Mod

(1/116) > >>

Mick.:
Link to Mod

Facebook Like v.1.4
By BlueDevil

COMPATIBLE WITH SMF RC3 & RC4


Bug Fixes / Updates
1.) Created v.1.1 on April 23 2010
2.) Board permission support added April 24 2010
3.) Moved Like button to the post window December 2010
4.) Updated to RC4 December 2010



-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.
-Board permissions also included.

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

**Reply #2 has a couple php block add-ons for your portal



Pretty URL mod users

Open:
/Themes/default/Display.template.php

Find:

--- Code: ---               <!-- Facebook Like Button -->
               <span style="float:right; margin-top:4px;">
                  <fb:like href=', $scripturl, '?topic=', $context['current_topic'], 'layout="standard" width="300" action="like" colorscheme="light" /></fb:like>
               </span>
               <!-- End of Facebook Like Button -->';
--- End code ---

Replace with:

--- Code: ---               <!-- Facebook Like Button -->
               <span style="float:right; margin-top:4px;">
                  <fb:like href="', $scripturl, '?topic=', $context['current_topic'], '" layout="standard" width="300" action="like" colorscheme="light" /></fb:like>
               </span>
               <!-- End of Facebook Like Button -->';
--- End code ---

Mick.:
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.




--- Code: --- // 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
--- End code ---

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.




--- Code: --- // 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
--- End code ---


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.




--- Code: --- // 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
--- End code ---

gietl:
First off, thanks for the modification.

So without looking at the code, is this just implementing the simple iframe that passes in a URL?  Any chance it will support application id's, use the js sdk and support open graph meta data? I know I know a lot of questions.

I have just been unwilling to tackle the more detailed approach myself. :D

Mick.:

--- Quote from: gietl on May 13, 2010, 04:15:22 PM ---First off, thanks for the modification.

So without looking at the code, is this just implementing the simple iframe that passes in a URL?  Any chance it will support application id's, use the js sdk and support open graph meta data? I know I know a lot of questions.

I have just been unwilling to tackle the more detailed approach myself. :D

--- End quote ---

It does not uses the iframe code.  It uses js sdk.

For open graph data, im looking into it;)

~DS~:
So I have to choose either this or SA FB Connect because the like button wont show up with both of it installed.

Navigation

[0] Message Index

[#] Next page

Go to full version