title: Check if user has liked a post or not with Facebook Graph API
body: <p>I want to design a news feed with fully functioning likes/Unlike ,share and commenting,and of course fetching recent posts from users newfeed.Now here is the thing,I want to check whether a user has liked a post (type is video, photo, link or status). </p>
  
  <p>If a user has liked the post already, then show unlike button, if a user has not liked, show like button.</p>
  
  <p>FILES:</p>
  
  <p><a href="https://docs.google.com/file/d/0B63GOnae39s1WHF5eklNWkdjWTQ/edit?usp=sharing" rel="nofollow">index.php</a> click to open the file</p>
  
  <p>Now there are few problems here:
  1- problem is that when ever i run this code,it shows only one post from newsfeed.but if i remove the following code from the code,it will fetch 20 posts from newsfeed .i dont know whats happening.</p>
  
  <pre><code>$ret = $facebook-&gt;api(array(
  'method' =&gt; 'fql.query',
  'query' =&gt; "SELECT like_info FROM $type WHERE object_id=$object_id"
   ));
   $checklike = $ret['data']['like_info']['user_likes'];
  </code></pre>
  
  <p>2-we can use object_id only for photos,albums,and videos.but you cant use it to get like_info fro link and status types.so i need new way and a new technique to findout wether user has liked an post or not</p>
  
  <p>3-whenever i add a new $facebook->api() inside the foreach loop,it will fetch 1-3 posts from fb or even not all.</p>
  
  <p>so if you could find anyway to make a news feed with fully functioning likes/Unlike ,share and commenting,and of course fetching recent posts from users newfeed OR fixing the problems i mentioned ,That would be greatful.</p>
  
  <p>please help me as soon as possible,if you need anything ,just comment and i will provide you with.</p>
  
  <p>Thanks.</p>