views:

35

answers:

2

Hey i want to check a whether a user likes a certain page and if they do i want to display a message or div? I have searched through the facebook forums for possible solutions but i never came upon anything concrete so i would really appreciate the help.

A: 

You should be able to do this through FQL. To check if a user likes some URL:

SELECT user_id FROM like WHERE object_id in (SELECT id from object_url WHERE url="<PAGE_URL>") and user_id=<USER_ID>;

If query is empty then a user doesn't like this url. Otherwise 1 record is returned.

See like, object_url.

serg
A: 

Hey thanks for the reply. Ok basically what i am looking to do.

  1. Check whether a user is a fan of a certain url or page
  2. If yes, display message
salmon