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.

About: David Welch

WHO DARED TO GIVE ME A THUMBS DOWN!!... LOL just kidding!

I don't work for s2member.com and I certainly don't know everything, but what I do know I'll try to share.

If you need private help with an issue, please contact me via email: dwelch@itelves.com

I'm a freelance developer so depending on the amount of work I have at the moment, I may or may not be able to respond quickly to posts and/or emails. I will always try to do so, but please understand if I don't make it back in your timeframe. ;)


Topics I'm Subscribed To

Viewing 25 topics - 1 through 25 (of 253 total)
Topic Count Last Reply
Content Dripping by Specific Date

By:  Zak in: Community Forum

voices: 3
replies: 4

3 years ago  cassel

Only Interested in One Membership Level

By:  Meg Montgomery in: Community Forum

voices: 2
replies: 5

3 years ago  David Welch

Login Welcome page / redirection URL

By:  Mike Mazza in: Community Forum

voices: 2
replies: 10

3 years ago  David Welch

getng an error while integratng authorize.net

By:  Preeti Bhandari in: Community Forum

voices: 2
replies: 3

3 years ago  David Welch

Can S2Member do this? (custom profiles)

By:  Garrett Fritz in: Community Forum

voices: 3
replies: 4

3 years ago  David Welch

Protecting/Granting User generated content

By:  george strnad in: Community Forum

voices: 2
replies: 3

3 years ago  David Welch

Run *.php from /plugins/s2member-files/

By:  Kevin in: Community Forum

voices: 2
replies: 2

3 years ago  Kevin

Login Welcome Page / My Account w/ Custom Add

By:  Brian Stoiber in: Community Forum

voices: 2
replies: 1

3 years ago  David Welch

Credit card payments without paypal business

By:  Patryk Wezowski in: Community Forum

voices: 2
replies: 1

3 years ago  David Welch

Add custom fields for Premium level(Paid).

By:  pankaj robust in: Community Forum

voices: 3
replies: 4

3 years ago  cassel

Custom payment gateway – GMBill (help needed)

By:  Domagoj Polović in: Community Forum

voices: 2
replies: 2

3 years ago  Domagoj Polović

ERROR: Unable to verify $_SERVER["HTTP_HOST"]

By:  Richard MARPLES in: Community Forum

voices: 2
replies: 2

3 years ago  Richard MARPLES

Restriction to file downloads by Username

By:  Narek Ambar in: Community Forum

voices: 3
replies: 17

3 years ago  Narek Ambar

Restricted Page isn't protected from widget

By:  Yuka in: Community Forum

voices: 2
replies: 2

3 years ago  Yuka

Member-specific restriction options

By:  Dean DeLisle in: Community Forum

voices: 2
replies: 5

3 years ago  David Welch

Changing text in Pro login widget

By:  Andrew Lock in: Community Forum

voices: 2
replies: 1

3 years ago  David Welch

Getting rid of membership levels??

By:  Nigel Percy in: Community Forum

voices: 5
replies: 10

3 years, 4 months ago  Greg B

skip login welcome & membership options pages

By:  Gary Cribb in: Community Forum

voices: 3
replies: 5

3 years, 6 months ago  mohi khanna

Authorize.Net CIM integration is it possible?

By:  Steve Hanson in: Community Forum

voices: 3
replies: 3

3 years, 6 months ago  David Hobson

Import fails if no email address

By:  Jon Brehaut in: Community Forum

voices: 4
replies: 3

3 years, 6 months ago  bigdata

Discount Coupon for s2member

By:  Matias Scalres in: Community Forum

voices: 5
replies: 5

3 years, 7 months ago  cassel

Register Defaults fields

By:  Jason King in: Community Forum

voices: 4
replies: 6

3 years, 7 months ago  yu fu

Manually adding new user setting Member Level

By:  Dennis Ng in: Community Forum

voices: 3
replies: 7

3 years, 7 months ago  servantes

Content Resitrction on whole directory

By:  Jesse Hardesty in: Community Forum

voices: 4
replies: 4

3 years, 9 months ago  TI Systems

Category Restrictions Not Working

By:  Jill Gelenter in: Community Forum

voices: 3
replies: 2

3 years, 9 months ago  Helen

Viewing 25 topics - 1 through 25 (of 253 total)

My Latest Replies (From Various Topics)

Viewing 25 replies - 1 through 25 (of 407 total)
Author Replies
Author Replies
Posted: Sunday Dec 29th, 2013 at 4:21 pm #62238
David Welch
Username: dwbiz05

Meg,

If you want, I can take a look at it and see if I can find why it’s not working.

info {at} itelves.com

Dave

Posted: Sunday Dec 29th, 2013 at 4:21 pm #62237
David Welch
Username: dwbiz05

Mike, no problem, contact me via email and I can take a look at it. info {at} itelves.com

Dave

Posted: Saturday Dec 28th, 2013 at 6:04 pm #62216
David Welch
Username: dwbiz05

You would need to have some php function to handle this I think.

I would use something like this:

You may need to create this file / directory: wp-content/mu-plugins/s2-hacks.php
Then put the following code in the s2-hacks.php file.

<?php
add_shortcode('dw-datecheck','dw_registration_access');
function dw_registration_access($atts,$content){
	extract(shortcode_atts(array('start' => date('Y:01:01')),$atts)); //set the shortcode attributes
	
	if(S2MEMBER_CURRENT_USER_REGISTRATION_TIME <= strtotime($start)){ //Check the user's time vs the time set in the shortcode.
		return do_shortcode($content); //run the content
	}
}

?>

I just threw this together real fast without testing it, but that’s the basic idea.

Then you would use this around your protected content:

[dw-datecheck start="10/23/2013"]
This is the protected info.. only for users who joined on or before 10/23/2013.
[/dw-datecheck]

Hope that helps,

Dave

Posted: Saturday Dec 28th, 2013 at 4:10 pm #62208
David Welch
Username: dwbiz05

Remove the “exit;” from the code and see if that works. It’s working for me that way.

Dave

Posted: Saturday Dec 28th, 2013 at 12:10 pm #62204
David Welch
Username: dwbiz05

Try changing the code I offered to use custom capabilities instead of member levels… something like this:

<?php
add_action('init','my_login_redirect');
function my_login_redirect(){
	if(isset($_GET['dw_redirect']) && $_GET['dw_redirect'] == 'special'){
		if(current_user_can('access_s2member_ccap_client')){ //replace client with your ccap
			//Redirect Client Portal
			wp_redirect('client_page_'.S2MEMBER_CURRENT_USER_ID); //replace 'client_page_' with page slug
		}
		else if(current_user_can('access_s2member_ccap_premium')){ //replace premium with your ccap
			//Redirect for Premium Users
			wp_redirect('premium_page'); //replace 'premium_page' with page slug
		}
		else {
			//Redirect to standard page for free users
			wp_redirect('standard_page'); //replace 'standard_page' with page slug
		}
	}
	
	exit;
}
?>

Dave

Posted: Saturday Dec 28th, 2013 at 12:05 pm #62203
David Welch
Username: dwbiz05

If it’s loading information into your form, then you are not logged out. You need to be logged out completely to test registration forms. You could also pull up a different browser to test if you want to stay logged in during testing.

Dave

Posted: Saturday Dec 28th, 2013 at 12:04 pm #62202
David Welch
Username: dwbiz05

Maybe I’m just talking to myself in circles but it seems like this is functioning correctly…

If open registration is turned off, then it should give you a message instead of the registration form.
If open registration is on, it allows level 0 (free) members to join.

So, it sounds like it’s doing what it should. Can you explain how you expect / want it to work? It may just be an issue of s2member not working like you thought it would.

You can probably make it work the way you want though, it’s very flexible if you know what you are doing.

Dave

Posted: Saturday Dec 28th, 2013 at 12:01 pm #62201
David Welch
Username: dwbiz05

I think this is the video that’s closest to what you are looking for:

http://www.s2member.com/videos/716DC24E7E347DC2/

Dave

Posted: Saturday Dec 28th, 2013 at 11:59 am #62200
David Welch
Username: dwbiz05

I think there is a video about this somewhere, but here is a link to a brief description:

http://www.s2member.com/kb/customizing-your-lwp/#special-redirection-dynamics

Dave

Posted: Saturday Dec 28th, 2013 at 11:57 am #62199
David Welch
Username: dwbiz05

S2Member has 100’s of “hooks” all throughout their code.

A Hook is basically a function that looks for “extra” code written by other plugins or hack files to run at certain points.

For example:

hook before running process

run process

hook after running process

So, by using the standard wordpress action hook process, you can add / change functionality of other plugins without messing with the source code, but rather by hooking into it where necessary (and allowed).

This will get you started learning about hooks: http://codex.wordpress.org/Plugin_API/Action_Reference
This is where you can find a huge list of available S2member hooks: http://www.s2member.com/codex/stable/overview-summary/#src_doc_overview_description

CCAPs was just an abbreviation of Custom Capabilities.

Dave

Posted: Wednesday Dec 25th, 2013 at 3:53 pm #62131
David Welch
Username: dwbiz05

Are those three access types using the s2member user levels or custom capabilities?

You may need to set up a hook to parse more information about the user and redirect accordingly.

You can do this by creating the following file/directory: wp-content/mu-plugins/s2-hacks.php

