function displayAlbums()
{
$this->loadCache($this->id); // loads cached file
$gallery = '';
$json_array = $this->getData($this->id,$type='albums');
$data_count = count($json_array['data']);
for($x=0; $x<$data_count; $x++)
{
if(!empty($json_array['data'][$x]['object_id']) AND $json_array['data'][$x]['size'] > 0) // do not include empty albums
{
$gallery .= '<li class="span2">
<a href="?id='.$json_array['data'][$x]['aid'].'&title='.urlencode($json_array['data'][$x]['name']).'" class="thumbnail" rel="tooltip" data-placement="bottom" title="'.$json_array['data'][$x]['name'].' ('.$json_array['data'][$x]['size'].')">
<img src="http://graph.facebook.com/'.$json_array['data'][$x]['object_id'].'/picture?type=album">
</a>
</li>';
}
}
$gallery = '<ul class="thumbnails">'.$gallery.'</ul>';
if($this->breadcrumbs != 'n'){
$crumbs = array('Gallery' => $_SERVER['PHP_SELF']);
$gallery = $this->addBreadCrumbs($crumbs).$gallery;
}
$this->saveCache($this->id,$gallery); // saves cached HTML file
return $gallery;
}