PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

First Time Logged In Conditional-Using Wp-FB AutoConnect

s2Member Plugin. A Membership plugin for WordPress®.

First Time Logged In Conditional-Using Wp-FB AutoConnect

Postby Gayatriom » March 11th, 2011, 10:56 am

Hi!
I am using WP-FB Autoconnect and I'd like to redirect users who sign in with facebook to a payment page so they can buy the paid membership.
However, if I use the Login Welcome Page to connect this then they will ALWAYS get this page when they log in.
I only want to show this to them if they are logging in with FB for the first time.

How can I make this possible?
User avatar
Gayatriom
Registered User
Registered User
 
Posts: 21
Joined: January 28, 2011

Re: First Time Logged In Conditional-Using Wp-FB AutoConnect

Postby Jason Caldwell » March 14th, 2011, 8:49 pm

Thanks for the excellent question.
I'm sorry, this is not something that is built into s2Member by default. However, you could certainly accomplish this with s2Member's Hook entitled: ws_plugin__s2member_during_login_redirect

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php

Do something like this inside the file:
Code: Select all
<?php
add_action 
("ws_plugin__s2member_during_login_redirect", "my_function");
function my_function ($vars = array ())
    {
        if (get_user_option ("one_time_offer_displayed", $vars["user_id"]) !== "yes")
            {
                $one_time_offer_url = "URL GOES HERE";
                /**/
                update_user_option ($vars["user_id"], "one_time_offer_displayed", "yes");
                wp_redirect ($one_time_offer_url);
                exit ();
            }
    }
?>
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron