This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img src="http://www.emailonacid.com/example.jpg" align="left" vspace="10" hspace="10" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$config['facebook']['api_id'] = 'YOUR APP ID'; | |
$config['facebook']['app_secret'] = 'YOUR APP SECRET'; | |
$config['facebook']['redirect_url'] = 'http://www.yourwebsite.com/login'; | |
$config['facebook']['permissions'] = array( | |
'email', | |
'user_location', | |
'user_birthday' | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
if ( session_status() == PHP_SESSION_NONE ) { | |
session_start(); | |
} | |
// Autoload the required files | |
require_once( APPPATH . 'libraries/facebook/vendor/autoload.php' ); | |
use Facebook\FacebookRedirectLoginHelper; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Must pass session data for the library to work (only if not already included in your app) | |
session_start(); | |
// Facebook app settings | |
$app_id = ''; | |
$app_secret = ''; | |
$redirect_uri = ''; | |
// Requested permissions for the app - optional |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Requested permissions - optional | |
$permissions = array( | |
'email', | |
'user_location', | |
'user_birthday' | |
); | |
// Get login URL | |
$loginUrl = $helper->getLoginUrl($permissions); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Facebook\FacebookRequest; | |
/** | |
* Retrieve User’s Profile Information | |
*/ | |
// Graph API to request user data | |
$request = ( new FacebookRequest( $session, 'GET', '/me' ) )->execute(); | |
// Get response as an array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Facebook\FacebookRequest; | |
/** | |
* Get User’s Profile Picture | |
*/ | |
// Graph API to request profile picture | |
$request = (new FacebookRequest( $session, 'GET', '/me/picture?type=large&redirect=false' ))->execute(); | |
// Get response as an array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Facebook\FacebookRequest; | |
/** | |
* Publish to User’s Timeline | |
*/ | |
// Graph API to publish to timeline | |
$request = (new FacebookRequest( $session, 'POST', '/me/feed', array( | |
'message' => 'I love articles on benmarshall.me!' | |
)))->execute(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Facebook\FacebookRequest; | |
/** | |
* Retrieve User’s Timeline | |
*/ | |
// Graph API to publish to timeline | |
$request = (new FacebookRequest( $session, 'POST', '/me/feed' ))->execute(); | |
// Get response as an array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$style = image_style_save(array('name' => 'avatar')); | |
$effect = array( | |
'name' => 'image_scale', | |
'data' => array( | |
'width' => 64, | |
'height' => 64, | |
'upscale' => TRUE, | |
), | |
'isid' => $style['isid'], |