PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Free Registration @ Different Levels

Common Questions/Problems/Tips. Posted by Administrators & Support Reps.

Free Registration @ Different Levels

Postby Jason Caldwell » October 2nd, 2010, 12:11 pm

s2Member deals with Levels [0-4]. These Levels are detected automatically during Registration. In other words, the Registration Form is adjusted automatically, based on the Level that a Customer purchases access to. As of s2Member v3.2.7+, you can also configure Custom Fields at different Levels, so the Registration Form will change in appearance if/when you have different Fields configured.

Now, if it's a free Registration, s2Member always defaults to Level # 0 ( a Free Subscriber ). So this works perfectly. However, in some cases, you may wish to offer Free Membership at multiple/different Levels, instead of Level #0 by itself. Since s2Member expects Levels 1-4 to be "paid for", you will have to link to the Registration Form in a more "advanced way" if you intend to offer these Levels [1-4] for free.

You can use this function to create a link that will allow "Paid Registration Access" for "Free" instead of requiring a Customer to go through PayPal®. This same function is often used by other gateways providers that intend to interface with s2Member, so you can adapt this to your situation; as needed.

Code: Select all
$link = c_ws_plugin__s2member_register_access::register_link_gen
($subscr_gateway, $subscr_id, $custom, $item_number, $shrink);  

$subscr_gateway = the paid subscription gateway code ( usually: paypal ).
$subscr_id = the paid transaction ID, or use time() if there was no transaction.
$custom = $_SERVER["HTTP_HOST"] ( must match the domain hosting the s2Member installation )
$item_number = 1,2,3 or 4 ( the Level number that a Customer will go in as during registration )
$shrink = ( false ) return the URL in full format, or ( true / return a tinyURL for emailing ).


Sending a Customer to the link produced by this function, will ultimately set four encrypted cookies, that s2Member will read in automatically, and ALLOW registration temporarily ( one time ).

Additional details ( optional ).

$subscr_gateway ( possible values )
paypal, authnet, google, clickbank, alipay, ccbill
( or use a custom gateway value: my-gateway )
( or you can just use the word: none )

$item_number could also include
Custom Capabilities, and/or a fixed term length.

$item_number = 1,2,3, or 4
-- OR --
$item_number = level:custom capabilities:fixed term
( ex: 1:music,videos:1 M )

Which means:
Level #1 access, + music,videos as Custom Capabilities - account expires in 1 month.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Free Registration @ Different Levels

Postby Jason Caldwell » October 2nd, 2010, 12:11 pm

Here is more of a real-world example of how this might be implemented on your site.
Inside the functions.php file for your WordPress® theme, insert a snippet like this:
Code: Select all
add_action("init", "register_level");
function register_level(){
    if(isset($_GET["register_level"])){
        $link = c_ws_plugin__s2member_register_access::register_link_gen ("none", "-", $_SERVER["HTTP_HOST"], $_GET["register_level"], false);
        wp_redirect($link); exit();
    }
}
   

Here are how the actual links would be formulated:
Code: Select all
http://example.com/?register_level=1
http://example.com/?register_level=2
http://example.com/?register_level=3
http://example.com/?register_level=4
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Free Registration @ Different Levels

Postby Jason Caldwell » March 26th, 2011, 10:55 pm

The code samples documented above;
have just been updated for compatibility with s2Member v3.5+.

Video
I've also done a video tutorial, showing an easier way to accomplish this with s2Member Pro.
Please click here to download/view the MP4 video file:
http://www.s2member.com/wp-content/uplo ... Levels.mp4
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Free Registration @ Different Levels

Postby seczo » October 25th, 2011, 11:15 am

Hi,

i´ve tried the code with OptimizePress, but get an error.
Code: Select all
Parse error: syntax error, unexpected '}' in /home/sczopp/public_html/webvideoakademie.com/wp-content/themes/OptimizePress/functions.php on line 1


If I try it with Profitstheme it works just fine. How can I fix it on OptimizePress?

Thanks
User avatar
seczo
Registered User
Registered User
 
Posts: 19
Joined: October 25, 2011

Re: Free Registration @ Different Levels

Postby Jason Caldwell » October 25th, 2011, 3:59 pm

Thanks for your follow-up on this thread.
This error "Parse error: syntax error, unexpected '}'", would suggest there is a PHP syntax error in your code, and not so much an incompatibility with your theme. To confirm this, can you please post your full code for review?
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Free Registration @ Different Levels

Postby seczo » October 26th, 2011, 3:21 am

Hi, thanks for your fast answer. This is the original function.php
Code: Select all
<?php
include_once( 'class-custom-theme-updater.php' );
$dummy_updater = new Custom_Theme_Updater( 'http://optimizepressdemo.com/api/', 'OptimizePress' );
add_filter( 'theme_api', 'theme_api_filter', 10, 3);

   function theme_api_filter( $_data, $_action = '', $_args = null )
   {
      if ( $_action != 'theme_information' ) return $_data;

      var_dump( $_data );

      return $_data;
   }

// Instantiate the class
require_once(TEMPLATEPATH . '/admin/clshelpfields.php');
require_once(TEMPLATEPATH . '/admin/clscustomfields.php');
require_once(TEMPLATEPATH . '/admin/clsblogfields.php');
require_once(TEMPLATEPATH . '/admin/clsmemcustomfields.php');
require_once(TEMPLATEPATH . '/admin/clslpcustomfields.php');
require_once(TEMPLATEPATH . '/admin/clsseocustomfields.php');
require_once(TEMPLATEPATH . '/admin/clspluspack.php');
if ( class_exists('myHelpFields') ) {
   $myHelpFields_var = new myHelpFields();
}

if ( class_exists('myCustomFields') ) {
   $myCustomFields_var = new myCustomFields();
}

if ( class_exists('myBlogFields') ) {
   $myBlogFields_var = new myBlogFields();
}

if ( class_exists('myLpCustomFields') ) {
   $myLpCustomFields_var = new myLpCustomFields();
}

if ( class_exists('myMemCustomFields') ) {
   $myMemCustomFields_var = new myMemCustomFields();
}


// Instantiate the class
if ( class_exists('mySeoCustomFields') ) {
   $mySeoCustomFields_var = new mySeoCustomFields();
}

if ( class_exists('myPlusPackFields') ) {
   $myPlusPackFields_var = new myPlusPackFields();
}


/* Admin Sidebar Panel */
// integrates duplicate post plugin w/o installing it
require_once(TEMPLATEPATH . '/admin/duplicate-post.php');
/**
* Defines the necessary constants and includes the necessary files.
*/

// Define Directory Constants
define('OPTPRESS_LIB', TEMPLATEPATH . '/lib');
define('OPTPRESS_ADMIN', OPTPRESS_LIB . '/admin');
define('OPTPRESS_CLASSES', OPTPRESS_LIB . '/classes');
define('OPTPRESS_FUNCTIONS', OPTPRESS_LIB . '/functions');
define('OPTPRESS_INCLUDES', OPTPRESS_LIB . '/includes');
define('OPTPRESS_ADMIN_CSS', get_template_directory_uri() . '/lib/admin/css' );
define('OPTPRESS_ADMIN_JS', get_template_directory_uri() . '/lib/admin/js' );
define('OPTPRESS_JS', get_template_directory_uri() . '/lib/scripts' );
require_once(OPTPRESS_LIB . '/classes/Seo.php');

// Define Folder Constants
define('OPTPRESS_SCRIPTS_FOLDER', get_bloginfo('template_url') . '/lib/scripts');

// Load Theme Options
require_once(OPTPRESS_ADMIN . '/admin-options.php');

// Load Admin Interface
require_once(OPTPRESS_ADMIN . '/admin-interface.php');

// Load Admin Scripts and Css
require_once(OPTPRESS_ADMIN . '/admin-scripts.php');

// Load TinyMCE Plugin
require_once(OPTPRESS_ADMIN . '/tinymce/tinymce.php');

// Load wp-pagenavi
require_once(OPTPRESS_INCLUDES . '/wp-pagenavi.php');

// Load Options from the Database
require_once(OPTPRESS_INCLUDES . "/var.php");

// Load Theme Functions
require_once(OPTPRESS_FUNCTIONS . '/theme-functions.php');

// Load Custom Shortcodes
require_once(OPTPRESS_FUNCTIONS . '/shortcode.php');

// Redirect To Theme Options Page on Activation
if ($_GET['activated']){
wp_redirect(admin_url("admin.php?page=$page_handle&upgraded=true"));
}

function time_ago( $type = 'comment' ) {
   $d = 'comment' == $type ? 'get_comment_time' : 'get_post_time';
   return human_time_diff($d('U'), current_time('timestamp')) . " " . __('ago');
}

// force a line break in wordpress
$init = array();
function nice_mce_options($init) {
      $init['remove_linebreaks'] = false;
      $init['apply_source_formatting'] = true;
   return $init;
}
apply_filters( 'tiny_mce_before_init', 'nice_mce_options' );
apply_filters( 'teeny_mce_before_init', 'nice_mce_options' );


function getImages($dir)
  {
    global $imagetypes;

    # array to hold return value
    $retval = array();

    # add trailing slash if missing
    if(substr($dir, -1) != "/") $dir .= "/";

    # full server path to directory
    $fulldir = "{$_SERVER['DOCUMENT_ROOT']}/$dir";

    $d = @dir($fulldir) or die("getImages: Failed opening directory $dir for reading");
    while(false !== ($entry = $d->read())) {
      # skip hidden files
      if($entry[0] == ".") continue;

      # check for image files
      if(in_array(mime_content_type("$fulldir$entry"), $imagetypes)) {
        $retval[] = array(
         "file" => "/$dir$entry",
         "size" => getimagesize("$fulldir$entry")
        );
      }
    }
    $d->close();

    return $retval;
  }

// membership page options
function my_custom_login_page() {
   require(OPTPRESS_INCLUDES . "/var.php");
    echo '<style type="text/css">
html{background:#'.$membershippagebgcolor.';}
body{background:#'.$membershippagebgcolor.';}
        h1 a { background-image:url('.$membershippagelogourl.') !important;height:123px; }
    </style>';
}

add_action('login_head', 'my_custom_login_page');

// Setup Navigation Bar For Members area

//dd_action('init', 'register_custom_menus');

//function register_custom_menu() {
//register_nav_menu('custom_menu', __('Membership Menu'));
//}

add_action( 'init', 'register_my_menus' );

function register_my_menus() {
   if ( function_exists( 'register_nav_menus' ) ) {
      register_nav_menus(
         array(
            'custom_menu' => __( 'Membership Menu' ),
            'blog_menu' => __( 'Blog Menus' ),
            'sales_menu' => __( 'Sales Menu' ),
            'squeeze_menu' => __( 'Squeeze Page Menu' )
         )
      );
   }
}



// Function that output's the contents of the dashboard widget
function optimizepress_widget_function() {
   echo '<div class="rss-widget">';
   wp_widget_rss_output( 'http://www.facebook.com/feeds/page.php?format=atom10&id=158684170823047', array('items' => 4, 'show_author' => 1, 'show_date' => 1, 'show_summary' => 1) );
   echo "</div>";
}

// Function that beeng used in the action hook
function add_optimizepress_widgets() {
   wp_add_dashboard_widget('optimizepress_widget', 'OptimizePress Updates', 'optimizepress_widget_function');
}

// Register the new optimizepress widget into the 'wp_dashboard_setup' action
add_action('wp_dashboard_setup', 'add_optimizepress_widgets' );

// Pagination
function i_pagination($pages = '', $range = 2)

     $showitems = ($range * 2)+1; 

     global $paged;
     if(empty($paged)) $paged = 1;

     if($pages == '')
     {
         global $wp_query;
         $pages = $wp_query->max_num_pages;
         if(!$pages)
         {
             $pages = 1;
         }
     }   

     if(1 != $pages)
     {
         echo "<div class='pagination'>";
         if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>&laquo;</a>";
         if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>&lsaquo;</a>";

         for ($i=1; $i <= $pages; $i++)
         {
             if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
             {
                 echo ($paged == $i)? "<span class='current'>".$i."</span>":"<a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a>";
             }
         }

         if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'>&rsaquo;</a>"; 
         if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>&raquo;</a>";
         echo "</div>\n";
     }
}

function optimizepress_comment($comment, $args, $depth) {
   $GLOBALS['comment'] = $comment; ?>
        <li id="comment-<?php comment_ID(); ?>">


  <div class="launchcommentspic"><?php
   echo get_avatar( $comment, 75 );
   ?><br>
<span style="color:#636363;"><?php comment_author_link(); ?></span><br>
<?php
$postcustom = get_post_custom($post->ID); ?>
<?php echo ($postcustom['_launchpage_disabledatewpcomments']) ? '' : time_ago(); ?>
</div>

<div style="float:left;" class="commentswidth">
   <?php if ($comment->comment_approved == '0') : ?>
              <p>Your comment is awaiting approval</p>
           <?php endif; ?>
           <?php comment_text(); ?>
           

</div>
<div style="clear:both;"></div>
        
<?php
        }

function optimizepressautop($pee, $br = 1) {

   if ( trim($pee) === '' )
      return '';
   $pee = $pee . "\n"; // just to make things a little easier, pad the end
   $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee);
   // Space things out a little
   $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';
   $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee);
   $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
   $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
   if ( strpos($pee, '<object') !== false ) {
      $pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); // no pee inside object/embed
      $pee = preg_replace('|\s*</embed>\s*|', '</embed>', $pee);
   }
   $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates
   // make paragraphs, including one at the end
   $pees = preg_split('/\n\s*\n/', $pee, -1, PREG_SPLIT_NO_EMPTY);
   $pee = '';
   foreach ( $pees as $tinkle )
      $pee .= '<p>' . trim($tinkle, "\n") . "</p>\n";
   $pee = preg_replace('|<p>\s*</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace
   $pee = preg_replace('!<p>([^<]+)</(div|address|form)>!', "<p>$1</p></$2>", $pee);
   $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag
   $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists
   $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee);
   $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
   $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee);
   $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee);
   if ($br) {
      $pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', create_function('$matches', 'return str_replace("\n", "<WPPreserveNewline />", $matches[0]);'), $pee);
      $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
      $pee = str_replace('<WPPreserveNewline />', "\n", $pee);
   }
   $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*<br />!', "$1", $pee);
   $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee);
   if (strpos($pee, '<pre') !== false)
      $pee = preg_replace_callback('!(<pre[^>]*>)(.*?)</pre>!is', 'clean_pre', $pee );
   $pee = preg_replace( "|\n</p>$|", '</p>', $pee );

   return $pee;
}

