'325225094267165', 'secret' => '6d031c72557f8c607983ae00fdb594a0', 'cookie' => true, // enable optional cookie support )); //defining action index isset( $_REQUEST['action'] ) ? $action = $_REQUEST['action'] : $action = ""; /* * This will show */ if( $action == ''){ echo "
"; // select albums from our dummy page $fql = "SELECT aid, cover_pid, name FROM album WHERE owner=444292058923210"; $param = array( 'method' => 'fql.query', 'query' => $fql, 'callback' => '' ); $fqlResult = $facebook->api($param); foreach( $fqlResult as $keys => $values ){ //to get album cover $fql2 = "select src from photo where pid = '" . $values['cover_pid'] . "'"; $param2 = array( 'method' => 'fql.query', 'query' => $fql2, 'callback' => '' ); $fqlResult2 = $facebook->api($param2); foreach( $fqlResult2 as $keys2 => $values2){ $album_cover = $values2['src']; } //show the album echo "";
echo "";
echo "";
echo "";
echo "
";
}
}
/*
* This will show the photo(s) on the clicked album.
*/
if( $action == 'list_pics'){
isset( $_GET['name'] ) ? $album_name = $_GET['name'] : $album_name = "";
echo "{$values['name']}
";
echo "Back To Albums | Album Name: " . $album_name . "
";
// query all the images in the album
$fql = "SELECT
pid, src, src_small, src_big, caption
FROM
photo
WHERE
aid = '" . $_REQUEST['aid'] ."' ORDER BY created DESC";
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fqlResult = $facebook->api($param);
echo "";
foreach( $fqlResult as $keys => $values ){
if( $values['caption'] == '' ){
$caption = "";
}else{
$caption = $values['caption'];
}
echo "
";
}
?>
";
echo "";
echo "";
echo "";
echo "
";
}
echo "