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 - 351 through 375 (of 407 total)
Author Replies
Author Replies
Posted: Tuesday Feb 21st, 2012 at 2:26 pm #5891
David Welch
Username: dwbiz05

Just taking a quick peek at the page source, it looks like they might be using bbpress plugin.

I’m not sure what (if any) updates or changes they made to it though as I’m not familiar with bbpress.

Here is the bbpress website:

http://bbpress.org/

Dave

Posted: Tuesday Feb 21st, 2012 at 11:07 am #5872
David Welch
Username: dwbiz05

Are you sure it’s not your permalink settings that’s preventing this?

Turn off s2member and try it to see if it works.

Dave

Posted: Tuesday Feb 21st, 2012 at 11:05 am #5871
David Welch
Username: dwbiz05

Looking at the code, I don’t see any “push-button” way to do this.

There is no filter or hook that you can use to stop it either… mostly because that’s not the way most people want it to work. :)

However, you could probably create a function to hook into the auto_eot process before it starts, store the ccap options in a new variable, then run another function after the eot process that adds the ccaps back to the user.

should be simple… :) lol!

Dave

Posted: Tuesday Feb 21st, 2012 at 9:16 am #5860
David Welch
Username: dwbiz05

Well, you would put your Jquery functions in the section of your template (my suggestion).

I would probably put it in a .js file and then link to the file from the template head file.

Your .js file would just reference the fields using their ID’s.

Dave

Posted: Tuesday Feb 21st, 2012 at 9:14 am #5859
David Welch
Username: dwbiz05

This option is available in the pro version (according to the s2member site).

From what I see in the pro documentation, it looks like it exports all the standard wp data as well as most if not all of the s2 data for each user.

I don’t use PRO so I can’t say for certain, but just based on research it looks like it can be done.

Dave

Posted: Tuesday Feb 21st, 2012 at 9:02 am #5854
David Welch
Username: dwbiz05

Until they create something like this, you could do this yourself by querying the db table wp_usermeta for the meta_key “wp_s2member_auto_eot_time.” It’s stored as a time() integer which you could use to do your calculations and change your button code.

Dave

Posted: Monday Feb 20th, 2012 at 10:38 am #5691
David Welch
Username: dwbiz05

I don’t know if there is a way to make multiple registration forms with PRO but I know you can’t with the FREE version.

I would suggest what you already mentioned, using jquery to hide or show the fields that you want. So, you would create all the possible fields you want in the custom field creation section of s2member then filter them with Jquery.

Dave

Posted: Monday Feb 20th, 2012 at 10:16 am #5689
David Welch
Username: dwbiz05

I don’t think there is an “open gateway” to be able to submit new user info to s2member for processing. I’ve never tried it before, but my first thought is that it will probably need to be custom coded to insert all the data into the database properly.

I’ll check on it, but my expectation is low on this one without a specifically designed notification build by s2member or yourself.

Dave

EDIT: Stuart was right, there is an option to do this with PRO. I don’t have PRO so I can’t speak as to how it is done, but it looks like it will still take a little development (coding) on your end to accomplish this since you would need to call the remote create user function and any other required api functions.

  • This reply was modified 4 years, 10 months ago by  David Welch.
Posted: Monday Feb 20th, 2012 at 10:13 am #5688
David Welch
Username: dwbiz05

To be sure, s2member is not for everyone. However, I would have to say that the evidence leans more toward the thousands of satisfied (non-programmer) customers that are able to use it every day.

If you have constructive ideas to make things better or if you have any specific questions, please feel free to mention them.

I see this is the only topic you’ve started, which means that you’re really not concerned about getting help or even trying to learn the product, but rather wish to blast it away just because it doesn’t do everything you want with one button push out of the box. lol.

I’m not saying that you are not intelligent or that you don’t have good ideas. But why not share them instead of just telling the plugin creator that they “lack clear thinking” just because you don’t see it the same way he or thousands of other users do.

Sorry to the rest of the forum for allowing this post to filter back to the top but it bugs me when people just blast something without using all methods available to get help.

Oh well, probably just a “Drive-by Poster” anyway… lol!

Dave

Posted: Thursday Feb 16th, 2012 at 12:46 pm #5383
David Welch
Username: dwbiz05

I saw your post in the other forum and here is a link to my solution:

http://www.s2member.com/forums/topic/show-content-for-one-user/#post-5371

Dave

Posted: Thursday Feb 16th, 2012 at 12:44 pm #5382
David Welch
Username: dwbiz05

I just saw your other post about this and it looks like you want to use shortcode inside your shorcode for this function.

If so, you can change my function as follows and it should work to have shortcode in your text.

if( is_user_logged_in() && S2MEMBER_CURRENT_USER_LOGIN == $user_id){
		$content = preg_replace('/(\[.*?\])/e',"do_shortcode('$1')", $content);
		
		return $content;
	}

Dave

Posted: Thursday Feb 16th, 2012 at 11:43 am #5371
David Welch
Username: dwbiz05

Well, you could create a function that works like the level access shortcode for just one user.

However, if you haven’t used up all your membership levels (and don’t plan to) you could just use one for that one person, upgrade him/her to that level and then protect that content like normal.

The only issue is that member levels build on each other, meaning a level 4 member has access to all content that a level 3, 2, 1 or 0 member has. If that is a problem, then you probably will have to go the custom route.

I didn’t look throughly through the scripting/api options that s2member has, but I didn’t notice one that does this.

My quick idea is as follows:

function user_only_content($atts, $content=null){
	extract( shortcode_atts( array(
		'user_id' => 0,
	), $atts ) );
	
	if( is_user_logged_in() && S2MEMBER_CURRENT_USER_ID == $user_id){
		return $content;
	}
	
}

add_shortcode('user-specific-content','user_only_content');

Add that to your functions.php file in your theme.

Then to call it in your post or page, just use this:

[user-specific-content user_id="5"]
Place the content you want for user_id 5 between these tags and enter the user's id in the user_id="" in the first tag.
[/user-specific-content]

If you want to use the user’s login name instead of their ID, change this in the function:

S2MEMBER_CURRENT_USER_ID

to 

S2MEMBER_CURRENT_USER_LOGIN

Then put the username/login name in the user_id=”” part of the shortcode.

Hope that helps,

Dave

Posted: Thursday Feb 16th, 2012 at 1:54 am #5318
David Welch
Username: dwbiz05

OK

Well, let me say that PayPal does not make this easy.

1. They don’t allow trial periods over about 90 days if you are using the ‘D’ option.
2. They don’t allow second trial periods with no payment ($0.00).

Here is what, in my attempt, has to be done.

1. Create a trial period in MONTHS for the remaining months until July 1. Charge the full or reduced price, depending on the current month.
2. Create a second period in DAYS to run off any remaining days in June. Charge a $0.01 fee for paypal to accept the second trial period.
3. Set the standard rate and time period of 1 year that *should* start on July 1.

Now, to the code:

s2member doesn’t accept a second trial period. I don’t know if it matters if you add one or not, but it’s not an option in their button builder (at least not free).

NOTE: I’m on the free version of s2member and even then, the following code has only been minimally tested. I do not claim it’s perfection but it seemed to work for me in initial tests:

Basically, I’ve created a few functions along with a shortcode that you *should* be able to use to do what you want.

First, the shortcode:

[equal-time-pp full='' part='' code='']

This is the shortcode you use to place your buttons on the page/post.

3 Variables are available… really required.
1. full – This is the full amount you charge with trailing zeros. Example: 50.00
2. part – This is the partial payment you charge for Jan. – June registrations. Same format as above.
3. code – This is the s2member shortcode you can generate in the paypal button generator in s2member. NOTE: do not use the “[” or “/]” tags… just copy everything else in between them.

EXAMPLE S2MEMBER SHORTCODE:

[s2Member-PayPal-Button level="1" ccaps="" desc="." ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="" ta="5.00" tp="1" tt="D" ra="10.00" rp="1" rt="Y" rr="1" rrt="" rra="1" image="default" output="button" /] 

ONLY COPY THIS:

s2Member-PayPal-Button level="1" ccaps="" desc="." ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="" ta="5.00" tp="1" tt="D" ra="10.00" rp="1" rt="Y" rr="1" rrt="" rra="1" image="default" output="button"

SO THE NEW SHORTCODE WOULD LOOK LIKE THIS:

[equal-time-pp full='50.00' part='30.00' code='s2Member-PayPal-Button level="1" ccaps="" desc="." ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="" ta="5.00" tp="1" tt="D" ra="10.00" rp="1" rt="Y" rr="1" rrt="" rra="1" image="default" output="button"']

Clear as MUD? lol!

Now, you need to add this code probably to your functions.php file. It’s php code so make sure it’s inside the starting and ending php tags.

THE CODE:

function equal_time_pp_form($atts){
	
	extract( shortcode_atts( array(
		'full' => '0.01',
		'part' => '0.01',
		'code' => '[s2Member-PayPal-Button /]',
	), $atts ) );
	
	$full_price = $full; //full year membership
	
	$partial_price = $part; //half year membership

	$code = '['.$code.' /]';
	//This assumes full payment
	$first_trial_price = $full_price;

	//Calculate number of days through June 30.
	$month = date("n");
	
	//Get the number of days for second trial
	//Or first trial if less than 1 month
	$trial_days = trial_days();
	
	//Check what time of year current month is in
	if($month >= 7){
		//Add 6 months to first trial if after June 30
		$pay_months = (12 - $month) + 6;
	}
	else {
		//Months before June 30
		$pay_months = 6 - $month;
		
		//This is the short-term price for Jan - June.
		$first_trial_price = $partial_price;	
	}
	
	//Set Trial Info
	if($pay_months == 0){
		$first_trial_time = $trial_days;
		$first_trial_type = 'D';
		$first_trial_amount = $first_trial_price;
		$second_trial_time = $trial_days;
		$second_trial_type = 'D';
		$second_trial_amount = '0.01';
		$normal_time = '1';
		$normal_type = 'Y';
		$normal_amount = $full_price;
	}
	else {
		$first_trial_time = $pay_months;
		$first_trial_type = 'M';
		$first_trial_amount = $first_trial_price;
		$second_trial_time = $trial_days;
		$second_trial_type = 'D';
		$second_trial_amount = '0.01';
		$normal_time = '1';
		$normal_type = 'Y';
		$normal_amount = $full_price;
	}

	/* REPLACE SHORTCODE INFO WITH TRIAL INFO */
	$code = preg_replace('/ta=".*?"/','ta="'.$first_trial_amount.'"', $code);
	$code = preg_replace('/tp=".*?"/','tp="'.$first_trial_time.'"', $code);
	$code = preg_replace('/tt=".*?"/','tt="'.$first_trial_type.'"', $code);
	$code = preg_replace('/ra=".*?"/','ra="'.$normal_amount.'"', $code);
	$code = preg_replace('/rp=".*?"/','rp="'.$normal_time.'"', $code);
	$code = preg_replace('/rt=".*?"/','rt="'.$normal_type.'"', $code);
	
	//Add Hack to Include 2nd Trial
	add_action('ws_plugin__s2member_during_sc_paypal_button','edit_paypal_form');
	
	//Run modified s2member shortcode
	$pp_form = do_shortcode($code);
	
	//Remove Second Trial Hack To Keep From Affecting Other Forms
	remove_action('ws_plugin__s2member_during_sc_paypal_button','edit_paypal_form');
	
	//Send form to browser
	return $pp_form;

}

add_shortcode('equal-time-pp','equal_time_pp_form');

function edit_paypal_form($vars=array())
{
	//Second Trial Variables
	$second_trial_time = trial_days();		
	$second_trial_type = 'D';		
	$second_trial_amount = '0.01';
	
	//Extra Code Added To S2Member PP Form
	$extra_items = '  ';
	
	//Replace With New Code
	$new_code = str_replace("",$extra_items,$vars['code']);

	//Upate PP Form Code
	$vars['code'] = $new_code;
}

function trial_days(){
	
	//Get number of days left in June
	$day = date("d");
	
	if($day > 30){
		$day = 30;
	}
	
	//Have to use 32 to make Paypal work right... I think.
	$trial_days = 32 - $day;
	
	return $trial_days;
}

Whew! That took a lot longer than I thought and of course, no guarantee it’s perfect but it seems it can be done… somehow.

LOL!

Dave

  • This reply was modified 4 years, 10 months ago by  David Welch.
Posted: Wednesday Feb 15th, 2012 at 11:47 pm #5307
David Welch
Username: dwbiz05

How are your memberships set up?

Reason I ask is because if you receive an e-mail everytime someone joins (like normal) then you could set your registration to open and everyone joins at level 0.

Then you could “approve” them by manually upgrading them to whatever s2member level you want.. plus, you can set an EOT (End of Term) for each user individually. ( I assume this works for non-paying member’s subscriptions).

Might be a little more work than you wanted but it keeps from having to hack the code.

Dave

Posted: Wednesday Feb 15th, 2012 at 7:36 pm #5296
David Welch
Username: dwbiz05

My opinion…

I would put it on the back-end site… however, that brings up the question of button generation, since you want the buttons on your other site.

I’m not sure if s2member has any ability to do this automatically or not.

My suggestion would be to create a button via s2member install on your back-end site, put it in a test page, load the test page and copy the html from the “view source” of that test page.

This is because s2member will add some data dynamically to the button from the system, such as notify and return urls.

By copying the source of your test button(s) you should be able to get all of that posted on your second site without any issues.

It’s kind of a pain and there may be a better solution that I’m not aware of with s2member, but that’s my 2 cents.

Dave

Posted: Wednesday Feb 15th, 2012 at 7:29 pm #5292
David Welch
Username: dwbiz05

You’ll need to write a php function (my opinion) and put it in the functions.php file of your theme.

I’ll see if I can put something together when I get a chance later tonight.

Really shouldn’t be extremely difficult, just don’t have the time at the moment… lol.

The tricky part will be getting the new subscription price to start on the right date with PayPal’s system.

