
Untitled
By: a guest on
Aug 7th, 2012 | syntax:
None | size: 1.12 KB | hits: 13 | expires: Never
Upload Graph API Dinamic url
<?php
$images = array(
0 => 'imagine1.jpeg',
1 => 'imagine2.jpeg',
);
$image = $images[ rand(0,(count($images)-1)) ];
$output = "<img src="images/".$image."" alt="" border="0" />";
print($output);
?>
<?php
//At the time of writing it is necessary to enable upload support in the Facebook SDK, you do this with the line:
$facebook->setFileUploadSupport(true);
//Create an album
$album_details = array(
'message'=> 'Album desc',
'name'=> 'Album name'
);
$create_album = $facebook->api('/me/albums', 'post', $album_details);
//Get album ID of the album you've just created
$album_uid = $create_album['id'];
//Upload a photo to album of ID...
$photo_details = array(
'message'=> 'Photo message'
);
$file='http://worldofgothic.ro/app/images/'.$image;
//Example image file
$photo_details['image'] = '@' . realpath($file);
$upload_photo = $facebook->api('/'.$album_uid.'/photos', 'post', $photo_details);
?>
$file='http://worldofgothic.ro/app/images/'.$image;
//Example image file
$photo_details['image'] = '@' . realpath($file);