GameSiteScript Facebook Comments Tutorial
For those of you that doesn't know, GameSiteScript is a Arcade Site Script for making your own Arcade Sites, you can buy the Script over at GameSiteScript.com
I have found a very easy way to add Facebook comments into the game pages on your GameSiteScript sites and I wanted to share the information with anyone that might want to have this feature.
Tutorial:
1. Adding Facebook Admin MetaTag First you need to add the "facebook admin metatag" into your header.php file of your template, This tag will tell facebook that Your account should be the administrator for the comments, so you can delete comments and such.
You do this by going into your theme folder and opening your header.php page in your favorite editor(Mine is Notepad++) My header.php file is in admin/themes/Default/header.php your's shouldn't be that much different..
Then you have to add the code right after the <head>
tag, be sure to not edit anything else as this could break your
site:
HTML Code:
You have to place your own facebook user ID in the content="" tag, you can find your Facebook ID by using this website: http://FindMyFacebookID.com/
2. Adding the Facebook Javascript SDK Still in the header.php file... Then you need to add the Javascript SDK,
you do this in much the same fashion, but you have to add this right after the <body>
tag, here is the code:
HTML Code:
<div id="fb-root"></div>
<script>
(function (d, s, id) {
var js,
fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
})(document, "script", "facebook-jssdk");
</script>
3. Inserting the Widget Code in your play.php file After you have done that you need to edit your play.php file, this is the page we want our Facebook comment widget in, the file is located in your themes folder: admin/themes/Default/play.php
Now look for the DIV called "inforight", right under the closing div tag of that Div you need to add this code:
HTML Code:
<div class="fb-comments" data-href="<?php echo "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>" data-width="935" data-num-posts="10" data-colorscheme="dark"></div>
Code Explanation
<?php echo "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>
in the script just means that it will
display the comments for the current URL that you are on(instead of specifying it manually as the official Facebook code
wants you to do.).
data-width="935" Specifies the width of the comment widget, I've set it to 935px, in the Default theme it should fit perfectly, but if you are running any other theme you might have to adjust it slightly.
data-num-posts="10" Specifies how many comments you want to show on one page at the time, somewhere around 5 - 10 should be sufficient in my opinion.
data-colorscheme="dark" Specifies the color scheme, facebook's "dark" theme works perfectly with the Default theme in GSS.
Then you should be good to go!