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

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

Code (Perl)
Select All
		if ($extendedprofiles) {
		    require "$sourcedir/";
		    $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"/>
<meta property="og:url" content="$scripturl?num=$mnum"/>
<meta property="og:site_name" content=""/>
<meta property="og:image" content=""/>\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>
  window.fbAsyncInit = function() {
      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 + '//';
    e.async = true;
<!-- 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
  « Board Index ‹ Board  ^Top