You are here

function fb_friend_write_records in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 contrib/fb_friend.module \fb_friend_write_records()
1 call to fb_friend_write_records()
fb_friend_fb_friend in contrib/fb_friend.module
Implements hook_fb_friend().

File

contrib/fb_friend.module, line 527
This module implements several features specific to Facebook friend networks.

Code

function fb_friend_write_records($data, $targets) {
  if (!isset($data['created'])) {
    $data['created'] = REQUEST_TIME;
  }
  if (!isset($data['fbu_actor'])) {
    $data['fbu_actor'] = fb_facebook_user();
  }
  if (!isset($row->label) && isset($GLOBALS['_fb_app'])) {
    $data['label'] = $GLOBALS['_fb_app']->label;
  }
  $rows = array();
  foreach ($targets as $fbu) {
    $row = $data;
    $row['fbu_target'] = $fbu;
    $result = fb_friend_write_record($row);
    if ($result) {
      $rows[] = $row;
    }
  }
  return $rows;
}