Community Support Forums — WordPress® ( Users Helping Users ) — 2011-08-31T22:42:55-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14748 2011-08-31T22:42:55-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14748&p=33581#p33581 <![CDATA[Re: I need different redirections after login?]]>

About the error, it's because the code uses header when it's too late in the script. Try instead using a JavaScript redirection then, for example:

Code:
<?php echo '<script type="text/javascript">window.location = \'http://mydomain.com/' . S2MEMBER_CURRENT_USER_LOGIN . '\';</script>'; ?>



I hope that helps.

Statistics: Posted by Cristián Lávaque — August 31st, 2011, 10:42 pm


]]>
2011-08-31T11:00:41-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14748&p=33512#p33512 <![CDATA[Re: I need different redirections after login?]]>
The first part works fine:

Level 0 Members will redirected to the level-0 page and
Level 1 Members will redirected to the level-1 page.

I'm feeling so great that i brought home the bacon ;-)

The second part makes me unsure:

I insert the code
Code:
<?php header('Location: http://mydomain.com/' . $username); ?>
into the page.

Sorry, I don't understand what you mean with

You'd replace $username with the var that has the name you need for the URL.


Could you explain this to me a bit more ... I'm not a programmer ;-)

Ok. After I inserted the code I saved the page and tested the result. I get the following message:

!Warning: Cannot modify header information – headers already sent by (output started at /homepages/.../wp-content/themes/.../header.php:2) in /homepages/.../wp-content/themes/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 5


I 'm afraid that the problem is the "var" in your code. I have tested other php scripts inside this page and they work fine.

Thank you in advance for your help.

Regards Hans

Statistics: Posted by Berny-T — August 31st, 2011, 11:00 am


]]>
2011-08-31T03:44:09-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14748&p=33491#p33491 <![CDATA[Re: I need different redirections after login?]]> Statistics: Posted by Berny-T — August 31st, 2011, 3:44 am


]]>
2011-08-29T16:43:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14748&p=33276#p33276 <![CDATA[Re: I need different redirections after login?]]> http://mydomain.com/level-site-%%level%% right?

This'd mean that you should create one Login Welcome Page for each level your members can be: 0, 1 and 2.

http://mydomain.com/level-site-0
http://mydomain.com/level-site-1
http://mydomain.com/level-site-2

Each one should be restricted at the level they're meant for. WP Admin -> s2Member -> Restriction Options -> Page

But if you want a user from one level to see the site for a lower level, you'll need to use a conditional because Access Restriction doesn't work that way, levels have incremental access and each will have access to its level and below. WP Admin -> s2Member -> API / Scripting -> Simple/Shortcode Conditionals -> Example #3

Now, level-site-1 would be for Basic paid members and level-site-2 for Expert paid members. So far, so good.

You want the Level 0 users to be shown their personal page, though, right? Then in level-site-0 you can use a redirection to it (you'll need a PHP execution plugin https://wordpress.org/extend/plugins/exec-php/ and use the HTML editor only). E.g.

Code:
<?php header('Location: http://mydomain.com/' . $username); ?>


You'd replace $username with the var that has the name you need for the URL.

I hope that makes sense. :)

Statistics: Posted by Cristián Lávaque — August 29th, 2011, 4:43 pm


]]>
2011-08-29T15:14:06-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14748&p=33254#p33254 <![CDATA[Re: I need different redirections after login?]]>
@cassel: Thanks. I think the way is "ok". But my requirements are quit difficult. I will show this with some examples:

After the login the customers and pay users will redirected by the following rule

Customer "hugo" (a customer): http://www.mydomain.com/hugo
Customer "otto" (a customer): http://www.mydomain.com/otto
Customer "merlin" (a customer): http://www.mydomain.com/merlin
Customer "bill" (a customer): http://www.mydomain.com/bill
Customer "steve" (a customer): http://www.mydomain.com/steve

=> This means: every customer has his own (!) page. In this case I need 5 different landing pages.

User "harry" (a basic pay user): http://www.mydomain.com/basic
User "don" (a basic pay user): http://www.mydomain.com/basic
User "elton" (a basic pay user): http://www.mydomain.com/basic

User "sam" (a expert pay user): http://www.mydomain.com/expert
User "caesar" (a expert pay user): http://www.mydomain.com/expert
User "zanetti" (a expert pay user): http://www.mydomain.com/expert

=> This means: every level has his own (!) page. In this case I need 2 different landing pages.

For this case (and my opinion) I need 7 redirections.

How to integrate this via script in the header. "Unfortunately" I have more than 5 customers ;-)

Is it possible to solve my problem with the PRO version?

Regards Hans

Statistics: Posted by Berny-T — August 29th, 2011, 3:14 pm


]]>
2011-08-29T09:25:56-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14748&p=33231#p33231 <![CDATA[Re: I need different redirections after login?]]> viewtopic.php?f=4&t=14376&start=50#p30766

Statistics: Posted by cassel — August 29th, 2011, 9:25 am


]]>
2011-08-29T08:44:24-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14748&p=33228#p33228 <![CDATA[Re: I need different redirections after login?]]> If you create a new template for the profile page instead of the default to build that with you can make use of the many S2 contstants and shortcodes in the HTML view of that page as well as full php code embedded in the template to create user specific links to send them where they need to go.

You could sell this as a feature by making it their dashboard both for account maintenance and access to the rest of their specific area.


DP

Statistics: Posted by man-O-media — August 29th, 2011, 8:44 am


]]>
2011-08-29T04:06:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14748&p=33223#p33223 <![CDATA[I need different redirections after login?]]>
In the moment I am testing s2member. Generally It works fine - unfortunately it is not realy easy for a Newbie to getting it work because there are so many features ;-)

And: in the past I tested many Membership plugins with paypal integration: s2member is the only one "free of charge" plugin that works. Thanks to the developer!

The story to my problem:

I have two kinds of users: pay user and customers. The main difference is:

    Pay user: they have to pay to see some content. I have two levels: "Basic" and "Expert". After the login the user is redirected to a special site - for every level I created a dedicated landing site. I solved this by using the s2member variables: f.e: http://www.mydomain.com/member/level-site-%%level%%. Where the %%level%% is the number from s2member (1,2,3,4) - a great feature.
.
    Customer: They bring me the content. After a customer logged in he gets his personal site and NOT (!!) the redirected landing site from s2member. f.e. the customer "hugo" has his own site with the url: http://www.mydoamin.com/customer/hugo. In the past I solved this with the Plugin "Peter's Redirect" - a very cool solution.


My problem:

After activation from s2member, this plugin overrides the rules from "Peter's Redirect" and all the redirections for my customer (defined by Peter's Redirect) doesn't work anymore - grrrrrr.

My question:

Does anybody know a solution to use "individual" redirections despite using s2member?

Thank you in advance for your answers.

Statistics: Posted by Berny-T — August 29th, 2011, 4:06 am


]]>