SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Zealot tconley79's Avatar
    Join Date
    Feb 2004
    Location
    Miami
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Detect if current visitor has already "liked" a webpage

    Hello,

    I have a question regarding "liking" a web page outside of facebook.

    I am familiar with placing a like button on an external web page -- I've done this for clients many times. However, I have a new client who wants a "Like" button, but also wants to know if the current visitor as already "liked" the page so he can display more content on his website. For example, for normal visitors, his web page displays 3 helpful hints. But if the user has "liked" the page, then the web page displays 10 more hints.

    Is it possible (through php or javascript or something) to do a check every time the page is accessed, determine if the current visitor has "liked" the page, and then present the content accordingly??

    Thanks in advance for any help!

    T

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    No....unless you ask Facebook or what ever this "liked" button is for...assuming Facebook would even tell you.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Wizard silver trophy
    Join Date
    Aug 2003
    Location
    Southern California
    Posts
    4,686
    Mentioned
    19 Post(s)
    Tagged
    0 Thread(s)
    If you bring Facebook connect into the mix to authenticate visitors you can retrieve, and parse, a list of the pages they have liked. By comparing these to the ID of the page in question you can figure out if there's an existing connection.

    http://developers.facebook.com/docs/reference/api/ click on "likes"
    - Ted S

  4. #4
    Non-Member
    Join Date
    May 2012
    Location
    CA, Irvine
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For this, you could have admin permission from fb which u can not get, rest u can see on insights of your page.

  5. #5
    SitePoint Zealot tconley79's Avatar
    Join Date
    Feb 2004
    Location
    Miami
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sigmainfo View Post
    For this, you could have admin permission from fb which u can not get, rest u can see on insights of your page.
    Hi all. Thanks for your replies. Pretty much what I thought.

    Although I have noticed that if I like a page and then come back later to that particular site, the like box says "liked" (if I am already logged into facebook). Is there a way the rest of the page can use this info and not just the Facebook widget??

  6. #6
    SitePoint Wizard silver trophy
    Join Date
    Aug 2003
    Location
    Southern California
    Posts
    4,686
    Mentioned
    19 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tconley79 View Post
    Hi all. Thanks for your replies. Pretty much what I thought.

    Although I have noticed that if I like a page and then come back later to that particular site, the like box says "liked" (if I am already logged into facebook). Is there a way the rest of the page can use this info and not just the Facebook widget??
    You don't need admin rights to know what a user likes, you need their rights.

    See the link I posted previously and click the likes section to see everything you liked -- as any app that's authenticated to you can do.
    - Ted S


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •