Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you tried using the <a href="https://developers.facebook.com/docs/reference/php/" rel="nofollow">Facebook PHP SDK</a>? I highly recommend moving away from depreciated FQL as once you get to grips with the new API it is very easy to use</p> <p>Once you have set up <code>$facebook</code> you can then just make API calls with <code>$facebook-&gt;api('/query');</code></p> <p>I'm not 100% sure what information you are trying to retrieve from your question however but I have put together a Lightbox / Facebook myself, even using tag data to pick people out of the picture so feel free to provide more detail and I will try to provide a more comprehensive answer</p> <p>EDIT: In order to build queries and test data returned you can use the <a href="https://developers.facebook.com/tools/explorer?method=GET" rel="nofollow">Graph API Explorer</a> and construct the query you want to test against your own Facebook Application</p> <blockquote> <p>I'm trying to fetch friendlist</p> </blockquote> <p>After you've setup <code>$facebook</code> then you can retrieve your friends by using</p> <pre><code>$fb_friends = $facebook-&gt;api("/me?fields=friends"); </code></pre> <p>Next:</p> <blockquote> <p>50 latest tagged photos and likes</p> </blockquote> <p>To retrieve the latest 50 tagged photos and likes you'll need to do:</p> <pre><code>$fb_photos = $facebook-&gt;api("/me?fields=photos.limit(50)"); $fb_likes = $facebook-&gt;api("/me?fields=likes.limit(50)"); // I should mention that each time api() is called, the server makes a HTTPS request to Facebook, so it is worth condensing api queries to reduce load time: $fb_data = $facebook-&gt;api("/me?fields=photos.limit(50),likes.limit(50)"); $fb_photos = $fb_data['photos']; $fb_likes = $fb_data['likes']; </code></pre> <p>If you want the latest 50 of photos <strong>and</strong> likes chronologically sorted, you can <code>array_merge()</code> the two arrays and use a subval sort function for created_time, then just take the first 50.</p> <blockquote> <p>I'm going to insert all the basic info into mysql (stuff like name, facebook id, email ect.) I'm going to use the fb id inserted into myslq, to view the friendlist, likes and photos</p> </blockquote> <p>Right then, when you user logs on you will need to request extended permissions from them to access data like photos, likes and friends. When your user logs into facebook with the link you provide to them on your website, you need to call</p> <pre><code>$loginUrl = $facebook-&gt;getLoginUrl(array( 'scope' =&gt; 'read_stream,user_likes,user_photos,friends_photos,user_friends'));` </code></pre> <p>The scope is defined by the <a href="https://developers.facebook.com/docs/reference/login/#permissions" rel="nofollow">permissions stated here</a></p> <p>Once you have been granted access to that information by the user you can retrieve profile information with <code>$user = $facebook-&gt;api("/me");</code> and store the facebook ID, name etc in your database.</p> <p>To <a href="https://developers.facebook.com/tools/explorer?method=GET&amp;path=me?photos.limit%2850%29" rel="nofollow">get a better look at the data you'll be handing for photos</a> then make sure that you click <strong>Get access token</strong> at the top of the page and grant permission to access photos and likes</p> <p>Any more questions feel free to ask and I will provide more detail, hope that helps mate!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload