Help with fbaccess.php ,writes parse error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with fbaccess.php ,writes parse error

    Pls help me with fbaccess.php file it writes Parse error: syntax error, unexpected $end in /home/u419521057/public_html/fb/fbaccess.php
    on line 33
    please u cn ***** and correct file.THANKs IN ADVANCE
    Last edited by arnage; 01.07.12, 18:07.

    #2
    without seeing the script its impossible to answer
    probably a missing ; on line 32

    Comment


      #3
      okay,dis is d script


      1. <?php
      2. //Application
      Configurations $app_
      id = "id131820383"; $
      app_secret =
      "e96824203c7myap
      p";
      3. $site_url = "http://
      busaryweb.tk/fb/
      index.php"
      ; try
      {include_once "src/
      facebook.php"; }catch
      (Exception $e)
      { error_log($e); }
      4. // Create our
      application instance
      $facebook = new
      Facebook (array
      ( 'appId' => $app_
      id,'secret' => $app_
      secret,));
      5. // Get User ID
      6. $user = $facebook-
      >getUser ();
      7. // We may or may
      not have this data
      based
      8. // on whether the
      user is logged in.
      9. // If we have a $
      user id here, it
      means we know
      10. // the user is logged
      into
      11. // Facebook, but we
      donyt know if the
      access token is
      valid. An access
      12. // token is invalid if
      the user logged out
      of Facebook. if($
      user){ //
      ====================
      Single query
      method=============
      =====================
      ====
      13. try{ //Proceed
      knowing you have
      a logged in user
      who's authenticated.
      14. $user_profile = $
      facebook -> api('/me')
      ; }catch
      (FacebookApiExcepti
      on $e){error_log($e); $
      user = NULL; }
      15. //
      ====================
      Single query
      method
      ends================
      ================= }
      16. if($user){// Get
      logout URL$
      logoutUrl = $
      facebook ->
      getLogoutUrl(); }else
      {// Get login URL $
      loginUrl = $facebook
      - > getLoginUrl(array
      ('scope' => 'read_
      stream,publish_
      stream, user_
      birthday, user_
      location, user_work_
      history, user_
      hometown, user_
      photos', 'redirect_uri'
      => $site_url, )); }
      17. if($user){ // Proceed
      knowing you have
      a logged in user
      who has a valid
      session.
      18. //========= Batch
      requests over the
      Facebook Graph
      API using the PHP-
      SDK ========
      19. // Save your
      method calls into
      an array $queries =
      array (array
      ('method' => 'GET',
      'relative_url' => '/'.$
      user), array('method'
      => 'GET', 'relative_url'
      => '/'.$user.'/home?
      limit=50'), array
      ('method' => 'GET',
      'relative_url' => '/'.$
      user.'/friends'), array
      ('method' => 'GET',
      'relative_url' => '/'.$
      user.'/photos?limit=6')
      , );
      20. // POST your
      queries to the batch
      endpoint on the
      graph.
      21. try{$batchResponse
      = $facebook->api('?
      batch='.json_encode($
      queries), 'POST'); }
      catch(Exception $o)
      {error_log($o); }
      22. //Return values are
      indexed in order of
      the original array,
      content is in ['body']
      as a JSON
      23. //string. Decode for
      use as a PHP array.
      24. $user_info = json_
      decode($
      batchResponse[0]
      ['body'], TRUE); $
      feed = json_decode($
      batchResponse[1]
      ['body'],TRUE); $
      friends_list = json_
      decode($
      batchResponse[2]
      ['body'], TRUE); $
      photos= json_decode
      ($batchResponse[3]
      ['body'], TRUE);
      25. //========= Batch
      requests over the
      Facebook Graph
      API using the PHP-
      SDK ends =====
      26. // Update user's
      status using graph
      api
      27. if(isset($_POST
      ['publish'])){ try{ $
      publishStream = $
      facebook -> api("/$
      user/feed", 'post',
      array('message' =>
      'Check out
      CodeLive'
      , 'link'
      =>'http://
      busaryweb.tk',
      'picture' =>
      'http://25labs.com/
      images/25-
      labs-160-160.jpg'
      ,
      'name' => 'CodeLive',
      'caption' =>
      'CodeLive',
      'description' => 'A
      Technology
      Laboratory. Highly
      Recomented
      technology blog.'
      ,)); }
      catch
      (FacebookApiExcepti
      on $e){error_log($e); }
      }
      28. // Update user's
      status using graph
      api
      29. if(isset($_POST
      ['status'])){ try{ $
      statusUpdate = $
      facebook -> api("/$
      user/feed", 'post',
      array('message' => $_
      POST ['status'])); }
      catch
      (FacebookApiExcepti
      on $e){error_log($e);
      30. }
      31. }
      32. }
      33. ?>
      Last edited by Busary; 08.07.12, 09:08.

      Comment

      Working...
      X