Facebook Recommendations PHP class is used to show a list of interesting content for particular domain. The list is created depending on user's personal preferences and shared content by other people.
Facebook Recommendations Image
Following image shows the default Facebook Recommendations look, which is used the most often on web sites.
PHP example
The example shows default Facebook Recommendations control for domain 'developers.facebook.com', which is shown on 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 Recommendations PHP class with blue color.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <title>Facebook Recommendations PHP example</title> </head> <body> <?php require_once 'facebook.php'; require_once 'faceconn/faceconn.php'; UseGraphAPI(); $recomendations = new Recommendations(); $recomendations->SetDomain("developers.facebook.com"); $recomendations->Render(); ?> </body> </html>
Configuration
Configuration for Facebook Recommendations PHP class is done through calls of the setter methods, which in turn set the private properties. For Facebook Recommendations PHP class, there are no required properties to set. All you have to do is to create new instance of the class and call Render() method. All properties from the list below are optional.




