My script is pretty slow when inviting users to event, because it has to check if user already is invited to the event, or else it will give a facebook ouath error.
Can i make it faster?
foreach ( $_POST['friends'] as $ids ) {
if ( $i < 199 ) {
$iZ = $facebook->api("/".$event_id."/invited/".$ids, "GET");
if ( $iZ['data'][0]['rsvp_status']):
$status = $iZ['data'][0]['rsvp_status'];
else:
$status="";
endif;
if ( ($status != 'declined' && $status != 'attending' && $status != "unsure" && $status != "not_replied") || empty($status)) {
$id.=$ids . ",";
$i=$i+1;
}
}
}
$id = substr_replace($id ,"",-1);
echo $facebook->api("/".$event_id . "/invited",'POST', array("users" => $id));