Catchable fatal error: Object of class stdClass could not be converted to string in /home/samvedana08/samvedana.org.in/wp-content/plugins/facebook-page-albums/class-facebook-page-albums-apimanager.php on line 220
WordPress Version : 4.6
Need help in this…
]]>Hi,
Great plugin! Really makes getting the Facebook Albums on the site nice and fast.
I am trying to customize it so I can have pagination on the album page like it is on the photos page. Anyway to make this happen?
]]>I move my site to a new host https://ihockey.info/gallery/
And now I got error
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/vitalyc/public_html/wp-content/plugins/facebook-page-albums/class-facebook-page-albums-apimanager.php on line 98
Any ideas how to fix it ?
installed and activated API.
then I don’t understand, after put the themes/example content in my theme, what have I to do.
Is that index.php file a theme? a plugin? a page? a template?
there’s not a step.-to step guide to make this plugin work?
I would like to share my code example, which works on my site.
My code is based on the example in the plugin themes folder, it is not perfect as I still haven’t figured out how to display pagination on album page, so if anyone got more ideas or found fault in it, please kindly point it out, it would be much appreciated.
Please also check the data variable available in the fb api which the plugin is using
https://developers.facebook.com/docs/graph-api/reference/v2.2/album
https://developers.facebook.com/docs/graph-api/reference/v2.2/album/photos
Here is the code on my gallery page
———————————————————————————————–
<?php
/*
* Template Name: gallery page
*/
?>
<?php
get_header();
?>
<!-- here will be the other html code with your own structure-->
<!-- the below is a switch to display whether album list page or the photo list in a album-->
<div id="content" class="gallery" role="main">
<?php
if (!empty($_GET['id'])) {
// Photo List
theme_show_photos($_GET['id']);
}
else {
// Album List
theme_show_albums();
}
?>
</div>
<?php get_footer(); ?>
<!-- below is the function for calling the fb album data from the plugin -->
<?php
/**
* Render the album list
*/
function theme_show_albums() {
//
// Get Album List
//
$list = facebook_page_albums_get_album_list(array(
'per_page' => 99
//as pagination is not working of album listing page in my code, this "99" will allow all the albums are showing on the first page
));
if (empty($list)) :
?>
<p>
No album found
</p>
<?php
return;
endif;
?>
<ol class="album-list">
<?php
//
// Loop Album List and Render items
//
if (!empty($list)) : foreach ($list as $item) :
if ($item['type'] != 'normal' || $item['name'] == 'Cover Photos') {
continue;
}
// Link to each album
$link = add_query_arg('id', $item['id']);
?>
<?php if (!empty($item['cover_photo_data'])):
// avoid empty album
?>
<li class="album">
<a href="<?php echo $link;?>" class="" target="_blank">
<?php
// It has a thumbnail
if ($thumb = $item['cover_photo_data']):?>
<div class="album">
<div class="" style="background: url('<?php echo $thumb['source'];?>') 50% 50% no-repeat;"></div>
</div>
<?php endif; ?>
<div class="album-info">
<div class=""><?php echo $item['name'];?></div>
<div class="">
<?php if (!empty($item['comments'])) :?>
<div class="">Comments: <?php echo $item['comments'];?></div>
<?php endif;?>
<?php if (!empty($item['likes'])) :?>
<div class="">Like: <div class="like-txt"><?php echo $item['likes'];?></div></div>
<?php endif;?>
</div>
</div>
</a>
</li>
<?php endif;?>
<?php endforeach; endif;?>
</ol>
<?php
}
/**
* Render the photo list
*
* @param Integer
*/
function theme_show_photos($id) {
global $paged;
$per_page = 30;
if (empty($paged)) $paged = 1;
// Album Information
if (!$album = facebook_page_albums_get_album($id)) {
echo 'failed to get album information';
return false;
}
//
// Photo List
//
if (!$list2 = facebook_page_albums_get_photo_list($id, array(
'per_page' => $per_page,
'paged' => $paged
))) {
echo 'failed to get photo list';
return;
}
?>
<div class=""><a href="<?php echo home_url(); ?>/gallery" target="_self" title="Back to Gallery">Back to Gallery</a></div>
<div class="photo-list-header">
<h3><?php echo $album['name'];?></h3>
<div class="counts">
<a class="goto-facebook" href="<?php echo $album['link'];?>" target="_blank" title="See on Facebook">See on Facebook</a>
</div>
<ol class="photo-list">
<?php if (!empty($list2)): foreach ($list2 as $itemf):?>
<li class="photo">
<a class="photo-link" href="<?php echo $itemf['source'];?>" title="<?php if (!empty($itemf['name'])) echo $itemf['name'];?>">
<div class="photo-thumb">
<div class="" style="background: url('<?php echo $itemf['source'];?>') 50% 50% no-repeat;"></div>
</div>
<div class="photo-info">
<div class=""><?php if (!empty($itemf['message'])) echo $itemf['message'];?></div>
<div class="">
<?php if (!empty($itemf['likes'])) :?>
<div class="l">Like: <?php echo count($itemf['likes']['data']);?></div>
<?php endif;?>
</div>
</div>
</a>
</li>
<?php endforeach; endif;?>
</ol>
<div class="page-control">
<?php
//
// Page Control
//
echo paginate_links( array(
'base' => add_query_arg( 'paged', '%#%' ),
'format' => '',
'total' => ceil($album['count'] / $per_page),
'current' => $paged,
'prev_text' => '«',
'next_text' => '»',
'mid_size' => 5
));
?>
</div>
<?php
return true;
}
?>
]]>
Hi.
After updating the plugin, the facebook page album no longer display.
In my theme, I have facebook_album/facebook_album.php
with the updated given example.
Please help
]]>Hiya,
I found the album didn’t list all the album on the facebook, even I increase the per page limit.
Could anyone give me some hints?
Between, I am thinking of writing a tutorial about how to implement this plugin in, very useful.
Thanks Daiki
This is a powerful plugin when people are not very good with facebook api.
However, I got a problem I can’t figure out how to solve, I would like to ask for clue here.
I am having a problem that the album cache stays at a date, and the last updated date is not update any more (after migrating to a new server)
when I deselect the use album cache, the album data is not able to load. further if I select the cache option again, the album data still not able to load.
what can I do? will this be a server setting problem? If so, how can I ask hosting to get the right setting to enable the function?
Please help and many thanks
]]>Hi,
your plugin is the only one that aim to show entire albums of a fb page, so kudos to you!
Unfortunatley I need help in setting up my FB app.
I logged into Facebook Dev Center and created an app, so I obtained the app id and the secret key, but I get “No album list, but plugin installed correctly.
Please check the settings in admin panel.”
I see my app in the FB Dev Center is offline, but I don’t know how to compile the details. Can you please help?
]]>This plugin is awesome for people who don’t know how to deal with FB api.
I am using the template in example.
However, I found the query is not able to get the photo name data from FB, while album list can do.
If I only query the photo list without the ablum list, there is title display.
Anyone have any idea of it??
Hey there!
I managed to implement the plugin on my theme using the sample you provided.
The only thing is the album’s cover size is too small, how can I change that to get a bigger image? Right now is sending 130px width
Regards
E
]]>Ok,
I added the album list to my theme and it displays fine but when I click an album the page just refreshes. How is this supposed to be used?
]]>Hi There,
It would be fantastic if you also would show an example for the photo list…
facebook_page_albums_get_photo_list
Thanks!
]]>looks like a great plugin.. but useless unless you show people how to create the “call” action
https://www.ads-software.com/extend/plugins/facebook-page-albums/
]]>Hi i am wondering how to make this plugin work? can you please post a detail instruction on how to add this function in the page?
https://www.ads-software.com/extend/plugins/facebook-page-albums/
]]>how cam I get the Slug/page id of a album
https://www.ads-software.com/extend/plugins/facebook-page-albums/
]]>can someone please help? thsese instructions are kinda pointless.
https://www.ads-software.com/extend/plugins/facebook-page-albums/
]]>