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.

Non-Paid Member Site Questions

Home Forums Community Forum Non-Paid Member Site Questions

This topic contains 5 replies, has 2 voices. Last updated by  Bruce 3 years, 8 months ago.

Topic Author Topic
Posted: Monday Apr 29th, 2013 at 6:49 am #48648
Embry Webb
Username: EmbryWebb

I am a new subscriber and have a few questions to get me started down the right path. My site is for a Real Estate Brokerage. I want to manually enter in my agents and all will have a level 0. Each agent will need a page that has there information on it, that is custom for them. There are no paid subscriptions to this site….

Here are my questions:

1. When someone goes to http://agentdomain.com, I want them to be shown a login page and NOT have access to any of the page content. What is the best way to set this up?

2. After they are logged with level 0 they will have pages that are custom for them using the %%current_user_login%% replacement codes. So basically I will build a custom page for each agent, with tools that access their information. Is there an api that will allow me to pass hooks to my tools from the agents custom page?

3. When the agent updates their profile is there an api I can use on another website (my real estate company site) that will get the agents profile from http://agentdomain.com so I can post it on http://realestatebroker.com site?

Any help or responses will be greatly appreciated and any other suggestion you have for a newbie?

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Monday Apr 29th, 2013 at 9:18 am #48652
Embry Webb
Username: EmbryWebb

Also I would like to set http://agentdomain.com/%%current_user_login%%/ as the home page after login, but how do I do this in WordPress?

Posted: Tuesday Apr 30th, 2013 at 9:01 am #48794
Embry Webb
Username: EmbryWebb

As I said before any help on this would be nice. Even if you pointed in the right direction for answers. I have looked threw the knowledgebase, but could not find these answers????

Posted: Tuesday Apr 30th, 2013 at 7:49 pm #48831
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

We appreciate your patience.

1. When someone goes to http://agentdomain.com, I want them to be shown a login page and NOT have access to any of the page content. What is the best way to set this up?

The easiest way to do this would be put the URI restriction “/” in the first box here to restrict access to your site (except the Membership Options Page) to Users that are not logged in:

Dashboard -› s2Member® -› Restriction Options -› URI Access Restrictions


For your homepage, s2Member does not have any way to protect this, and it’s normally not required. The only way you could do this is using s2Member’s Advanced PHP Conditionals. You can create a Must-Use Plugin file and put this code in it:

<?php
add_action('init', 's2hack_protect_homepage');
function s2hack_protect_homepage() {
	if(is_home() && !is_user_logged_in()) { // If the User isn't logged in on the home page...
		wp_redirect(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL); // ... redirect to the Membership Options Page
		exit();
	}
}
&#91;/hilite&#93;

<blockquote>
2. After they are logged with level 0 they will have pages that are custom for them using the %%current_user_login%% replacement codes. So basically I will build a custom page for each agent, with tools that access their information. Is there an api that will allow me to pass hooks to my tools from the agents custom page?
</blockquote>

I'm not sure what you mean by "pass hooks" here. Could you clarify what exactly you're looking or?

s2Member does allow some replacement codes to pass to a custom Login Welcome Page URL, which you can use with some PHP on the WordPress Page is redirects to. You'll need a PHP Execution Plugin.

See: <a href="http://www.s2member.com/kb/ezphp-plugin/">Knowledge Base » ezPHP Plugin for WordPress®</a>
See Also: Dashboard -› s2Member® -› General Options -› Login Welcome Page

3. When the agent updates their profile is there an api I can use on another website (my real estate company site) that will get the agents profile from http://agentdomain.com so I can post it on http://realestatebroker.com site?

No, s2Member doesn’t have anything like this, really. You could try something with s2Member’s API Notifications and Remote Operations, but this won’t update when a User modifies their profile.

See: Knowledge Base » Building An API Notification Handler
See Also: Dashboard -› s2Member® -› API / Scripting -› Remote Operations API

Also I would like to set http://agentdomain.com/%%current_user_login%%/ as the home page after login, but how do I do this in WordPress?

You could use a hack similar to the one I posted for your first question. WordPress doesn’t have any functionality like this.

Posted: Tuesday Apr 30th, 2013 at 8:04 pm #48835
Embry Webb
Username: EmbryWebb

Thanks for taking the time to respond. I see how it works now.

Anyway as far as hooks, I meant that if I write something in PHP can I pass the logged in use from S2 login to my PHP script?

Posted: Tuesday Apr 30th, 2013 at 8:08 pm #48836
Bruce
Username: Bruce
Staff Member

Anyway as far as hooks, I meant that if I write something in PHP can I pass the logged in use from S2 login to my PHP script?

Yes you can use PHP GET variables and pass the information you want to your script like this:

http://example.com?user_login=%%current_user_login%%/

Then you could get the variable like this:

<?php $user_login = $_GET['user_login']; ?>

See: http://php.net/manual/en/reserved.variables.get.php

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