Advertisement
Guest User

FB AppRequsts Invite

a guest
Jun 20th, 2011
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.26 KB | None | 0 0
  1.         require_once('Facebook.php');
  2.         $f = new Facebook(array('appId' => $obj->appid, 'secret' => $obj->seckey));
  3.  
  4.         try{
  5.                         $m = new Model_Invite();
  6.                         foreach($requests as $request){
  7.                                 $req = $f->api('/' . $request . '/', 'GET');
  8.  
  9.                                 if(is_array($req)){
  10.                                         try{
  11.                                                 $row = $m->createRow();
  12.                                                 $row->to_id = $req['to']['id'];
  13.                                                 $row->to_name = $req['to']['name'];
  14.                                                 $row->from_id = $req['from']['id'];
  15.                                                 $row->from_name = $req['from']['name'];
  16.                                                 $row->tab_id = $obj->tab_id;
  17.                                                 $row->save();
  18.  
  19.                                         }catch(Exception $e){}
  20.  
  21.  
  22.                                         $f->api('/' . $request . '/', 'DELETE');
  23.                                 }
  24.                         }
  25.  
  26.             }catch(Exception $e) {
  27.                     // error handling
  28.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement