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 - 276 through 300 (of 407 total)
Author Replies
Author Replies
Posted: Sunday Mar 18th, 2012 at 11:39 pm #8513
David Welch
Username: dwbiz05

I assume that what you are asking is how to allow a user to select the type of post category they want to be able to view on the registration screen?

If that’s the case, it’s a little more involved than Jordan’s option, but still very doable.

Let me know if you need something more complicated. Otherwise, Jordans’s option should work. Are you charging for memberships or just free memberships?

Dave

Posted: Sunday Mar 18th, 2012 at 11:35 pm #8512
David Welch
Username: dwbiz05

My understanding, and again I’m not an employee of s2member, is that downloads are not sold on a per download basis, necessarily. You don’t attach them to a paypal button.

Typically, what you do is allow a certain number of downloads per membership level. I would suggest reading the information in the first 2 sections of the Download Options of your s2member plugin. This will explain a lot how it works.

Some Options:
1. Set your membership levels to match the number of downloads. Then use membership level filtering on your download page to show only the correct ones for that level.

2. You could get a little more complicated and filter your file download links by membership level AND custom capabilities. This would allow you to create more than one file option as well as mix and match file types when creating buttons.

It’s going to take some work either way and if you don’t mind getting your hands dirty, you should be fine. I would take a look at the Custom Capabilities videon on s2member website to see if that option could work for you. Without knowing all the ins and outs of your setup that’s my suggestion.

Listing files in a directory is a fairly simple php call, of course if you know how your script is saving it, you shouldn’t need to mess with calling all the files (imo):

$dir = "images/"; //change to the full path to your dir.
$files = scandir($dir);
foreach($files as $key => $value){
echo do_shortcode('[s2File download="'.$value.'" /]');

Hope that helps.

Dave

Posted: Sunday Mar 18th, 2012 at 11:12 pm #8511
David Welch
Username: dwbiz05

Do you mean that it redirects to the registration form or that it shows the registration form in your page?

Essentially, the s2member profile form IS the registration form except the username should be uneditable and any custom fields show show or hide or be uneditable based on your settings.

Can you upload a screenshot or can you give a demo login for me to see?

Thanks,
Dave

Posted: Sunday Mar 18th, 2012 at 2:27 pm #8494
David Welch
Username: dwbiz05

It’s not the best solution, but can your custom application simply querying the member info from the wp database instead of copying everything every time a user is created?.

It seems to me that it would be easier to do that than to try to integrate a copy method.

Unless you need wordpress to do more than collect members or you have people registering through the app as well…

S2 doesn’t have any out of the box solutions for this, but depending on the full amount of integration you’re looking for, it may be helpful. how deep does this integration need to go?

Dave

Posted: Saturday Mar 17th, 2012 at 4:37 pm #8469
David Welch
Username: dwbiz05

LOL, I was trying to not do everything for you… lol!

Ok,

1. ‘find the right hook’ means we have to find the right hook… I don’t know off the top of my head but I’ll see if I can find it and update this post.

2. I don’t know if this will work but try this:

<?php
add_action('ws_plugin__s2member_during_login_redirect','my_login_function');

function my_login_function(){
	//Check to see if there is a page with that title in the system.
	$sql = "SELECT ID FROM wp_posts WHERE post_title = '".S2MEMBER_CURRENT_USER_LOGIN."' AND post_status = 'publish' AND post_type = 'page' LIMIT 1";
	$count = mysql_num_rows(mysql_query($sql));
	
	if($count == 1){
		wp_redirect(site_url(S2MEMBER_CURRENT_USER_LOGIN));
	}
	else {
		wp_redirect(site_url('trial/profile'));
	}
}

?>

Let me know if that works,

Dave

Posted: Saturday Mar 17th, 2012 at 4:09 pm #8468
David Welch
Username: dwbiz05

One of the few issues I have with s2member is the lack of good documentation as to the functions/use of most of the hooks.

S2 uses hundreds of hooks and to someone who wrote the code, I’m sure they make perfect sense. Unfortunately, for the rest of us, it’s a lot of trial and error. lol

To be honest, I’ve got no clue. Could you post the log info and we’ll see if we can narrow it down from there.

Dave

Posted: Friday Mar 16th, 2012 at 1:36 pm #8381
David Welch
Username: dwbiz05

That actually is the natural way it’s set up (at least the free version).

If you click on the button without logging in first, after payment, it should re-direct you to the registration page.

Though, I’ve not tested it with pro, so I don’t know if there is something that switches that in the pro version.

Dave

Posted: Friday Mar 16th, 2012 at 1:33 pm #8380
David Welch
Username: dwbiz05

LOL… It would help if I gave you the right directory… should be wp-content… not config… sorry about that.

I usually do this through an ftp program like filezilla or through the cpanel file system provided by your hosting company.

If you would like, I could take a look at the back end / control panel.

My contact email is in my profile.

Dave

Posted: Friday Mar 16th, 2012 at 1:27 pm #8378
David Welch
Username: dwbiz05

You may be able to circumvent the login redirect with a hook. Maybe something like this:

<?php
add_action('find the right hook','my_login_function');

function my_login_function($user_id){
	//put a function here to get whatever name or username or id or whatever you are using as the page title.
	$sql = "";
	$un = mysql_fetch_array(mysql_query($sql));
	$username = $un[''];
	
	//Check to see if there is a page with that title in the system.
	$sql = "SELECT ID FROM wp_posts WHERE post_title = '".$username."' AND post_status = 'publish' AND post_type = 'page' LIMIT 1";
	$count = mysql_num_rows(mysql_query($sql));
	
	if($count == 1){
		//Change the username to a slug like the page
		$page_slug = strtolower($username);	
		$page_slug = str_replace(' ','-',$page_slug);
		wp_redirect(site_url($page_slug));
	}
	else {
		wp_redirect(site_url('profile')); //replace profile with your profile page slug
	}
}

?>

I haven’t taken the time to find all the right hooks and everything, but that might help do what you want with a little updating.

Dave

Posted: Thursday Mar 15th, 2012 at 11:07 am #8248
David Welch
Username: dwbiz05

Are you using a gallery plugin?

Dave

Posted: Thursday Mar 15th, 2012 at 10:43 am #8242
David Welch
Username: dwbiz05

I believe the way I described above will do exactly what you want if you are loading them in a protected page/post.

My understanding is that the download_key part of the shortcode creates a single use key for displaying an image that is protected.

So is should show up in your protected page “as if” it were not protected, yet will still be protected from the outside by being in the secured folder.

So if you are going to post them on a protected page, which is a good idea, then I would make your links like the one above to make them show.

Sorry if that doesn’t make sense, I’ll try to re-word it, but I think that solution should work.

Did you try it?

Dave

Posted: Thursday Mar 15th, 2012 at 10:35 am #8238
David Welch
Username: dwbiz05

yes, they are.

Priority tells the system when it should be run in the processing order.
Accepted args states how many arguments from the filter should be passed to your function.

Dave

Posted: Thursday Mar 15th, 2012 at 10:22 am #8235
David Welch
Username: dwbiz05

Vincent,

There are probably several ways to do this, the question is what is best for what you want to do.

If you want the content to show up on the same page, based on registration date, use something like this:

<?php if(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 30){ ?>
    Put your drip content to Members that started paying you at least 30 days ago here.
<?php } ?>

<?php if(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 60){ ?>
    Put your drip content to Members that started paying you at least 60 days ago here.
<?php } ?>

<?php if(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 90){ ?>
    Put your drip content to Members that started paying you at least 90 days ago here.
<?php } ?>

You will need to enable a php plugin such as this one: http://wordpress.org/extend/plugins/php-execution-plugin/

Also, if you want newer content to show on the top each time, just reverse the order.

If you wanted to do this with different pages, then you just add the correct code to each page.

However, You would have to have some page that also drips links to the new pages like so:

<?php if(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 30){ ?>
    <a href="content-drip-30-days">View Newest Content Here</a>
<?php } ?>

Unless you can hook into the menu and add new content pages dynamically…

Hope that makes sense.

Dave

Posted: Thursday Mar 15th, 2012 at 9:50 am #8231
David Welch
Username: dwbiz05

1. I believe you can accomplish this with simple css formatting. However, I’ve not tried it myself. You can remove the s2member css by adding this to your mu-plugins/s2hacks.php file or probably your template functions.php file:

<?php
add_filter("ws_plugin__s2member_login_header_styles", "__return_false");
?>

Then just add your own css. You may be able to use the filter to change the css, I’m not sure.

2. This should also be able via css by setting the second label’s display property to “none”;

3. This is not a native functionality but some simple jquery should handle this pretty well.

Hope that points you in the right direction.

Dave

Posted: Thursday Mar 15th, 2012 at 9:40 am #8230
David Welch
Username: dwbiz05

I believe the pro version has this option, not sure about the “gifting” aspect though. Otherwise you would have to custom code that, unless there is another plugin out there that will work with s2member.

Basically, you need to be able to create and store coupon codes in the db. Then you need to check them when the user registers.

You can do the coupon checking by hooking into the s2member registration.

Then you need to update the paypal button (possibly shortcode) dynamically based on the coupon code.

:) Sound like fun? lol

It’s really not as bad as it sounds but if you’re not a programmer you might want to look for a plugin that will help or find someone as its a bit more involved than a simple shortcode. lol

Hope that helps or at least answers your question.

Dave

Posted: Thursday Mar 15th, 2012 at 9:32 am #8228
David Welch
Username: dwbiz05

My first guess is that you have the page that the images on protected by s2member…

If that’s the case, then you are basically double protecting. In order to show your images, they would need to be in a non-protected folder or you could try adding this to their url:

<img src='[s2File download="example-file.png" download_key="true" skip_confirmation="yes" /]' />

Hope that helps,

Dave

EDIT: My understanding is that the “download_key” makes it so it is not protected when using that specific link, but the image should still be protected from outside viewers.

  • This reply was modified 4 years, 9 months ago by  David Welch.
Posted: Wednesday Mar 14th, 2012 at 3:29 pm #8151
David Welch
Username: dwbiz05

I believe that the link you click on sets a cookie. If that is the case, have you tried clicking on the link from another computer and registering, or clearing your cache between registering?

If that works, then we just need to find a way to disable the cookie after registration… or… there is another issue.

Try that and see if it makes a difference.

Dave

Posted: Wednesday Mar 14th, 2012 at 10:57 am #8112
David Welch
Username: dwbiz05

I believe the e-mail address is a requirement of WordPress itself. So you have to have some sort of valid e-mail in order for wordpress to work correctly.

My suggestion is to add a “fake” email for anyone who doesn’t have one in your list. You can do this fairly easily in excel with an if function.

I would do for any email that is blank, just enter an progressively increasing email like “fake_email_1@yoursite.com”.

That way everyone would have an email in the system but they wouldn’t have to update it unless they wanted to.

Hope that helps,

Dave

Posted: Tuesday Mar 13th, 2012 at 9:42 pm #8073
David Welch
Username: dwbiz05

I’m not sure if this will work, but try under s2member->paypal options->automatic eot behavior->Membership EOT Behavior ( demote or delete )?

Try choosing delete and see if it will delete the member’s account if they are level 0. The problem is that at level 0 (subscriber) they still have an active wordpress account, so they can still log in.

I would suggest setting your members at level 1 and our content pages at access level 1 as well if you don’t want to delete the accounts, then they should be demoted to level 0 at eot.

Hope that helps.
Dave

Posted: Tuesday Mar 13th, 2012 at 9:36 pm #8072
David Welch
Username: dwbiz05

yes, look at s2member(menu)->api / scripting->simple shortcode conditionals in your wordpress installation.

basically you can use s2member shortcode conditionals to only show content to specific levels of users all on the same page.

Hope that helps,

Dave

Posted: Tuesday Mar 13th, 2012 at 9:02 pm #8070
David Welch
Username: dwbiz05

Well… lol

1 & 4. It all depends on how you are going to set up your “memberships”. If you are using member levels, remember that the standard use allows higher levels to access all content of lower levels. So a level 5 person could access level 4, 3, 2, 1 and 0 content. You may be able to accomplish this by setting up your memberships as custom capabilities that can be purchased.

Check out this video for more information about selling memberships with custom capabilities:

http://www.s2member.com/videos/A2C07377CF60025E/

Wordpress will only let a member create one wordpress account with each email address. However, by selling custom capabilities as memberships then you may be able to accomplish what you want to do.

2. Username is created by the user when he registers and you can decide if you want him to choose a password or have the system auto-generate one.

3. Yes -> go to Users and select the user click edit. You have the option to send it to them as well.

5. Your welcome. lol!

Hope that helps,

Dave

EDIT: There are 3 videos in that link. the second one is the most relevant but you may need to watch all three to get the gist.

  • This reply was modified 4 years, 10 months ago by  David Welch.
Posted: Tuesday Mar 13th, 2012 at 8:47 pm #8069
David Welch
Username: dwbiz05

Check your settings under s2member->restriction options -> alternate view protections.

If you have the ‘Feeds ( hide protected content in standard XML/RSS/ATOM feeds )’ checked, uncheck it and see if that works.

Also, I’m not sure if this helps any but this function is mentioned in that section of the s2member settings:

http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/

Hope that helps,

Dave

Posted: Tuesday Mar 13th, 2012 at 8:38 pm #8068
David Welch
Username: dwbiz05

To my knowledge, this is not a built in function of s2member. However, wordpress itself has a function that is supposed to do this:

http://codex.wordpress.org/Function_Reference/wp_logout_url

Basically, if your wp_logout_url() has a valid link, the user should be re-direced to that page when they logout.

<a href="<?php echo wp_logout_url('http://yoursite.com/goodbyepage'); ?>" title="Logout">Logout</a>

Hope that helps,

Dave

Posted: Tuesday Mar 13th, 2012 at 8:33 pm #8066
David Welch
Username: dwbiz05

I may be suffering from lack of sleep, but what do you mean you are using his signup link?

Dave

Posted: Tuesday Mar 13th, 2012 at 8:31 pm #8065
David Welch
Username: dwbiz05

Well, I think you have a couple of options.

You could track down the file that S2 uses to create that file. I don’t know which it is. But if you change that file then update your version at a later time, you will have to re-do it again if it gets replaced by a newer version.

The second option is to hook into the paypal return hook and re-direct to your own page.

That can be done like this:

<?php
add_action('ws_plugin__s2member_during_paypal_return_during_subscr_signup_w_update_vars','my_pp_return');
add_action('ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars','my_pp_return');
function my_pp_return(){
	//do any processing if you want...
	$thankyou_page = site_url('replace-with-your-thankyou-page-slug');
	
	wp_redirect($thankyou_page);
}
?>

In case you don’t know, that info should go in a new (or existing) file here: yourwebsite.com/wp-content/mu-plugins/s2hacks.php

There are other hooks that you could possibly user for paypal return that can be found here:
http://www.s2member.com/codex/stable/s2member/paypal/package-filters/

Hope that helps,

Dave

PS. I’ve not done extensive testing but it should work. :)

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