Home arrow PHP arrow Page 3 - Implement Facebook Javascript SDK with PHP

Implement Facebook Javascript SDK with PHP

In this programming tutorial you will learn how to implement the Facebook Javascript SDK in an HTTPS environment with a little bit of help from PHP.

Author Info:
By: Codex-M
Rating: 5 stars5 stars5 stars5 stars5 stars / 27
July 11, 2011
  1. · Implement Facebook Javascript SDK with PHP
  2. · Getting Facebook Like Button to Work in HTTPS
  3. · Making Facebook Comments and Like Box Work in HTTPS Mode

print this article

Implement Facebook Javascript SDK with PHP - Making Facebook Comments and Like Box Work in HTTPS Mode
(Page 3 of 3 )

Making Facebook Comments work in HTTPS Mode

Another very popular Facebook social plug-in that will work with JavaScript SDK is Facebook Comments. Once you have correctly integrated SDK to your site and it is working, you can integrate the rest of the Facebook social plug-ins very easily and make them compatible in HTTPS. Follow some steps below:

1.) Login to Wordpress admin panel.
2.) Decide where you will place your Facebook comments plugin. For most websites, it is located after the blog post.

You can then place your Facebook comments code such as this:

<fb:comments colorscheme="dark" num_posts="5" href="<?php the_permalink(); ?>"></fb:comments>

You should use the XFBML version of Facebook comments. You can generate Facebook comments code that suits your site here: https://developers.facebook.com/docs/reference/plugins/comments/

3.) Save your template.
4.) Add Meta property for moderators/admin. You can follow the exact procedure here: http://www.devshed.com/c/a/PHP/How-to-Add-Facebook-Comment-Boxes-with-PHP/1/

5.) For the configuration of Facebook comments, you can read this post: http://www.devshed.com/c/a/PHP/How-to-Add-Facebook-Comment-Boxes-with-PHP/2/

Facebook Like Box with JavaScript SDK

Facebook like box is another common and important Facebook social plugins. But inappropriate implementation can break the HTTPS in your site. This is different from Like button. It looks like this:

To integrate with JavaSCript SDK (already working):

1.) Open any of your templates that you would like the Facebook “like box” to appear; mostly this is found in the sidebar.
2.) Simply paste the Facebook Like box code such as this one:

<fb:like-box href="http://www.facebook.com/yourFacebookpage" width="170" colorscheme="dark" show_faces="true" stream="false" header="false"></fb:like-box>

You can further customize your Facebook Like box using this tool: http://developers.facebook.com/docs/reference/plugins/like-box/

Summary: Using the techniques employed in this tutorial, you can make your site more social with Facebook social plugins without breaking the HTTPS implementation in your site.

DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus

- Removing Singletons in PHP
- Singletons in PHP
- Implement Facebook Javascript SDK with PHP
- Making Usage Statistics in PHP
- Installing PHP under Windows: Further Config...
- File Version Management in PHP
- Statistical View of Data in a Clustered Bar ...
- Creating a Multi-File Upload Script in PHP
- Executing Microsoft SQL Server Stored Proced...
- Code 10x More Efficiently Using Data Access ...
- A Few Tips for Speeding Up PHP Code
- The Modular Web Page
- Quick E-Commerce with PHP and PayPal
- Regression Testing With JMeter
- Building an Iterator with PHP

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials