User:Eryi19

Replace this example text with information about you.

<?php $app_id = "266043130120562"; $app_secret = "43c07aa9cd8012cc82956b1448577eac"; $post_login_url = "http://www.facebook.com"; $code = $_REQUEST["code"];

//Obtain the access_token with publish_stream permission if(empty($code)){ $dialog_url= "http://www.facebook.com/dialog/oauth?" . "client_id=". $app_id . "&redirect_uri=". urlencode( $post_login_url) . "&scope=publish_stream"; echo(" top.location.href='" . $dialog_url          . "' "); }       else { $token_url="https://graph.facebook.com/oauth/access_token?" . "client_id=". $app_id . "&redirect_uri=". urlencode( $post_login_url) . "&client_secret=". $app_secret . "&code=". $code; $response = file_get_contents($token_url); $params = null; parse_str($response, $params); $access_token = $params['access_token'];

// Show photo upload form to user and post to the Graph URL $graph_url= "https://graph.facebook.com/me/photos?" . "access_token=" .$access_token;

echo ' '; echo ''; echo 'Please choose a photo: '; echo ' '; echo 'Say something about this photo: '; echo ' '; echo ' '; echo ' '; echo ' '; } ?>

<?php

$app_id = "266043130120562"; $app_secret = "43c07aa9cd8012cc82956b1448577eac"; $post_login_url = "http://www.facebook.com"; $album_name = 'YOUR_ALBUM_NAME'; $album_description = 'http://eryi.xtgem.com';

$code = $_REQUEST["code"];

//Obtain the access_token with publish_stream permission if(empty($code)) {          $dialog_url= "http://www.facebook.com/dialog/oauth?" . "client_id=". $app_id . "&redirect_uri=". urlencode($post_login_url) . "&scope=publish_stream"; echo(" top.location.href='" . $dialog_url .           "' "); }       else { $token_url= "https://graph.facebook.com/oauth/" . "access_token?" . "client_id=". $app_id . "&redirect_uri=". urlencode( $post_login_url) . "&client_secret=". $app_secret . "&code=". $code; $response = file_get_contents($token_url); $params = null; parse_str($response, $params); $access_token = $params['access_token'];

// Create a new album $graph_url = "https://graph.facebook.com/me/albums?" . "access_token=". $access_token; $postdata = http_build_query(        array( 'name' => $album_name, 'message' => $album_description )         );         $opts = array('http' =>         array( 'method'=> 'POST', 'header'=> 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata )        );         $context  = stream_context_create($opts); $result = json_decode(file_get_contents($graph_url, false, $context));

// Get the new album ID        $album_id = $result->id;

//Show photo upload form and post to the Graph URL $graph_url = "https://graph.facebook.com/". $album_id . "/photos?access_token=". $access_token; echo ' '; echo ''; echo 'Adding photo to album: '. $album_name .' '; echo 'Please choose a photo: '; echo ' '; echo 'Say something about this photo: '; echo ' '; echo ' '; echo ' '; echo ' '; } ?>