|
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
|
|
Mike, no problem, contact me via email and I can take a look at it. info {at} itelves.com
Dave
|
|
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
|
|
Remove the “exit;” from the code and see if that works. It’s working for me that way.
Dave
|
|
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
|
|
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
|
|
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
|
|
I think this is the video that’s closest to what you are looking for:
http://www.s2member.com/videos/716DC24E7E347DC2/
Dave
|
|
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
|
|
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
|
|
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
|
|
How are you linking to it / integrating it?
Dave
|
|
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
|
|
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
|
|
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
|
|
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
|
|
Does the paypal button work with the open registration turned off?
What is the shorcode you are using on your “registration” page?
Dave
|
|
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
|
|
Try including the sub directory like this:
[s2File download="access-s2member-ccap-mike/Do_The_Math.mp3" download_key="true" /]
Dave
|
|
|
|
What is the direct url to those files? Where do you have them stored?
|
|
It doesn’t list any file or line number, just the error?
Dave
|
|
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
|
|
What does your code look like?
|
|
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
|