function field_func($atts) {
global $post;
$name = $atts['name'];
if (empty($name)) return;

return get_post_meta($post->ID, $name, true);
}

add_shortcode('optfield', 'field_func');

// Load Old Custom Shortcodes
require_once(OPTPRESS_FUNCTIONS . '/shortcode_old.php');


add_filter('widget_text', 'do_shortcode');

function excerpt($num)
{
   $limit = $num+1;
   $excerpt = explode(' ', get_the_excerpt().' ', $limit);
   array_pop($excerpt);
   $excerpt = implode(" ",$excerpt)."…";
   echo $excerpt;
}

function my_init() {
if (!is_admin()) {
wp_enqueue_script('jquery');
}
}
add_action('init', 'my_init');

?>


I´ve included this part before the ?> line.

Code: Select all
add_action("init", "register_level");
function register_level(){
    if(isset($_GET["register_level"])){
        $link = c_ws_plugin__s2member_register_access::register_link_gen ("none", "-", $_SERVER["HTTP_HOST"], $_GET["register_level"], false);
        wp_redirect($link); exit();
    }
}


Thanks for your help.
User avatar
seczo
Registered User
Registered User
 
Posts: 19
Joined: October 25, 2011

Re: Free Registration @ Different Levels

Postby Jason Caldwell » October 26th, 2011, 11:52 am

That looks good from my end. If problems persist, please try this instead.

Remove the code from your functions.php file, and instead create this directory and file:
/wp-content/mu-plugins/s2-hacks.php ( these are MUST USE plugins )
Reference article: http://codex.wordpress.org/Must_Use_Plugins
Code: Select all
<?php
add_action 
("init", "register_level");
function register_level ()
    {
        if (isset ($_GET["register_level"]))
            {
                $link = c_ws_plugin__s2member_register_access::register_link_gen ("none", "-", $_SERVER["HTTP_HOST"], $_GET["register_level"], false);
                wp_redirect ($link);
                exit ();
            }
    }
?>
* Be sure there are NO leading or trailing spaces/tabs/line breaks before or after <?php ?>
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Free Registration @ Different Levels

Postby RGIIEF » October 26th, 2011, 4:13 pm

Hi, Jason,
I have installed s2Member free on my new website and set up everything per your instructions - except for PayPal, which we don't want. We want members to apply through the registration process - but we never plan to accept payment on online as membership applications need to be pre-approved - and there will be no charge in most cases. When there is a payment, it will be handled by phone or mail. If we don't integrate paypal, how do I get the registration/log-in form to appear? I created the form in the options area and designated the correct page, but nothing shows up.

Also, I know how to turn on the members in the member admin section - and have tested it with a friend's email - but I don't see any log-in area on the protected pages. Once a member is logged in, will they automatically have access to all protected pages at their level, or will they need to login to each individual protected page?

Thanks for your help.
User avatar
RGIIEF
Registered User
Registered User
 
Posts: 6
Joined: September 2, 2011

Re: Free Registration @ Different Levels

Postby Jason Caldwell » October 26th, 2011, 4:58 pm

Thanks for the follow-up.

I have installed s2Member free on my new website and set up everything per your instructions - except for PayPal, which we don't want. We want members to apply through the registration process - but we never plan to accept payment on online as membership applications need to be pre-approved - and there will be no charge in most cases. When there is a payment, it will be handled by phone or mail. If we don't integrate paypal, how do I get the registration/log-in form to appear? I created the form in the options area and designated the correct page, but nothing shows up.

With s2Member (free), or with s2Member Pro, you can always create User accounts manually in your Dashboard, and have the Username/Password emailed to them, which also contains a link to log in.

Either that, or you may choose to generate Registration Access Links manually with s2Member. Even if you're NOT running PayPal, you can still use s2Member's Registration Access Link generator, as seen in the screenshot below, under the PayPal Buttons section of your Dashboard.

In other words, you can make s2Member think that they've paid you, and that now it's time to register. This works regardless of whether a particular User has paid you, or not.
( click to enlarge )
SNAG-0083.png
When you fill in the Paid Subscr. ID field, make sure it's a unique value for each User. You can make up a value of your own if you like, just be sure it's unique. Once the link is generated, email that link to your customer (or whatever), and the Registration Access Link will allow them to register exactly ONE time on your site, at whatever Membership Level you configured them for.

In short, there are two ways to accomplish this. You can either create their account manually, and have WordPress/s2Member email them a Username/Password that you created for them. Or, you can generate a Registration Access Link with s2Member (as detailed above), and they can register themselves.


Your login page is always the following:
Code: Select all
http://yoursite.com/wp-login.php
This can be further customized with s2Member, in your s2Member -> General Options.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Free Registration @ Different Levels

Postby Jason Caldwell » October 26th, 2011, 4:59 pm

Also, I know how to turn on the members in the member admin section - and have tested it with a friend's email - but I don't see any log-in area on the protected pages. Once a member is logged in, will they automatically have access to all protected pages at their level, or will they need to login to each individual protected page?
Right, they only need to log in once, and that gives them access to whatever you've made available to them, based on your s2Member -> Restriction Options.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Free Registration @ Different Levels

Postby RGIIEF » October 26th, 2011, 8:21 pm

Thanks for the prompt reply Jason. I'll give all this a try.
User avatar
RGIIEF
Registered User
Registered User
 
Posts: 6
Joined: September 2, 2011

Re: Free Registration @ Different Levels

Postby seczo » October 27th, 2011, 3:05 am

Jason Caldwell wrote:That looks good from my end. If problems persist, please try this instead.

Remove the code from your functions.php file, and instead create this directory and file:
/wp-content/mu-plugins/s2-hacks.php ( these are MUST USE plugins )
Reference article: http://codex.wordpress.org/Must_Use_Plugins
Code: Select all
<?php
add_action 
("init", "register_level");
function register_level ()
    {
        if (isset ($_GET["register_level"]))
            {
                $link = c_ws_plugin__s2member_register_access::register_link_gen ("none", "-", $_SERVER["HTTP_HOST"], $_GET["register_level"], false);
                wp_redirect ($link);
                exit ();
            }
    }
?>
* Be sure there are NO leading or trailing spaces/tabs/line breaks before or after <?php ?>


Thanks for your great answer! Now it´s working fine :)
User avatar
seczo
Registered User
Registered User
 
Posts: 19
Joined: October 25, 2011

Re: Free Registration @ Different Levels

Postby Cgoguen » November 9th, 2011, 6:42 pm

Hey Jason, Quick question! I put the above code into my functions.php which did allow me to get to the registration page. Unfortunately, once I fill out the form and hit the "register" button I get redirected to a blank page at mysite.com/wp-login.php?action=register. Any thoughts on why this may be? I am up to date on my version of s2 btw. Would really appreciate any help you could throw my way.

