Determining if current visitor has logged in?
-
Hi All,
I’d like to work on a plugin that allows me to offer the rating of posts to registered users.
Ideally, I’d like registered users to only be able to rate a post 0 or 1 times. ie, I’d rather users didn’t inflate or deflate ratings by voting multiple times.
The mechanism I have in mind is relatively simple — store in a table the post id, user id and rating whenever a registered user rates a post, and skip displaying the ‘rate it’ link if the table contains a rating for the user in question on the post in question.
My question is, is there a global variable I can check to work out:
– if the person requesting the page is logged in
– what their user id is, if they are?
Any help appreciated!
Much warmth,
planetthoughtful
- The topic ‘Determining if current visitor has logged in?’ is closed to new replies.