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™

redirect logged in users

s2Member Plugin. A Membership plugin for WordPress®.

redirect logged in users

Postby gvdsleen » March 8th, 2011, 3:24 pm

Redirection of logged in users to a specific page using /page-%%current_user_level%% stopped working after upgrade to newest version.

Have done everything I can think off, including disabling all plugins and roll-back to previous version. Am i missing something? Tips to solve this?
User avatar
gvdsleen
Registered User
Registered User
 
Posts: 22
Joined: December 20, 2010

Re: redirect logged in users

Postby Cristián Lávaque » March 9th, 2011, 12:26 am

Did you use /page-%%current_user_level%% or a full URL starting with http://?

It should be the latter. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: redirect logged in users

Postby gvdsleen » March 9th, 2011, 4:46 am

Issue was in using the sidebar login widget. Have upgraded to pro and am now using the S2member widget.

However, I would like to change the link to the profile page from a pop-up to the Buddypress profile page.

Changing the edit profile link in the widget does not seem to work. Changed it to the URL:

http://www.mysite.com/members/%%current_user_login%%/profile.

Suggestions?
User avatar
gvdsleen
Registered User
Registered User
 
Posts: 22
Joined: December 20, 2010

Re: redirect logged in users

Postby mctwisty » March 9th, 2011, 10:16 am

Redirection is not working for me either. Trying a custom URL or just choosing a page doesn't work. Please help. My users are confused.
User avatar
mctwisty
Registered User
Registered User
 
Posts: 9
Joined: February 23, 2011

Re: redirect logged in users

Postby Cristián Lávaque » March 9th, 2011, 11:21 am

gvdsleen wrote:Issue was in using the sidebar login widget. Have upgraded to pro and am now using the S2member widget.

That's good to know in case someone else has the same problem. Thanks!
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: redirect logged in users

Postby camillemm » March 9th, 2011, 11:29 am

Well, it's not a great solution as the Non pro version prevent the redirection (and even with plugins created for redirecting visitors).
User avatar
camillemm
Registered User
Registered User
 
Posts: 86
Joined: September 7, 2010

Re: redirect logged in users

Postby gvdsleen » March 9th, 2011, 2:09 pm

Would like to know how to redirect users to their buddypress profile page from the sidebar widget?
User avatar
gvdsleen
Registered User
Registered User
 
Posts: 22
Joined: December 20, 2010

Re: redirect logged in users

Postby camillemm » March 9th, 2011, 4:36 pm

No, just a simple redirection after login on a regular blog. I found a solution but not very "clean".
User avatar
camillemm
Registered User
Registered User
 
Posts: 86
Joined: September 7, 2010

Re: redirect logged in users

Postby Cristián Lávaque » March 9th, 2011, 6:18 pm

camillemm wrote:No, just a simple redirection after login on a regular blog. I found a solution but not very "clean".

Did s2Member's post-login redirection not work for you?

WP Admin -> s2Member -> General Options -> Login Welcome Page
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: redirect logged in users

Postby camillemm » March 10th, 2011, 2:46 am

OK, found the problem (an hidden redirect field breaking the redirection) ! :oops:
User avatar
camillemm
Registered User
Registered User
 
Posts: 86
Joined: September 7, 2010

Re: redirect logged in users

Postby Cristián Lávaque » March 10th, 2011, 3:38 am

I'm glad you solved it!

Where was that hidden redirect? Just curious.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: redirect logged in users

Postby camillemm » March 10th, 2011, 4:39 am

Well here is the story:

I selected for redirection http://www.mysite.com/%%current_user_login%%
I put a login code like this

Code: Select all
<<?php if (!(current_user_can('level_0'))){ ?>
<h2>Login</h2>
<form action="<?php echo get_option('home'); ?>/wp-login.php" method="post">
<input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" size="20" />
<input type="password" name="pwd" id="pwd" size="20" />
<input type="submit" name="submit" value="Send" class="button" />
    <p>
       <label for="rememberme"><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me</label>
       <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
    </p>
</form>
<a href="<?php echo get_option('home'); ?>/wp-login.php?action=lostpassword">Recover password</a>
<?php } else { ?>
<h2>Logout</h2>
<a href="<?php echo wp_logout_url(urlencode($_SERVER['REQUEST_URI'])); ?>">logout</a><br />
<a href="http://XXX/wp-admin/">admin</a>
<?php }?>


It worked nice until WP 3.04. So I looked on this forum and searched for login codes but nothing worked nice. So I used redirection plugins (Peter's Login redirection) but with WP 3.05 even these plugins stopped to work in conjunction with S2member.
At last, I changed the hidden redirection with

Code: Select all
<input type="hidden" name="redirect_to" value="<?php global $current_user;
      get_currentuserinfo();
     echo $current_user->user_login;

?>" />

and I managed to redirect people to their page. The last thing I did is to delete this hidden redirection and it seems to work with S2member feature.
User avatar
camillemm
Registered User
Registered User
 
Posts: 86
Joined: September 7, 2010

Re: redirect logged in users

Postby Jason Caldwell » March 10th, 2011, 4:49 am

Thanks for the excellent question.
gvdsleen wrote:Issue was in using the sidebar login widget. Have upgraded to pro and am now using the S2member widget.

However, I would like to change the link to the profile page from a pop-up to the Buddypress profile page.

Changing the edit profile link in the widget does not seem to work. Changed it to the URL:

http://www.mysite.com/members/%%current_user_login%%/profile.

Suggestions?

Couple of things on this topic.
1. If you are using the s2Clean theme, please remember that s2Clean comes with two variations of your Sidebar and Footbar. So perhaps you are editing the one for public view ( i.e. the default Sidebar ), and actually testing while logged-in ( i.e. you might be seeing the other variation ). In other words, you have to edit both Sidebar/Widget variations if you're doing it this way with the s2Clean theme.

2. In the current version of s2Member Pro ( at this time: v1.5.2 ), those %%current_user_xxxx%% Replacement Codes are not supported by that field in the widget panel. I'm having this updated for you in the release of s2Member Pro v1.5.3+.
~ 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

Re: redirect logged in users

Postby Vinnyo » March 10th, 2011, 4:09 pm

This is exactly the same problem I am having.

Which file did you edit and input the code you mentioned


Thanks
Vince
User avatar
Vinnyo
Registered User
Registered User
 
Posts: 28
Joined: October 1, 2010

Re: redirect logged in users

Postby Cristián Lávaque » March 10th, 2011, 4:23 pm

It'll vary depending on what is modifying the login form.

You can try deactivating the other plugins one by one until you see this change in your login form, then you'll know which one is doing it.

Or you can view the HTML source code of your login page and find the hidden redirection field. Copy it and search your WordPress source files, and its plugins', to see if you find which one is adding it.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: redirect logged in users

Postby camillemm » March 10th, 2011, 4:33 pm

Vinnyo wrote:This is exactly the same problem I am having.

Which file did you edit and input the code you mentioned


Thanks
Vince

As I created myself the login form, I knew where to search :-)
User avatar
camillemm
Registered User
Registered User
 
Posts: 86
Joined: September 7, 2010

Re: redirect logged in users

Postby gvdsleen » March 15th, 2011, 8:06 am

Hi Jason,

GREAT! thanks for the update, is working like a charm now!
User avatar
gvdsleen
Registered User
Registered User
 
Posts: 22
Joined: December 20, 2010

Re: redirect logged in users

Postby Jason Caldwell » March 15th, 2011, 2:58 pm

Thanks for the follow-up. You're very welcome!
gvdsleen wrote:Hi Jason,

GREAT! thanks for the update, is working like a charm now!

In the current version of s2Member Pro ( at this time: v1.5.2 ), those %%current_user_xxxx%% Replacement Codes are not supported by that field in the widget panel. I'm having this updated for you in the release of s2Member Pro v1.5.3+.
This was implemented in the release of s2Member Pro v1.5.3+.
~ 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: Yahoo [Bot] and 3 guests

cron