Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-30T15:47:18-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=16599 2011-12-30T15:47:18-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16599&p=59251#p59251 <![CDATA[Re: Redirect Profile page based on role]]>

Statistics: Posted by Raam Dev — December 30th, 2011, 3:47 pm


]]>
2011-12-29T21:40:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16599&p=59170#p59170 <![CDATA[Re: Redirect Profile page based on role]]>

Anything else you need just ask.

Statistics: Posted by Eduan — December 29th, 2011, 9:40 pm


]]>
2011-12-29T20:45:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16599&p=59165#p59165 <![CDATA[Re: Redirect Profile page based on role]]>
Thanks to both Eduan and Raam Dev.

I tried both your suggestions and ran into several issues I could not resolve - with my very limited knowledge.

Did find a solution that works by adding a function to my functions.php file as follows:
Code:
function subscriber_redirect(){
  if( is_admin() && !defined('DOING_AJAX') && ( current_user_can('subscriber') ) ){
    wp_redirect('http://mydomain.com/?page_id=xxxx');
    exit;
  }
}
add_action('init','subscriber_redirect');


Ps: Eduan, I think that the video you pointed me to is going to prove very useful in future. Appreciate it. :D

Statistics: Posted by guyu2 — December 29th, 2011, 8:45 pm


]]>
2011-12-29T16:32:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16599&p=59143#p59143 <![CDATA[Re: Redirect Profile page based on role]]>
So you want regular paying subscribers to see a profile page after logging in, but the free subscribers to go somewhere else?

To send all users to the Profile Page after logging in, you'll want to select the Profile Page as the Login Welcome Page in WP Admin -> s2Member -> General Options -> Login Welcome Page.

Then the most simple way to redirect free subscribers is to use Advanced/PHP Conditionals (WP Admin -> s2Member -> API/Scripting -> Advanced/PHP Conditionals) to check if the user viewing the Profile Page is a free subscriber (s2member_level0). If they are a free subscriber, then the HTML Meta Refresh redirects them to another page.

Code:
<?php if (current_user_is("s2member_level0")) { ?>
<meta http-equiv="refresh" content="0; url=http://example.com/free-subscribers-area">
<?php } ?>


You'll need to install and activate the PHP Execution plugin before adding this code to the top of your Profile Page (i.e., wherever you're using the [s2Member-Profile /] shortcode.

The downside to this method is that the free subscriber will probably see the contents of the Profile Page for a brief moment before being redirected away.

If you want to get more advanced, you can use a Custom Page Template for your Profile Page and then add the PHP code directly to that page template, preventing the [s2Member-Profile /] shortcode from ever loading for free subscribers.

Statistics: Posted by Raam Dev — December 29th, 2011, 4:32 pm


]]>
2011-12-29T16:27:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16599&p=59141#p59141 <![CDATA[Re: Redirect Profile page based on role]]> http://www.s2member.com/paypal-modifica ... ons-video/

Hope this helps. :)

Statistics: Posted by Eduan — December 29th, 2011, 4:27 pm


]]>
2011-12-29T15:58:40-05:00 http://www.primothemes.com/forums/viewtopic.php?t=16599&p=59135#p59135 <![CDATA[Redirect Profile page based on role]]>
[s2Member-Profile role="subscriber"/]

If not is there another way?

Appreciate the help.

8-) Guy

Statistics: Posted by guyu2 — December 29th, 2011, 3:58 pm


]]>