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™

Unlimited Access

s2Member Plugin. A Membership plugin for WordPress®.

Unlimited Access

Postby eric41 » October 23rd, 2010, 7:48 am

Hello! Using S2Member v3.1. I have a content site where I am offering online courses - all via "Specific Post/Page Access Buy Now Buttons". I am not using membership levels at all because I don't want to require anyone to register for any reason.

So here is my issue: I am offering an option at my site to purchase unlimited access to the entire catalogue of courses. When someone purchases the unlimited access package, I want their access to update each time I add new courses. In other words, I want them to have ongoing unlimited access to the site and automatic new access to any future courses/pages I create. So far, I have been using "Specific Post/Page Access Links" when someone wants unlimited access, so I just manully go in and create a bundle package that gives access to every premium page of the site. The problem of course is that this link does not update to include new courses when I create them.

Sure hoping there's a way to make this happen..looking forward to any responses. Thank you!

Eric
User avatar
eric41
Registered User
Registered User
 
Posts: 7
Joined: October 23, 2010

Re: Unlimited Access

Postby Jason Caldwell » October 24th, 2010, 5:03 am

Hi Eric. Thanks for your inquiry.

Yes, this is possible with s2Member. You'll need to use the file that I've attached. You will want to unzip this file, and then place the containing PHP file into a special folder on your server, at this location:
/wp-content/mu-plugins/my-dynamic-sp-access-session.php

This way your changes will survive future upgrades of the s2Member plugin. If you don't have an /mu-plugins/ directory, please create one. The directory /mu-plugins/ = MUST USE plugins, which are loaded automatically by WordPress® ( that's what you want ).

my-dynamic-sp-access-session.zip
(523 Bytes) Downloaded 9 times

The attached zip file contains this PHP code ( an s2Member add-on ):

Code: Select all
<?php
function my_dynamic_sp_access_session 
($sp_access_values, $vars)
    {
        $vars["__refs"]["sp_access_values"] = array (ws_plugin__s2member_encrypt ("sp_time_hours:.:|:.:" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] . ":.:|:.:" . strtotime ("now") . ":.:|:.:" . ($expiration_hours = "72")));
        /**/
        $vars["__refs"]["cookie"] = implode (":.:|:.:", $vars["__refs"]["sp_access_values"]); /* Implode the access values into a delimited string. */
        /**/
        setcookie ("s2member_sp_access", $vars["__refs"]["cookie"], time () + 31556926, "/"); /* Updated the session cookie. */
    }
add_action ("ws_plugin__s2member_during_sp_access_session", "my_dynamic_sp_access_session", 10, 2);
?>
With this file in place, your Customers will automatically be granted access to ALL Posts/Pages that you list in the General Options panel for s2Member. You'll just need to keep your list up-to-date. You do this through your Dashboard, by navigating to: s2Member -> General Options -> Specific Post/Page Access.

This add-on requires s2Member v3.2.7+.
http://www.primothemes.com/post/product ... th-paypal/
~ 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: Unlimited Access

Postby eric41 » October 24th, 2010, 5:20 am

Thanks so much for that, Jason!
I'm off soon to plug this stuff in, and I will report back to you.
Have a great day!

Eric Turner
User avatar
eric41
Registered User
Registered User
 
Posts: 7
Joined: October 23, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron