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.

David Welch


My Latest Replies (From Various Topics)

Viewing 25 replies - 226 through 250 (of 407 total)
Author Replies
Author Replies
Posted: Friday Apr 6th, 2012 at 2:02 pm #10249
David Welch
Username: dwbiz05

Well, I don’t use Authorize.net so I can’t say if there is any way to do this natively or if S2member is enough without CIM. I just don’t know that much about it.

However, you mentioned hacking s2member. I am assuming you mean changing the actual code of the plugin to fit your needs. The link below lists a set of “hooks” that you can use to add functionality to the s2member plugin without compromising the original code:

http://www.s2member.com/codex/stable/s2member/authnet/package-filters/

If you already knew that, I apologize, but I just wanted to make sure you knew that was possible if you end up needing to make this integration manually to appease the client. :)

Hope that helps,

Dave

Posted: Friday Apr 6th, 2012 at 1:55 pm #10248
David Welch
Username: dwbiz05

LOL, I appreciate the thought, but (based on your url) I’m happily married with 3 kids so I won’t need it!

Anyway, this is a great community so feel free to ask any other questions. If I can’t, I’m sure someone else will be able to help.

Dave

Posted: Friday Apr 6th, 2012 at 9:07 am #10234
David Welch
Username: dwbiz05

In the first section of the user profile you will see “User Role.” This lists the standard Worpress roles as well as the s2member levels. Just select the appropriate s2member level on that list.

If you are using Custom Capabilities as an added layer of restrictions, then you can add those (coma deliniated) in the section you mentioned already under “Custom Capabilities.”

I don’t use Buddypress so I’m not familiare with how it interacts with wp and s2member. Hopefully if there is something else that has to be done with this integration, someone else will fill in the details.

Hope that helps,
Dave

Posted: Thursday Apr 5th, 2012 at 6:20 pm #10204
David Welch
Username: dwbiz05

I’m not sure what you are talking about. Can you direct me to the instructions where you are seeing this?

Dave

Posted: Thursday Apr 5th, 2012 at 6:16 pm #10202
David Welch
Username: dwbiz05

check out the s2member -> api/scripting -> php/api constants.

You can get most if not all of your user details through pre-defined tags like:

[s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]
S2MEMBER_CURRENT_USER_FIRST_NAME
S2MEMBER_CURRENT_USER_LAST_NAME
S2MEMBER_CURRENT_USER_ID
S2MEMBER_CURRENT_USER_LOGIN
S2MEMBER_CURRENT_USER_EMAIL

etc.

Not sure how you need to use it but there you go. You can also access the constants via php like so:

<?php
echo S2MEMBER_CURRENT_USER_EMAIL; 
?>

Hope that helps,
Dave

EDIT: This also works with custom registration fields I believe.

  • This reply was modified 4 years, 9 months ago by  David Welch.
Posted: Thursday Apr 5th, 2012 at 10:26 am #10148
David Welch
Username: dwbiz05

Are you looking for “S2MEMBER_CURRENT_USER_LOGIN”?

Dave

Posted: Wednesday Apr 4th, 2012 at 9:16 pm #10112
David Welch
Username: dwbiz05

I know there have been some other htaccess file issues with some other hosts. What version of apache are they running?

Dave

Posted: Wednesday Apr 4th, 2012 at 4:29 pm #10089
David Welch
Username: dwbiz05

Uwe,

I’m not sure I understand your set-up. WordPress will default to whatever url is stored in your database. So if the url for your site has changed, you will need to change that in the database as well.

What are the two urls?

Dave

Posted: Wednesday Apr 4th, 2012 at 4:27 pm #10087
David Welch
Username: dwbiz05

Pamela,

Do the users have the correct Custom Capabilities attached to them for Level 2 access or just Level 2 access?

That’s the first thing I would check.

Dave

Posted: Wednesday Apr 4th, 2012 at 4:24 pm #10086
David Welch
Username: dwbiz05

Yes, s2member hooks into the standard user processes such as creating or editing user information as well as page, posts, etc. So you can add members and change their user levels, ect. at any time manually.

Hope that helps,
Dave

Posted: Wednesday Apr 4th, 2012 at 9:07 am #10034
David Welch
Username: dwbiz05

Yep, it looks like it’s working the way you want. I don’t see any issues. Congrats! :)

Dave

Posted: Wednesday Apr 4th, 2012 at 9:06 am #10033
David Welch
Username: dwbiz05

This is the second request I’ve seen like this recently. I’m not at liberty to give that info out about my clients without their permission.

Though, I am curious as to what you expect to see by just having a list of websites. I doubt anyone would give you admin access. Could you enlighten me on how knowing that a site uses s2member would help you?

Thanks!

Dave

Posted: Tuesday Apr 3rd, 2012 at 9:16 pm #10013
David Welch
Username: dwbiz05

Hmm well, it’s recording that it’s trying to redirect to the registration page so it does know what it’s supposed to be doing. I honestly don’t know what could be causing it unless you have some hack or something messing with the paypal_return.

Do you have any s2member hacks or other plugins that are synced with your paypal processing?

If you want to send me an email, I could take a look at your back end setup (if you want) and see if I notice anything off or incorrect. Click my name for my contact email.

For some reason it looks like there is a disconnect from the time it knows to redirect and the “unlocking” of the registration form for that new user.

Dave

Posted: Tuesday Apr 3rd, 2012 at 9:06 pm #10010
David Welch
Username: dwbiz05

your commented code (/* */) needs to be inside your php tags like this:

<?php
/*****
Your comments here

**********/
?>

That’s why it’s printing out header errors (I believe).

Click on my name and you should see my contact email if you need anything that you don’t want to post here.
I try to help people here learn to do things on their own, but I’m willing to take on the odd project here and there if some one really needs it.

Anyway, if you change the location of your commented info you should be good to go with nothing printing out.

Dave

Posted: Tuesday Apr 3rd, 2012 at 6:37 pm #9997
David Welch
Username: dwbiz05

LOL, I don’t have a website right now. I program for a living so my clients are the ones that have the websites with s2member.

OK, I see 2 basic issues with your set-up:

1. You’re “membership options” or “sale” page is not on the same domain/wordpress install.
2. You are wanting to redirect to the login page if a non-logged in user tries to access a protected page.

You have your pages protected correctly and it’s redirecting correctly the way s2member was designed. However, if we want to change the redirection to not go to a wordpress “page” like the membership options page, then we need to do a little hacking…

So.. no it’s not basic. :)

You can add the following code to your theme’s functions.php file or to a new file (if it’s not already there) in your wp-content/mu-plugins/s2hacks.php file (you may need to create the directory “mu-plugins” too).

This is the hack:

<?php
function dw_redirect($vars = array()){
	wp_redirect(site_url('/wp-login.php')); //This redirects to the login page.
	exit();
}

add_action("ws_plugin__s2member_before_wp_redirect_w_mop_vars","dw_redirect"); //Adds the function to the hook.
add_action("ws_plugin__s2member_before_wp_redirect_wo_mop_vars","dw_redirect"); //Adds the function to the hook.
?>

This hack will make it so when a user clicks on a protected page, if they are not logged in, they will be redirected to the login screen. Your Membership Options Page setting should then become irrelevant.

Hope that helps,

Dave

Posted: Tuesday Apr 3rd, 2012 at 6:02 pm #9988
David Welch
Username: dwbiz05

yes, if you can. You might edit your post to remove your friends email address too, since this is a public forum. :)

Dave

Posted: Tuesday Apr 3rd, 2012 at 5:51 pm #9986
David Welch
Username: dwbiz05

Don’t worry, no matter how smart you are sometimes it just takes a different way of explaining it.

I’ll try to explain how it *should* work here:

1. Membership Options Page: This page is where you would put your buttons and/or text that tells the user to buy your product or subscription. It is not protected by s2member because you need people to be able to click on it. If a user tries to access a protected page they don’t have access to, they will be re-directed to this membership options page. So, if you already have another page that explains or provides sale buttons, etc. then I would just choose that pre-exsiting page as your membership options page.

2. Login Welcome: This is the page where the user is redirected to after logging in. As you see, it is already protected by s2member. Typically you would use this to show the user either current news or maybe their profile info or even just what they purchased if you only need one actual membership page. Think of it as a “members home page”. So if you only need one page, then you should probably just copy your content to this Login Welcome page as that is where the user will be re-directed after login.

3. If you are creating users manually, go to s2member -> general options -> open registration and set it to “NO”. That way no-one will be able to access the http://yoursite.com/wp-login.php?action=register link. Then you will just create each user manually under the WordPress “users” section.

4. In order for the user to login, the easiest thing would be to add a link on your homepage or menu or wherever that goes to this url: http://yourwordpressinstall.com/wp-login.php. That is the general wordpress/s2member login page.

So simple procedure: user clicks the link to wp-login.php and is presented a login form. They log in and are directed to your login welcome page where all your content is posted for logged-in members.

Hope that helps,
Dave

Posted: Tuesday Apr 3rd, 2012 at 5:34 pm #9980
David Welch
Username: dwbiz05

No that’s where they should be. You may not have it turned on… Check this setting:
S2member -> Paypal Options -> Paypal Account Settings -> Enable Logging Routines? — see if it’s set to yes. If it’s no then that’s why there are no logs.

Dave

Posted: Tuesday Apr 3rd, 2012 at 5:31 pm #9978
David Welch
Username: dwbiz05

ah, so you want to ADD the approval process. S2member doesn’t have an approval process at the moment. However, I think some other members have has success using a third “approval” plugin. Though I’m not sure which one is best. Hopefully someone who has done it will chime in.

Sorry for the confusion. :)

Dave

Posted: Tuesday Apr 3rd, 2012 at 5:24 pm #9969
David Welch
Username: dwbiz05

I don’t know of a native s2member function for this, but you could create your own shortcode filter by putting something like this in your functions.php file or your s2hacks.php file (if you have one in the mu-plugins directory).

The main issue is that the capabilities are all stored in the same wp_capabilities serialized array in the database. So you have to filter through that some how. To me, the easiest is to just pull the user meta and parse through it like so:

<?php
function any_cap_check($atts, $content){	
	$cc = get_user_meta(S2MEMBER_CURRENT_USER_ID, 'wp_capabilities',true); // Gets the user's role
	if($cc != false){ //False means the user isn't logged in or it can't pull the capabilities.
		foreach($cc as $k => $v){
			if($k == 'administrator'){	//renders for admins
				return do_shortcode($content);
				break;
			}
			else if(strstr($k,'access_s2member_ccap')){ //Renders if the user has ANY custom capabilities with s2member.
				return do_shortcode($content);
				break;
			}
		}
	}
}

add_shortcode('check-any-cap','any_cap_check'); //Creates the shortcode function.
?>

You could call it then with the shortcode in your post or page like so:

[check-any-cap]
Your content here.
[/check-any-cap]

Hope that helps,

Dave

EDIT: you can manipulate that code and create a second one or do some different filtering by passing variables to choose if you want any or no capabilities to show, but that is the basic way to create a shortcode for what you want.

  • This reply was modified 4 years, 9 months ago by  David Welch.
  • This reply was modified 4 years, 9 months ago by  David Welch.
Posted: Tuesday Apr 3rd, 2012 at 4:40 pm #9953
David Welch
Username: dwbiz05

Sent you an e-mail.

Dave

Posted: Tuesday Apr 3rd, 2012 at 4:39 pm #9952
David Welch
Username: dwbiz05

Are you talking about the API / Notifications?

If so, the registration notification option has this listed below it:

You can also use these special Replacement Codes if you need them:
%%role%% = The Role ID ( subscriber, s2member_level[0-9]+, administrator, editor, author, contributor ).
%%level%% = The Level number ( 0, 1, 2, 3, 4 ). ( deprecated, no longer recommended; use %%role%% )
%%ccaps%% = Custom Capabilities. Ex: music,videos,free_gift ( in comma-delimited format ).
%%auto_eot_time%% = Auto-EOT Time ( if applicable ). Ex: 1299925670 ( unix timestamp ).
%%user_first_name%% = The First Name of the Member who registered their Username.
%%user_last_name%% = The Last Name of the Member who registered their Username.
%%user_full_name%% = The Full Name ( First & Last ) of the Member who registered their Username.
%%user_email%% = The Email Address of the Member who registered their Username.
%%user_login%% = The Username the Member selected during registration.
%%user_pass%% = The Password selected or generated during registration.
%%user_ip%% = The User’s IP Address, detected via $_SERVER[“REMOTE_ADDR”].
%%user_id%% = A unique WordPress® User ID generated during registration.
Custom Registration/Profile Fields are also supported in this Notification:
%%date_of_birth%% would be valid; if you have a Custom Registration/Profile Field with the ID date_of_birth.
%%street_address%% would be valid; if you have a Custom Registration/Profile Field with the ID street_address.
%%country%% would be valid; if you have a Custom Registration/Profile Field with the ID country.
%%etc, etc…%% see: s2Member -> General Options -> Registration/Profile Fields.
Custom Replacement Codes can also be inserted using these instructions:
%%cv0%% = The domain of your site, which is passed through the `custom` attribute in your Shortcode.
%%cv1%% = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: custom=”.com|cv1|cv2|cv3″. You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.
This example uses cv1 to record a special marketing campaign:

Hope that helps,

Dave

  • This reply was modified 4 years, 9 months ago by  David Welch.
Posted: Tuesday Apr 3rd, 2012 at 4:36 pm #9945
David Welch
Username: dwbiz05

Not exactly sure what you’re trying to do here, however, you can always add or edit users in the admin area of wordpress. You don’t need a registration link for that. Just go to “Users” section.

If that’s not what you’re talking about could you try to re-explain the process you are using? :)

Dave

Posted: Tuesday Apr 3rd, 2012 at 4:30 pm #9943
David Welch
Username: dwbiz05

I assume you are just showing files in a sub-domain and not a full blown application on the sub-domain. If so, then you can use the “download restriction” link options to ensure that members can access the files.

In order to do that, your sub-domain would need to be inside the s2member-files folder in the plugin directory of wordpress. This is the main folder protected by s2members.

If you are using an application, you would need to go a little further by including the wordpress base as shown in this article:
http://www.s2member.com/kb/protecting-non-wordpress-content-with-s2member/

Hope that helps,
Dave

Posted: Tuesday Apr 3rd, 2012 at 4:25 pm #9936
David Welch
Username: dwbiz05

I’ve never noticed this issue before, but that doesn’t mean it’s not an issue. Can you post your s2member-logs files or at least the one relating to your friends sign-up?

Dave

Viewing 25 replies - 226 through 250 (of 407 total)

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.