Zend

Páginas: 2 (415 palabras) Publicado: 23 de junio de 2011
require_once('Api/Facebook.php');

class Facebook_Api {

/**
*
* @var object
*/
protected $_facebook;
/**
*
* @var string
*/
protected$Application_Id;
/**
*
* @var string
*/
protected $Application_Secret;
/**
*
* @var string
*/
protected $Permissions;
/**
*
* @varstring
*/
protected $CallBack;

/**
* setup the facebook login functionality!
*
* @param string $Application_Id
* @param string $Application_Secret
*@param string $Permissions
* @param string $callback
*/
public function __construct($Application_Id, $Application_Secret, $Permissions = '', $CallBack = '') {$this->Application_Id = $Application_Id;
$this->Application_Secret = $Application_Secret;
$this->Permissions = $Permissions;
$this->CallBack = $CallBack;
$this->_facebook = newFacebook(array(
'appId' => $this->Application_Id,
'secret' => $this->Application_Secret,
'cookie' => true
));
}/**
* checks for a session
* @return string html
*/
public function connection() {
$session = $this->_facebook->getSession();
$me = null;
if($session) {
try {
$uid = $this->_facebook->getUser();
$me = $this->_facebook->api('/me');
} catch (Facebook_Api_Exception $e) {throw new Zend_Exception('connection error facebook',0,$e);
}
}

return "


window.fbAsyncInit = function()
{FB.init
({
appId : '" . $this->_facebook->getAppId() . "',
session : " . json_encode($session) . ",
status :...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Zend
  • zend frameword
  • Manual Zend
  • el prisionero de zenda
  • zend framework
  • Zenda
  • Zenda
  • The Zend Framework

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS