public function __construct()
 {
     $this->api = FacebookApi::getInstance();
 }
<pre>
<?php 
//////////////////////////////////////////////////////////////
function autoload($class)
{
    if (file_exists("facebook/{$class}.php")) {
        @(include_once "facebook/{$class}.php");
    }
}
spl_autoload_register("autoload");
//////////////////////////////////////////////////////////////
// Create permissions...
$perms = new FacebookPermissions();
$perms->user_birthday = true;
// Get facebook api instance
$api = FacebookApi::getInstance($perms);
// If need additional perms, change them anytime
// $perms->user_about_me = true;
// $api->changePerms($perms);
print_r($api->user);
// The current user
// upload a photo
$p = new FacebookPhoto();
$p->addNew($api->facebook->getAccessToken(), "example.jpg", "", "A Wonder Tree!");
/*
//  Uncomment to create post on your wall

    $f = new FacebookPost;
    $f->message  = "Teszt Elek";
    $f->caption = "Teszt";
    $f->description = "Teszt elek";
 /**
  * The datasource configuration will be ignored.
  * Credentials will be read from the facebook configuration file
  *
  * @param array $config
  */
 public function __construct($config = array())
 {
     $this->FB = FacebookApi::getInstance();
     parent::__construct($config);
 }
Ejemplo n.º 4
0
 /**
  * Constructor
  * Starts FacebookConnect session
  */
 public function __construct()
 {
     $this->FacebookApi = FacebookApi::getInstance();
     //$this->connect();
     // restore user info from session, if available
     $this->restoreSession();
 }
 /**
  * Require permission
  * @param string $perm;
  */
 public function need($perm)
 {
     //echo $perm.": ".$this->{$perm};
     if ($this->{$perm}) {
         return;
     }
     $p = clone $this;
     $p->{$perm} = true;
     FacebookApi::getInstance()->changePerms($p, false);
 }