latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

welcome page

Home Forums Community Forum welcome page

Tagged: 

This topic contains 36 replies, has 5 voices. Last updated by  Raam Dev 4 years, 3 months ago.

Topic Author Topic
Posted: Monday Aug 27th, 2012 at 4:46 pm #23196
Hillcliff
Username: hillcliff

Hi, I’d like to direct to two separate welcome pages dependent on the membership level. I’m not very techy so cane you let me know how I’d do this as there’s only one option is the General Options area.

I’d like levels 1 and 2 to be directed to one page and levels 3-7 to another.

List Of Topic Replies

Viewing 25 replies - 1 through 25 (of 36 total)
Author Replies
Author Replies
Posted: Monday Aug 27th, 2012 at 6:44 pm #23207
Eduan
Username: Eduan
Moderator

Hello Claudine,

You can achieve this with only one login welcome page, you would just use s2Member conditionals, which allow you to separate the content depending on the user’s access, check this article for more info:
Knowledge Base » s2Member® Conditionals

Hope this helps. :)

Posted: Tuesday Aug 28th, 2012 at 5:31 am #23246
Hillcliff
Username: hillcliff

So I’m going to have to add another page to the user journey? Bit disappointing.

Posted: Tuesday Aug 28th, 2012 at 8:14 am #23273

Oh, no, the user would just get the page he’s meant to get. What Eduán pointed you to is conditionals, which you can use to check what level the user has and, based on that, show the correct Login Welcome for him. Please read this documentation: [hilite path]Dashboard -› s2Member® -› API / Scripting -› Simple/Shortcode Conditionals[/hilite]

I hope that helps. :)

Posted: Monday Sep 10th, 2012 at 10:52 am #24752
Hillcliff
Username: hillcliff

Hi

Obviously not being very smart here but I’m still confused. Tried using short codes but I’m obvioulsy doing it wrong.

I need level 1 users to be directed to http://hillcliff.com/nutrition-welcome
and level 2 to /virtual-pt-welcome

What would I put into the redirect box for this? Would the top drop down stay at -select-?

Thanks

Posted: Monday Sep 10th, 2012 at 11:02 am #24753
Eduan
Username: Eduan
Moderator

Hello Claudine,

Well, s2Member conditionals are not really meant to be used to redirect, they are just meant to separate content. So the page would remain the same, title and everything, just the content would change.

Hope this helps understand what’s going on. :)

Posted: Monday Sep 10th, 2012 at 12:12 pm #24756
Hillcliff
Username: hillcliff

Not really Eduan, no.

In General Options under membership log in page it says

↓ Or, you may configure a Special Redirection URL, if you prefer. You’ll need to type in the full URL, starting with: http://. A few Replacement Codes are also supported here.

I just need to know what to put in here to solve my issue.

Thanks

Posted: Monday Sep 10th, 2012 at 12:38 pm #24758
Eduan
Username: Eduan
Moderator

Hello Hill,

That is just if you want to use a non-WordPress page as the login welcome page. So it still remains a login welcome page, but it won’t be protected by s2Member if you use that option.

If you want to redirect the user to several different pages depending on the user, then one work-around is to setup a login welcome page normally in those options. So you would create a page called “Login welcome page”.

And inside that page you put the following code (you will need the PHP Execution plugin installed):

<?php if(current_user_is('s2member_level1')) { ?>
	<script type="text/javascript">
		window.location = "http://hillcliff.com/nutrition-welcome";
	</script>
<?php } elseif(current_user_is('s2member_level2')) { ?>
	<script type="text/javascript">
		window.location = "http://hillcliff.com/virtual-pt-welcome";
	</script>
<?php } ?>

This should work correctly (did my tests). Just remember to have the PHP Execution plugin installed.

Hope this helps. :)

  • This reply was modified 4 years, 3 months ago by  Eduan. Reason: Thanks Cristián, I fixed that :)
Posted: Tuesday Sep 11th, 2012 at 7:24 am #24868

Haven’t actually tried this yet, but it should work.

Actually, [hilite mono]'access_s2member_level1'[/hilite] is a capability, the role is [hilite mono]'s2member_level1'[/hilite]. [hilite path]Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals[/hilite]

And if you’re using that code in the page’s body, then it’s too late to use [hilite mono]header()[/hilite], you’ll need to use a JavaScript redirection there.

Posted: Tuesday Sep 11th, 2012 at 8:50 am #24883
Eduan
Username: Eduan
Moderator

Thanks for pointing that out Cristián, I fixed it. :)

Posted: Tuesday Sep 11th, 2012 at 1:04 pm #24911
Hillcliff
Username: hillcliff

