This class enables the owners of web sites to connect it to their Facebook Page, so they can gain more Likes from their own website. Visitor of web site can easily become a fan of the Facebook Page; see messages from the page wall, their friends which like it too, and the rest of the fans.
Like Box Image
Following image shows 3 like boxes. The first one is the default, with 10 fans, show stream and show header. The second one is without fan list, and the third one is without fans and stream.
PHP Example
The example shows PHP code that creates three Facebook like boxes from picture above. The example shows the code of whole page, but important content is highlighted: required includes and initialization for any page with brown color, and working with Facebook Like Box PHP class with blue color.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <title>Facebook Like Box</title> </head> <body> <?php require_once 'facebook.php'; require_once 'faceconn/faceconn.php'; UseGraphAPI(); // create instance of the class and set pageId $likeBox = new LikeBox(); $likeBox->SetPageId("185550966885"); // render the default control on the page $likeBox->Render(); // render without fan list $likeBox->SetFansCount(0); $likeBox->Render(); // render without fan list and stream $likeBox->SetShowStream(false); $likeBox->Render(); ?> </body> </html>
Configuration
Configuration of the Facebook Like Box PHP class is done through calls of the setter methods, which in turn set the private properties. For Facebook Like Box PHP class, there is only one mandatory and couple of optional properties to set. After the configuration is set, all you have to do is to call Render() method, and the control will display on page.
Mandatory Properties
Optional Properties




