Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I've been using facebook_pull because of it ease of intergration etc, but I've recently hit a bug which means that sometimes no posts are displayed although the date and author is. Looking into the JSON, when the module is set to pull 'POSTS' it only seems to display messages and not stories. I'm only pulling one posts and implimented this quick fix in the template file, but this means that the admin limit has to be set to lets say 20 to ensure that a posts gets displayed.... Any help would be appreciated!!
<ul class="facebook-feed">
<?php
$i = 0;
foreach ($items as $item):
$i++;
// Check that the message isn't empty + Horrid fix for only displaying posts that have message JSON Data as this takes control away from the admin
if((!empty($item->message)) && ($i <= 1)):
?>
<li class="item">
<span class="facebook-feed-message">
<?php if(isset($item->message)){ echo ($item->message); } ?>
<?php if ($item->type === 'link'): ?>
<?php if(isset($item->description)) echo l($item->description); ?>
<?php if(isset($item->name)) echo l($item->name, $item->link); ?>
<?php endif; ?>
</span>
<span class="facebook-feed-from"><a href="http://facebook.com/profile.php?id=<?php echo $item->from->id; ?>"><?php echo $item->from->name; ?></a></span>
<span class="facebook-feed-time"><?php echo t('!time ago', array('!time' => format_interval(time() - strtotime($item->created_time)))); ?></span>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
Thanks!!
Comment | File | Size | Author |
---|---|---|---|
#1 | facebook_pull-not_displaying_feed-1989030.patch | 1.62 KB | k.dani |
Comments
Comment #1
k.dani CreditAttribution: k.dani commentedI've created a patch that solves this problem. It is a quick fix but also a good starting point to be able to display different type of facebook feeds(photo, video, question, etc...)
Comment #2
BBCThanks for the patch! It works great for me. Am new to facebook_pull and this patch turned out to be the key to getting a feed to display for me.
Many thanks for the module. Great to see something that does such a clean job of embedding activities in a page. Removing the need for iframes and fixed widths was exactly what I was looking for.
Comment #3
BrightBoldSeems like this is the wrong status if we want this committed, so changing to Needs Review.
Comment #4
daveferrara1 CreditAttribution: daveferrara1 commentedI'll get this added asap. I think we want to break photo and video apart, just with separate classes assigned for each of them for further customization. Any objections?
I'll get this committed. And look into the split in the future.
Comment #5
daveferrara1 CreditAttribution: daveferrara1 commented