<?php
add_action('init','my_login_redirect');
function my_login_redirect(){
	if(isset($_GET['dw_redirect']) && $_GET['dw_redirect'] == 'special'){
		if(current_user_can('access_s2member_level2')){
			//Redirect Client Portal
			wp_redirect('client_page_'.S2MEMBER_CURRENT_USER_ID); //replace 'client_page_' with page slug
		}
		else if(current_user_can('access_s2member_level1')){
			//Redirect for Premium Users
			wp_redirect('premium_page'); //replace 'premium_page' with page slug
		}
		else {
			//Redirect to standard page for free users
			wp_redirect('standard_page'); //replace 'standard_page' with page slug
		}
	}
}
?>

This *should* allow you to specify the redirections.

Set the login url to yoursite.com/?dw_redirect=special

Let me know if that doesn’t work.

Dave

Posted: Tuesday Dec 24th, 2013 at 10:34 am #62123
David Welch
Username: dwbiz05

How are you linking to it / integrating it?

Dave

Posted: Tuesday Dec 24th, 2013 at 10:33 am #62122
David Welch
Username: dwbiz05

Are you talking about the back end account profile form or a page that you’ve created with the s2member profile shortcode.

If you are expecting to go to the back end, check the settings: General Options -> Member Profile Modifications -> Redirect Members away from the Default Profile Panel?

That will allow or dissallow back end profile access.

Hope that helps,

Dave

Posted: Tuesday Dec 24th, 2013 at 10:29 am #62121
David Welch
Username: dwbiz05

Without going into detail about how you have it all set up, I would suggest adding a custom capability that is auto generated when the button is loaded. You may have to create your own button shortcode to add it.

Then, use one of the processing hooks or however you have it set up for downloading and check for the correct ccap.

That’s very general but I hope it points you in the right direction.

Dave

Posted: Tuesday Dec 24th, 2013 at 10:25 am #62120
David Welch
Username: dwbiz05

The only other options would be to use the Pro version so you can use one of the other integrated payment options or have someone build one custom for you. (which will cost more than buying the pro version)

Dave

Posted: Tuesday Dec 24th, 2013 at 10:23 am #62119
David Welch
Username: dwbiz05

Basically, S2member is protecting you from changing your adminstrator to a lesser S2Member account type.

This would prevent you from being able to access your administrative functions. :)

So, either log out when testing or log in as another “lower” user to test.

Hope that helps.

Dave

Posted: Tuesday Dec 24th, 2013 at 10:19 am #62118
David Welch
Username: dwbiz05

Does the paypal button work with the open registration turned off?

What is the shorcode you are using on your “registration” page?

Dave

Posted: Tuesday Dec 24th, 2013 at 10:10 am #62117
David Welch
Username: dwbiz05

There will probably be some extra coding involved in this. However, S2member lets you add a “login url” instead of using a standard page. You can use _GET variables in the url to add a custom redirect hook.

That’s very general so if you need more info just post. However, that’s probably the way you will need to go.

Dave

Posted: Wednesday Dec 11th, 2013 at 11:12 pm #61864
David Welch
Username: dwbiz05

Try including the sub directory like this:

[s2File download="access-s2member-ccap-mike/Do_The_Math.mp3" download_key="true" /]

Dave

  • This reply was modified 3 years ago by  David Welch.
Posted: Wednesday Dec 11th, 2013 at 8:56 pm #61857
David Welch
Username: dwbiz05

Awesome!

Posted: Wednesday Dec 11th, 2013 at 8:56 pm #61856
David Welch
Username: dwbiz05

What is the direct url to those files? Where do you have them stored?

Posted: Wednesday Dec 11th, 2013 at 8:38 pm #61853
David Welch
Username: dwbiz05

It doesn’t list any file or line number, just the error?

Dave

Posted: Wednesday Dec 11th, 2013 at 8:32 pm #61852
David Welch
Username: dwbiz05

Really, it’s just whatever you want it to be…

So, if I want Bob to only have access to specific pages I might add the custom capability “bob” or if he likes popcorn I might use “popcorn”.

It’s 100% your choice as long as the user’s capabilities match the page/post capability.

Does that make sense? Do you see where to add it for users and where to add it for posts/pages?

Dave

Posted: Wednesday Dec 11th, 2013 at 8:30 pm #61850
David Welch
Username: dwbiz05

What does your code look like?

Posted: Wednesday Dec 11th, 2013 at 8:28 pm #61849
David Welch
Username: dwbiz05

NOTE: if you are trying to play the file right there instead of downloading it, you might have to add inline=”yes” to get it to work like this:

[s2File download="mike.mp3" download_key="true" inline="yes" /]

I don’t use downloads much so I’m not 100% sure how this works. lol :)

Dave

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