Thanks in advance!

Chris
User avatar
Cgoguen
Registered User
Registered User
 
Posts: 9
Joined: August 15, 2011

Re: Free Registration @ Different Levels

Postby Cgoguen » November 10th, 2011, 7:03 pm

I retract that last question. Turned out to be a plugin conflict. Thought I ruled it out but apparently I overlooked something. WORKS GREAT NOW!!!! Thanks a lot!
User avatar
Cgoguen
Registered User
Registered User
 
Posts: 9
Joined: August 15, 2011

Re: Free Registration @ Different Levels

Postby Eduan » November 10th, 2011, 7:06 pm

Glad it works now!
What plugin was it exactly the one causing the conflict? Just thought it may help someone in the future.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Free Registration @ Different Levels

Postby ajoslin103 » November 12th, 2011, 9:05 am

this method worked great, once

now I get this:

Your Link Expired:
Please contact Support if you need assistance.

what does this mean
User avatar
ajoslin103
Registered User
Registered User
 
Posts: 3
Joined: November 11, 2011

Re: Free Registration @ Different Levels

Postby Eduan » November 12th, 2011, 9:43 am

You're using specific post pages buttons right?
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Free Registration @ Different Levels

Postby ajoslin103 » November 13th, 2011, 11:51 am

the code is looking for GET not POST -- unless you are talking about putting the links on posts vs pages

these are links from a _page_ that [basically] says click here to login and click here to register (the problem is with the register link, of course)

I included the code into mu-plugins as described

Code: Select all
<pre>add_action ("init""register_level");
function 
register_level ()
{
    if (isset (
$_GET["register_level"]))
    {
        
$link c_ws_plugin__s2member_register_access::register_link_gen ("none""-"$_SERVER["HTTP_HOST"], $_GET["register_level"], false);
        
wp_redirect ($link);
        exit ();
    }
}</
pre


I've hardcoded the links as exampled: http://ndpproviders.com/11/?register_level=1

the resultant link is: http://ndpproviders.com/11/?s2member_register=fnIyOmIzM1luRWxzQUtqSUdNblBxaTFIV25MVEcxcjE3NE5IfBECvJwoChkCoy_TOxanKRRK-qen6SxdGS4F7x9VlrmDyMZPtnRetQGtC22VyZg9G-g5tAXQ--DYga_yYxuZmYzg2P_jX94-p7vE1G0AD97iOV0miFlIuRr4uCkASdD9m-Q5ZRIiRzd74hKopzgqRGyOKKwPPntxz49ARf4rDs2q

I've made sure there is no confusion between www and no www
Last edited by Cristián Lávaque on November 15th, 2011, 2:28 pm, edited 1 time in total.
Reason: Improve code readability. http://www.primothemes.com/forums/viewtopic.php?f=36&t=2780
User avatar
ajoslin103
Registered User
Registered User
 
Posts: 3
Joined: November 11, 2011

Re: Free Registration @ Different Levels

Postby ajoslin103 » November 14th, 2011, 8:53 pm

I think I have an answer -- based on the code it looks like using a "-" for the member id each time is saying "been here done that" -- so I substituted in a strval(time()) to get a never repeating value

I'll be back if this answer has other unforseen ramifications


