03laceys Posted March 8, 2011 Posted March 8, 2011 Ok so i am trying to add the facebook like button to my game but i am having problems. When it is in a file of its own the script works fine. As soon as i add it to the header file or attempt to include it, it simply does not display... Any ideas? Quote
rulerofzu Posted March 8, 2011 Posted March 8, 2011 I use the fb:like tags using a direct link to the facebook app. All other FB code is held in a seperate include file Quote
03laceys Posted March 8, 2011 Author Posted March 8, 2011 Have you tried adding \ before every ' and " Thank you for your comment Dayo, i have tried this previously with no avail. I use the fb:like tags using a direct link to the facebook app. All other FB code is held in a seperate include file Would you mind explaining this further? This is what i currently have... <fb:like></fb:like> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({appId: '158455954211967', status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('script'); e.type = 'text/javascript'; e.src = document.location.protocol + '//connect.facebook.net/en_GB/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); </script> Now if i have this in a file of its own such as test.html or test.php it works with no problems... If i try to add this into the header file of my game it simply displays the page as normal as if i have not added anything. Quote
rulerofzu Posted March 8, 2011 Posted March 8, 2011 I follow the examples shown over here. https://github.com/facebook/php-sdk I also allow players to login/logout with their FB details so the code may differ from what your trying and I then place the like button where I choose with ... <fb:like href="http://www.facebook.com/apps/application.php?id=yourappid" layout="button_count" show_faces="false" font="tahoma" colorscheme="dark"></fb:like> Quote
Spudinski Posted March 8, 2011 Posted March 8, 2011 I must be honest, but I really don't like giving out my sources of knowledge( you can ask around, really) but here is "the best" PHP-SDK tutorial for Facebook. http://www.takwing.idv.hk/tech/fb_dev/ And FYI, FBML is being deprecated. How many times do I have to say this? Don't give outdated information to people. Either learn something properly, and keep up to date with it, or don't do it at all. Simple. Quote
rulerofzu Posted March 8, 2011 Posted March 8, 2011 And FYI, FBML is being deprecated. How many times do I have to say this? Don't give outdated information to people. Either learn something properly, and keep up to date with it, or don't do it at all. Simple. I dont read every post you make Spudinski and where is it outdated. The sdk code linked from the dep notice takes you to github where the code is pretty much the same. The social plugins facebook is stating to use still uses the fb like syntax Quote
Spudinski Posted March 8, 2011 Posted March 8, 2011 Github only provides a class, that connects to the different APIs through curl. Which, if you are using a secure configuration, won't work anyways. There are fork methods, and even through sockets. Most people(like me) create their own "SDK" anyways. Facebook's very own documentation states that FBML is "in the process of being deprecated". I don't use their plugins, but I'm quite sure they switched to the Javascript SDK already. Also, you should know Facebook isn't very well documented on their SDK's or connection methods(authentication, etc.). It takes a lot of time actually figuring out what exactly what is, returns and does. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.