Are you using Pro of either s2member or Paypal?

Dave

  • This reply was modified 4 years, 10 months ago by  David Welch.
  • This reply was modified 4 years, 10 months ago by  David Welch.
Posted: Wednesday Feb 15th, 2012 at 7:19 pm #5290
David Welch
Username: dwbiz05

Sorry to hear all the issues with Siteground.

I’m sure it would be a pain to move, but I might be able to help you out. Feel free to contact me at dwelch @ itelves.com. (hopefully that’s allowed here)

I’ve been hosting on Hostgator for years and have never had any problems with outdated software or reps who blame the scripts, especially when the developer states their requirements.

Dave

Posted: Wednesday Feb 15th, 2012 at 5:18 pm #5278
David Welch
Username: dwbiz05

Becasue I saw s2member desciribe the page as it will never prevent unregistered user from access this page……so thats why all these mess came up.

I think you may be mis-reading or mis-understanding what it says.

This is what it says in the Login Welcome Page settings:

*Tip* This special Page will be protected from public access ( automatically ) by s2Member.

That means that whatever page you select WILL be protected automatically from anyone who is NOT logged in.

So if you put the profile on the page you set as your Login Welcome Page, you don’t need any other code because it is automatically protected by the system by default.

Does that answer your question?

Dave

Posted: Wednesday Feb 15th, 2012 at 4:48 pm #5276
David Welch
Username: dwbiz05

Well, That’s basically what you are doing if you are using payment buttons (especially paypal) you can set the term, like $5 for 1 month or $20 for 1 year, etc.

Buttons can be set up for each membership type in s2member -> Paypal Buttons.

So, yes it can work that way. It doesn’t list the EOT (End Of Term) in the user profile by default, but the system does track it and there are settings for what happens when the EOT occurs in S2Member -> Paypal Options -> Automatic EOT Behavior

Hope that helps,

Dave

Posted: Wednesday Feb 15th, 2012 at 4:40 pm #5262
David Welch
Username: dwbiz05

I would create a function to manipulate the paypal button info when the button is loaded each time.

For example, create a function that checks the current date.

If the current date is Jan-June then it sets the lower price as the “trial period” that ends June 30th (may need to calculate the exact days on that as well.)

Then it would set the regular price to be set as due immediately after trial ends and is an annual payment.

That way, no matter when they join, the paypal subscription would end on June 30th automatically.

I think that would do what you want. It make take some trial and error to get the timing right with the paypal subscription.

Dave

Posted: Wednesday Feb 15th, 2012 at 2:39 pm #5240
David Welch
Username: dwbiz05

If someone is not registered, they shouldn’t be able to access your login welcome page. It should be auto-locked by the system.

What is the link to your login welcome page. I’ll see if I can access it without logging in.

If you don’t want to post it, you can e-mail me at dwelch @ itelves.com (don’t look at the old crappy site… lol).

Hopefully putting my e-mail in doesn’t get me booted… I didn’t see any rules posted. :)

Dave

Posted: Wednesday Feb 15th, 2012 at 2:30 pm #5239
David Welch
Username: dwbiz05

If I’m reading this correctly, you have your paypal button on post Y.

So, if post Y is protected via the special page/post protection, then no-one will be able to access the button that will give them access! :)

You should either put your button on the membership options page or embed it into post X so they pay for access to post Y from the public access post X.

Then, once payment is confirmed, they should have access to post Y via the link in post X.

Unless I miss-understood how you have it set up…

Dave

Posted: Wednesday Feb 15th, 2012 at 1:39 pm #5234
David Welch
Username: dwbiz05

try adding this in your function…

function dw_custom_redirect($vars = array()){

	//This redirects to the registration url (assuming it's a standard install)
	if( !is_user_logged_in() ){
	wp_redirect(site_url('/wp-login.php'));
	}
	exit();
	
}

Dave

Posted: Tuesday Feb 14th, 2012 at 5:36 pm #5069
David Welch
Username: dwbiz05

LOL!

Nice

Dave

Posted: Monday Feb 13th, 2012 at 10:07 pm #4983
David Welch
Username: dwbiz05

Well, I don’t know if there is a plugin, but you could write a fairly simple script that reads the following variables:

%%current_user_login%% - username
%%current_user_logins%% - number of times the user has logged in.

Maybe a link like this:
http://yoursite.com/members/login-redirect.php?username=%%current_user_login%%&logins=%%current_user_logins%%

Then your php page could do something like this:

$username = $_GET['username'];
$logins = $_GET['logins'];

if($logins > 1){
//redirect to secondary page (you could add a function here to check a member's 
//option setting if you integrated that as mentioned in your post.
}
else {
//redirect to the profile page.
}

Something like that. lol :)

Dave

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