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.

Client Portal issue

Home Forums Community Forum Client Portal issue

This topic contains 2 replies, has 2 voices. Last updated by  Jason Walker 4 years, 10 months ago.

Topic Author Topic
Posted: Thursday Feb 23rd, 2012 at 8:24 pm #6226

So, I’m new to s2Member and am developing a client portal where clients can login to to obtain information specific to them (their own page). I followed the client portal tutorial that was posted on the older forum at: http://www.primothemes.com/forums/viewtopic.php?f=36&t=586

I got this working to where the client logs in and it will send them to their page and it is only accessible to that user. That part works great. However, I would really like to place a link in my menu bar that would send the user that is logged in straight to their page in case they navigate away from it, or if they have yet to login. If the user is not logged in, it would give them a message telling them to login and maybe present them with a login form.

Basically, this link on the menu bar would, if logged in, send the user to http://www.mysite.com/logged-in-username-here, and if not logged in send the user to http://www.mysite.com/client-portal (a page I would create) or just send the user to the s2Member login page.

Is there an easy way to do this?

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Friday Feb 24th, 2012 at 10:01 am #6256
David Welch
Username: dwbiz05

My suggestion would be to create a quick php page that re-directs to the current logged in user\’s portal page and add a custom link to your menu that points to that page…

This way the php page should handle getting the user\’s username or id or whatever you are using as the \”identifier.\”

Somthing like \”portal_redir.php\” with something like this:

<?php
if( is_user_logged_in() ){
	wp_redirect(site_url('/'.S2MEMBER_CURRENT_USER_LOGIN.'/'));
}
else {
	//redirect to your membership options page.
	wp_redirect(site_url('your-member-option-page'));
}
?>

Then in Apperance -> Menus -> Custom Links you would add http://yoursite.com/wp-content/themes/yourtheme/portal_redir.php or something like that.

Hope that helps,

Dave

  • This reply was modified 4 years, 10 months ago by  David Welch.
Posted: Friday Feb 24th, 2012 at 10:51 am #6271

David, thanks for the reply! I actually spent a ton of time last night googling and figuring out the code I needed to do this and got it working (i\’m not at all versed in php), but a little differently than your solution (and probably a little more complicated). I made a custom page template for the client portal page and added the if statement similar to above at the top of the template where if the user is logged in, it redirects to the user\’s page, if it\’s not logged in, it does nothing, so it just loads the client portal page with a short message and a login form. I may try your suggestion since it looks like it would be a little more practical than what I did.

Thanks!

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