I rewrote the albums.php entirely. And now it works much better and faster. Though it doesn’t contain any error checking.
Replace the “albums.php” by following code and remember to change the FBUSERID to the right one:
<?php
$fb_albums = file_get_contents('https://graph.facebook.com/FBUSERID/albums/?fields=id,name,type&limit=2000');
$json = json_decode($fb_albums);
$i = 0;
echo '<div class="fbalbum_thumb_row">';
foreach($json->data as $item) {
if ($item->type == 'normal') {
if ($i <= 3) {
echo '<div class="fbalbum_thumb"><a href="?fbasid='.$item->id.'"><img src="https://graph.facebook.com/' . $item->id . '/picture"><br />';
echo '' . $item->name . '</a></div>';
$i++;
}
else {
echo '</div> <!-- .fbalbum_thumb_row -->';
echo '<div class="fbalbum_thumb_row">';
$i = 0;
}
}
}
echo '</div> <!-- .fbalbum_thumb_row -->';
?>
and add to fbasstyles.css:
.fbalbum_thumb_row { width: 100%; text-align: center; }
.fbalbum_thumb { display: inline-block; width: 20%; margin: 0 1em 1em; vertical-align: top; }
.fbalbum_thumb img { height: 120px; margin: 0; max-width: 160px; margin-bottom: 0.5em;}