Page Index Toggle Pages: 1 Print
FaceBook "Like" (Read 2772 times)
Captain John
Ex Member


FaceBook "Like"
Dec 10th, 2010 at 8:06pm
Print Post  
Find this in Sources/Display.pl:

Code (Perl)
Select All
		if ($extendedprofiles) {
		    require "$sourcedir/ExtendedProfiles.pl";
		    $template_ext_prof = &ext_viewinposts($musername);
		}  




And add this after:
Code (Perl)
Select All
# call facebook
		$yyinlinestyle = qq~<meta property="og:title" content="This thread"/>
<meta property="fb:admins" content="Your Facebook ID Number"/>
<meta property="og:type" content="website, article, etc. see http://developers.facebook.com/docs/opengraph#types"/>
<meta property="og:url" content="$scripturl?num=$mnum"/>
<meta property="og:site_name" content="YourSite.com"/>
<meta property="og:image" content="http://www.yoursite.com/images/icon.gif"/>\n~;
		$yyfacebook_og = qq~
<fb:like href="$scripturl?num=$mnum"  show_faces="false"></fb:like>~;
# end call facebook
 



NOTE: I changed the "og:title" content="$msubthread" property to "This Thread" because the thread titles were making the "Like" statement on the Facebook pages too long so it was cutting off the website name.

Then edit the default template in the Admin Center:
Add the following code directly after the <body> tag:
Code (Javascript)
Select All
<!-- load JavaScript SDK-->
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId  : 'Your Facebook ID Number',
      status : true, // check login status
      cookie : true, // enable cookies to allow the server to access the session
      xfbml  : true  // parse XFBML
    });
  };

  (function() {
    var e = document.createElement('script');
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    e.async = true;
    document.getElementById('fb-root').appendChild(e);
  }());
</script>
<!-- end load JavaScript SDK-->  



Then add the following in the template where you want the "Like" button to show up:

Code (HTML)
Select All
<!-- call like button-->
{yabb facebook_og}
<!-- end call like button-->  



If everything works like it should, it will display in your Facebook profile:

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Print
 
  « Board Index ‹ Board  ^Top