Code: Select all
// this is an [s2member] suggested function for supporting free membership levels above 0 
// see: http://www.primothemes.com/forums/viewtopic.php?f=36&t=2819
add_action ("init""register_level");
function 
register_level ()
{
    if (isset (
$_GET["register_level"]))
    {
        
// public static function register_link_gen ($subscr_gateway = FALSE, $subscr_id = FALSE, $custom = FALSE, $item_number = FALSE, $shrink = TRUE)
        // $link = c_ws_plugin__s2member_register_access::register_link_gen ("none", "-", $_SERVER["HTTP_HOST"], $_GET["register_level"], false); // DIST
        
$link c_ws_plugin__s2member_register_access::register_link_gen ("none"strval(time()), $_SERVER["HTTP_HOST"], $_GET["register_level"], false);
        
wp_redirect ($link);
        exit ();
    }
User avatar
ajoslin103
Registered User
Registered User
 
Posts: 3
Joined: November 11, 2011

Re: Free Registration @ Different Levels

Postby Jason Caldwell » November 15th, 2011, 12:04 pm

Thanks for the follow-ups.
ajoslin103 wrote:I think I have an answer -- based on the code it looks like using a "-" for the member id each time is saying "been here done that" -- so I substituted in a strval(time()) to get a never repeating value
Yes, that should do it. Make sure that IS a unique value.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Free Registration @ Different Levels

Postby luthimir » November 19th, 2011, 12:31 pm

This is a bit off-topic, but I wasn't sure where else to post this question.

I'm getting an error from the Google captcha service when I use
Code: Select all
captcha="clean"
on my free registration forms. I'm using the s2Clean Theme (and the "Dark Black" color scheme, if it makes a difference) and my captcha was working the last time I checked it (about a week or so ago). I'm using the following shortcode to display my free registration form:
Code: Select all
[s2Member-Pro-PayPal-Form register="1" level="0" ccaps="" desc="Signup now, it&#039;s Free!" custom="www.yourwebsite.com" tp="0" tt="D" captcha="0" /]


Now, instead of showing the image as the captcha should, it displays the following error: "An internal error occurred: 4B219A41E3420.A144646.600A". For the time being, we have just disabled the captcha, but would like to include it on our registration form. Has anyone else recently encountered this error? Is this a Google issue or an s2Member issue (or an error on my part)?

Thanks in advance for any advice.
User avatar
luthimir
Registered User
Registered User
 
Posts: 10
Joined: June 2, 2011

Re: Free Registration @ Different Levels

Postby Jason Caldwell » November 20th, 2011, 7:51 pm

Regarding the captchya="clean" reply.
Please see this important thread. This will be fixed in the next release. But you can fix it now if like.
viewtopic.php?f=4&t=15924&p=53335&hilit=recaptcha#p53335
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Free Registration @ Different Levels

Postby luthimir » November 26th, 2011, 8:01 pm

Jason Caldwell wrote:Regarding the captchya="clean" reply.
Please see this important thread. This will be fixed in the next release. But you can fix it now if like.
viewtopic.php?f=4&t=15924&p=53335&hilit=recaptcha#p53335


Thanks for the link and your excellent support for s2Member Pro!
User avatar
luthimir
Registered User
Registered User
 
Posts: 10
Joined: June 2, 2011

Re: Free Registration @ Different Levels

Postby bessmccarty1 » November 27th, 2011, 6:05 pm

Hi Jason,

I couldn't find another place to post 2 questions, so I'll try here:

I have s2 member free version. My members pay through Paypal.

When they do, some are labeled s2Member Level 2, some are labeled Subscriber, even thought they all paid the same way.
Why? Is there a difference to them? The correct one is s2Member Level 2.

2nd problem: When they cancel, some remain on my wp s2member dashboard and my my AWeber list. How can I get them automatically deleted in both when they cancel?

Thank you,
Bess
User avatar
bessmccarty1
Registered User
Registered User
 
Posts: 9
Joined: July 8, 2010

Re: Free Registration @ Different Levels

Postby Cristián Lávaque » November 28th, 2011, 10:57 pm

bessmccarty1 wrote:When they do, some are labeled s2Member Level 2, some are labeled Subscriber, even thought they all paid the same way.
Why? Is there a difference to them? The correct one is s2Member Level 2.

2nd problem: When they cancel, some remain on my wp s2member dashboard and my my AWeber list. How can I get them automatically deleted in both when they cancel?


Hi Bess.

Regarding the first, you probably have Open Registration enabled and then probably some users don't complete payment properly but still go to the registration page. Since registration is open, he'll be able to create an account, but since s2Member didn't get notified of a successful payment for him, is not giving him a higher level than the default Subscriber (level 0). WP Admin -> s2Member -> General Options -> Open Registration

If the person is paying and getting sent back from the checkout to register and then gets a Subscriber role, there may be something wrong with your setup. Please post the entries related to those that have this problem, x'ing out any private info. WP Admin -> s2Member -> PayPal Options -> Account Details -> Enable Logging

Regarding the second, it may related to the above. If they were in the Subscriber role, they won't get an EOT behavior, because there isn't an EOT. Level 1 or above should get an EOT and the behavior you set. WP Admin -> s2Member -> PayPal Options -> Auto EOT Behavior

I hope it helps. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Next

Return to Common Questions/Problems/Tips

Who is online

Users browsing this forum: No registered users and 2 guests

cron