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.

redirect on login to different groups pages

Home Forums Community Forum redirect on login to different groups pages

This topic contains 6 replies, has 2 voices. Last updated by  Montaya 3 years, 2 months ago.

Topic Author Topic
Posted: Monday Nov 4th, 2013 at 3:21 pm #60857
Montaya
Username: montaya

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Tuesday Nov 5th, 2013 at 5:31 pm #60886
cassel
Username: cassel

I am not 100% sure of this solution but if there was a way for you to have the specific groups as ccaps (custom capabilities) then you could use a conditional to redirect.

I am using a redirect like that based on the ccap (called “element” in my case):

<?php if (current_user_can('access_s2member_ccap_element') && !current_user_can('administrator')){ ?><script type="text/javascript">window.location = 'http://link-to-the-other-page/';</script><?php } else {?><?php } ?>

In order to get the ccap, can you direct the viewer to either different pages for the registration based on their choice, or use different buttons? Would that work for you?

Posted: Tuesday Nov 5th, 2013 at 6:31 pm #60888
Montaya
Username: montaya

Thanks Cassel I will try that. Two questions if I may.
1. Where do I place that php code?
2. Can I place a bit of code that says to look at what group the person who is doing the log-in, has selected (when registering) and redirect him/her to a page that particular group has?
A bit like when you insert the code that recognizes the person name , only this time it recognizes the group and redirects the person to the group’s home/selected page.

Thanks again
Montaya

Posted: Tuesday Nov 5th, 2013 at 6:39 pm #60889
cassel
Username: cassel

1- You would put that code on the top of the page.

2- I don’t know about that. Since a lot of information can be retrieved, maybe it is possible, but I am not a programmer, and this is not my ‘expertise’. Since I have never done it, I can’t answer. I am not sure how you can retrieve the group info. Maybe someone with more coding knowledge can answer that part.

Posted: Tuesday Nov 5th, 2013 at 6:43 pm #60890
Montaya
Username: montaya

Top Of which page?
Thanks
Montaya

Posted: Tuesday Nov 5th, 2013 at 7:18 pm #60891
cassel
Username: cassel

When you create a page in wp, you can incorporate this code in the TEXT editor version of the page.
So if you have a central landing page, you can have this code on top of the page (in the text editor, not the visual editor) so if visitor A has the ccap for the page A+, you would redirect to that page. And then you can also add another code for visitor B who might have ccap for the page B+, so they would be redirected there.

Since the redirect requires your visitor to be logged in to be able to recognize their particular ccaps, you can just have some general text if the person is not logged in like “you need to be logged in to be able to access the page you might be looking for your group” (or something like that).

Posted: Tuesday Nov 5th, 2013 at 7:25 pm #60892
Montaya
Username: montaya

Thanks Cassel
Had just put it in and got partially working. Will keep working on the groups thing—your help has pushed me forward past another obsticle.
Thanks again
Montaya

Viewing 6 replies - 1 through 6 (of 6 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.