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!!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

k.dani’s picture

Issue summary: View changes
Status: Active » Patch (to be ported)
FileSize
1.62 KB

I'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...)

BBC’s picture

Thanks 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.

BrightBold’s picture

Status: Patch (to be ported) » Needs review

Seems like this is the wrong status if we want this committed, so changing to Needs Review.

daveferrara1’s picture

I'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.

daveferrara1’s picture

Status: Needs review » Closed (fixed)