Support » Plugin: Simple Facebook Connect » [Plugin: Simple Facebook Connect] Conditional tags with SFC for login etc. & combining with ajax

  • Ok, here is what I want to do:

    I have a small hard-coded menu on top of my website. In that small menu, I would like to add a series of conditionals to display particular things.

    First check if the user is logged in. If so, it should say “Welcome back <Username>” – where <Username is also a link to the WP profile> and maybe display a small FB avatar if the user is logged in with an account that is linked to a FB account. Also, if the user is logged in, a logout button/link is shown.
    If the user is not logged in, there should be a tiny log in form (alternatively I would go for a link too, which would lead me to the second half of this post – see below) and a register link – very much the same as it does here on the wordpress homepage.

    A third condition would also be cool: the user is not logged in on the website but is connected to FB, so it shows the small FB avatar and name but maybe instead of “welcome back…” it might say: “Hey <username>, want to connect your FB account to this site?” alongside a button/link taking you to the register/connect site.

    I tried different variations of if ( is_user_logged_in() ) conditionals, but nothing seems to work, because I think that SFC is hijacking those functions to hook its own functions into WP – which is fine, but leaves me clueless on how to achieve the above…

    The second part of this post:
    Instead of the usual login/register page, I would very much prefer a pop-up – probably via ajax (with a redirect to the normal login page if java is disabled), but since the conditionals already are not working, I am a little bit reluctant to try plug-ins.

    I could just disable the SFC to test all of these things, but I do have users connected via FB already and I am not sure what would break and what not, if I just disable SFC – aside from the fact that I don’t want to, because I like this plug-in (the best FB connector I have found) ^^

Viewing 1 replies (of 1 total)
  • I tried to find php hooks I might use in my header, instead of the default WP ones, to use in conditional tags, but couldn’t find any. My coding abilities are sadly not good enough to make my own out of your code. So I won’t be able to use conditionals to show login/register/connect of SFC. Seems like I need to find another FB-connecter that allows a little bit more control where it is added in the theme.

    thanks anyway.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Simple Facebook Connect] Conditional tags with SFC for login etc. & combining with ajax’ is closed to new replies.