Thanks guys. It sent a level 2 member to the nutrition page so unsure where the problem is. Checked everything and now it’s just sending everyone to the membership sign up page.
Very odd.

Posted: Tuesday Sep 11th, 2012 at 1:16 pm #24912
Eduan
Username: Eduan
Moderator

That’s strange, I double checked it and tested it and it works perfectly. :|

Posted: Tuesday Sep 11th, 2012 at 1:40 pm #24913
Eduan
Username: Eduan
Moderator

So what happens if you try getting into the login welcome page (it’s where you would put this code) as a level 1 user? A level 2 user? This won’t work on admins or any other levels.

Make sure that the URLs point to the correct URLs where you want to send the users, the first URL will be for level 1 users and the second will be for level 2 users.

– Eduan

Posted: Friday Sep 21st, 2012 at 10:40 am #26054
Hillcliff
Username: hillcliff

Hi Eduan,

Thanks for your help on this. It just reverts to the membership sign up page rather than the individual welcome pages.

Posted: Friday Sep 21st, 2012 at 11:56 am #26058
Hillcliff
Username: hillcliff

It may not be your code that’s wrong – I’m sure it isn’t) as once my users get past the log in page they all get directed to the membership sign up page and I have no idea how to rectify this. Any help would be hugely appreciated as it’s obviously a huge problem.

Posted: Friday Sep 21st, 2012 at 12:03 pm #26060
Eduan
Username: Eduan
Moderator

That’s very strange, have you tried logging in as level 1 and 2 users and see what happens?

Posted: Friday Sep 21st, 2012 at 12:04 pm #26061
Hillcliff
Username: hillcliff

Yes and every time it sends me to the membership sign up page instead of the correct welcome page

Posted: Friday Sep 21st, 2012 at 1:08 pm #26065
Hillcliff
Username: hillcliff

Maybe the custom capabilities are wrong – does this look ok?

s2if_current_user_canaccess_s2member_level2_____some_content_for_members_who_are_logged_in_with_an_s2member_level__2_s2if

s2if_current_user_canaccess_s2member_level1_____some_content_for_members_who_are_logged_in_with_an_s2member_level__1_s2if

Thanks

Posted: Friday Sep 21st, 2012 at 2:27 pm #26069
Eduan
Username: Eduan
Moderator

Could you try the following instead? Just something I want to make sure of:

<?php if(current_user_is('s2member_level2')) { ?>
	<script type="text/javascript">
		window.location = "http://hillcliff.com/virtual-pt-welcome";
	</script>
<?php } elseif(current_user_is('s2member_level1')) { ?>
	<script type="text/javascript">
		window.location = "http://hillcliff.com/nutrition-welcome";
	</script>
<?php } ?>
Posted: Friday Sep 21st, 2012 at 3:41 pm #26075
Hillcliff
Username: hillcliff

Just a black template page with this code I’m afraid.
Think it could be to do with the ccaps too as they all revert to member sign up page. Frustrating!

Posted: Friday Sep 21st, 2012 at 3:42 pm #26076
Hillcliff
Username: hillcliff

Sorry – ‘blank’

Posted: Friday Sep 21st, 2012 at 4:57 pm #26081
Eduan
Username: Eduan
Moderator

I don’t know what the problem could be then… Have you tried doing a plugin/theme compatibility test?

Posted: Friday Sep 21st, 2012 at 5:01 pm #26082
Hillcliff
Username: hillcliff

I’ve got a rather unsatisfactory work around for the welcome page in place (2 links that user chooses from) but my members can’t get past log-in as they keep getting directed back to membership sign up once they’ve selected their link. I’m just using a version of TwentyTen. Shouldn’t be an issue with that and all the rules work with the standard restrictions. Just doesn’t seem to like the above ccaps. Do they look OK?

Posted: Monday Sep 24th, 2012 at 6:48 am #26277
Raam Dev
Username: Raam
Staff Member

Could you copy/paste the full URL they are incorrectly redirected to on the Membership Options Page? That URL will contain details about why they were redirected and if you share that here we can explain where the problem lies.

Posted: Monday Sep 24th, 2012 at 11:51 am #26319
Hillcliff
Username: hillcliff
Posted: Tuesday Sep 25th, 2012 at 12:24 am #26388
Raam Dev
Username: Raam
Staff Member

It looks like you have a weird Custom Capability restriction on that page. The following part of that URL is supposed to say which Custom Capability is required, but instead it’s showing what looks like a shortcode conditional:

s2member_ccap_req=s2if_current_user_canaccess_s2member_level2_____some_content_for_members_who_are_logged_in_with_an_s2member_level__2_s2if

Do you have anything in the Custom Capability restriction box for that page?

Viewing 25 replies - 1 through 25 (of 36 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.