Community Support Forums — WordPress® ( Users Helping Users ) — 2011-10-12T18:21:44-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=15423 2011-10-12T18:21:44-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=46738#p46738 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]>

Statistics: Posted by Cristián Lávaque — October 12th, 2011, 6:21 pm


]]>
2011-10-11T19:31:54-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=46638#p46638 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]> Note: It seems that ccaps cannot include special characters, such as hyphens.

Code:
<?php
/* Custom function for the s2member plugin. This denies access to content if user doesn't have a Custom Capability (ccap) equivalent to the category slug. If denied, user is redirected to the s2member subscription options page.
*/
add_action('template_redirect', 'my_custom_capabilities');
function my_custom_capabilities() {
   $category = get_the_category();
   $kat = $category[0]->category_nicename;
   if (in_category($kat) && (!current_user_can('access_s2member_ccap_' . $kat))) {
        header('Location: ' . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
        exit;
    }
}
?>

Statistics: Posted by kennymcnett — October 11th, 2011, 7:31 pm


]]>
2011-10-11T13:38:04-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=45374#p45374 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]>

Yes, we're considering buttons for an improved interface in the editor.

About those, this thread may interest you: viewtopic.php?f=4&t=15449 It's not about the downloads, but you may work from that to add the ones you need.

That doesn't add a file manager, of course, I'll mention that to Jason, but I don't know when it'd happen.

Thanks for the suggestions!

Statistics: Posted by Cristián Lávaque — October 11th, 2011, 1:38 pm


]]>
2011-10-10T16:03:09-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=45283#p45283 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]> Statistics: Posted by Eduan — October 10th, 2011, 4:03 pm


]]>
2011-10-10T15:48:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=45281#p45281 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]>
Because this site will ultimately be maintained by a non-programmer client, here's the method I've chosen to use (also based on some insight from other threads on this forum).

1. Use s2member ccaps to grant access to posts individually and by category as we've discussed.

2. Embed video content in those posts from a 3rd party provider. I've chosen Vimeo's PRO account, which allows for restricted playback by domain and is ultimately cheaper than Amazon S3 or similar service. So, I will embed the video inside of a ccap-protected post, and in the Vimeo admin restrict playback to the client's domain only. Since we're not allowing the video to be downloaded, this solution gives us complete security and also leverages the speed of Vimeo's servers. More importantly, it's very simple for the client to upload any kind of video (Vimeo converts to appropriate filetype) and insert it into his post (via standard WP video insert methods), which post is automatically protected by the s2member's ccaps we assign.

3. Completely restrict access to the s2members-files folder.

4. In each protected post, make download links to any protected files using the shortcode for s2member authorization keys. It is simple for the client to hit the link button in the wordpress editor for any word or graphic in his post and insert
Code:
[s2File download="example.zip" download_key="true" /]
into the URL box.

Suggestions:
A button on the post editor to insert a link to an auth-key file. For example, instead of clicking the standard wordpress link icon, I would highlight what I want to link and then click the "s2member protected file link" icon, which would pull up a list of the contents of s2member-files, allow me to select one, then insert the appropriate shortcode into the post/link data.

Related, it would be nice to have a file browser for the s2member-files directory so a client could upload new files without using ftp. (Like the WP media manager, but specifically for the s2member-files directory). An "insert protected file" icon seems ideal for a user that isn't a programmer.


Thank you again for your detailed and timely help. I had considered other plugins on the market, but your support kept me here. I will recommend s2 with full marks.

Kenny

Statistics: Posted by kennymcnett — October 10th, 2011, 3:48 pm


]]>
2011-10-09T14:31:15-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=45200#p45200 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]>
Then, instead of protecting the downloads with ccaps as described above, use the ccaps in conditionals in the download page and show the download link only to those that have the right access (the right ccap for it).

You can then protect the download using a download key. Read about it here: WP Admin -> s2Member -> Download Options -> Advanced

I hope that helps. :)

Statistics: Posted by Cristián Lávaque — October 9th, 2011, 2:31 pm


]]>
2011-10-08T16:42:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=45154#p45154 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]>
But, to solve #3, I see that I can create subfolders in the s2members folder for each ccap. But, does that mean I would need to create a subfolder for each ccap I make? Meaning, each video in the example we've been referring to would need to be placed in its own subfolder? How, then, would I grant direct URL access for the other ccaps?

Summarizing: How can I grant multiple ccaps direct URL access to the same file? (in this example: ccaps are sitewide, trees, and video1).

Or is that even necessary?

Thank you again.

Kenny

Statistics: Posted by kennymcnett — October 8th, 2011, 4:42 pm


]]>
2011-10-07T03:45:24-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=45032#p45032 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]>

1. Correct.

2. Exactly.

Code:
<?php
add_action
('template_rediret', 'my_custom_capabilities');
function my_custom_capabilities() {
    if (is_category('trees') && (!current_user_can('access_s2member_ccap_trees' && !current_user_can('access_s2member_ccap_sitewide')) {
        header('Location: ' . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
        exit;
    }
}
?>


3. You can protect file downloads with custom capabilities too. WP Admin -> s2Member -> API / Scripting -> Custom Capability & Member Level Files

I hope this helps!

Statistics: Posted by Cristián Lávaque — October 7th, 2011, 3:45 am


]]>
2011-10-07T02:48:36-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=45025#p45025 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]>
3 follow-ups:

1. Does this mean I'll need to create a custom capability for each individual video? From what I understand, that simply means creating a subscription button that includes the new ccap, then using that ccap in the conditional inside the post, right?

2. If I make a third category, such as "Sitewide", could I also add that to the functions.php in conjunction with the other categories, then assign the post to both the "Trees" and "Sitewide" category? The logic for the functions.php being: If the category of the post is "Trees", then require ccap of "trees" OR "sitewide". Does that work? Any help on the actual php?

3. How does this tie into download restriction options? Since the video/image/file will be served from my secured s2members-files directory, and embedded into the post, I'm confused about where the custom capability applies. Is it applying to the video itself, or to the post? I need to deny access to anyone (regardless of subscription) attempting to access the video file directly instead of viewing it inside the post, because I don't want them downloading directly. (I know there are ways to download/capture content regardless, but I'd like to at least restrict the no-brainer direct URL download.) Or maybe I'm thinking about this the wrong way?

Again, thank you so much. I'm quickly becoming your newest evangelist.

Kenny

Statistics: Posted by kennymcnett — October 7th, 2011, 2:48 am


]]>
2011-10-07T01:43:28-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=45019#p45019 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]>
videos, video1, video2, video3, video4, trees, oceans

video1 for video post #1, video2 for post 2 and so on.

You can use trees and oceans in a conditional in the theme's functions file as explained by Jason in segment 2 of the video I linked to above.

videos could be checked for in both cases above. You'd sell this one to those that get access to everything.

So you can protect the video pages with conditionals instead of the metabox in the edit page. An example conditional would be:

Code:
[s2If current_user_can(access_s2member_ccap_videos) OR current_user_can(access_s2member_ccap_video1)]
    Show video 1.
[/s2If]

[s2If !current_user_can(access_s2member_ccap_videos) AND !current_user_can(access_s2member_ccap_video1)]
   Show sales copy for video 1.
[/s2If]


or

Code:
<?php if (current_user_can('access_s2member_ccap_videos') || current_user_can('access_s2member_ccap_video1')) { ?>
    Show video 1
<?php } else { ?>
    Show sales copy for video 1.
<?php } ?>


WP Admin -> s2Member -> API / Scripting -> Simple/Shortcode Conditionals
WP Admin -> s2Member -> API / Scripting -> Advanced/PHP Conditionals

http://www.s2member.com/custom-capabilities-video/

I hope this helps. :)

Statistics: Posted by Cristián Lávaque — October 7th, 2011, 1:43 am


]]>
2011-10-07T01:00:09-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=45015#p45015 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]>
The scenario:

Video Post #1 - posted in category "Trees"
Video Post #2 - posted in category "Trees"
Video Post #3 - posted in category "Oceans"
Video Post #4 - posted in category "Oceans"

How to:
1. Sell the videos individually AND
2. Sell subscriber packages to the different categories AND
3. Sell a sitewide subscription to all content.

Thank you!

Statistics: Posted by kennymcnett — October 7th, 2011, 1:00 am


]]>
2011-10-05T02:12:00-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=44862#p44862 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]> http://www.s2member.com/custom-capabilities-video/

I hope it helps. :)

Statistics: Posted by Cristián Lávaque — October 5th, 2011, 2:12 am


]]>
2011-10-04T16:54:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=44833#p44833 <![CDATA[Re: Specific Post/Page Protection also be part of Member gro]]> http://www.s2member.com/specific-posts-pages-video/

Yes, as long as there's not a conflict (like the one described above).

Statistics: Posted by Eduan — October 4th, 2011, 4:54 pm


]]>
2011-10-04T16:40:40-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15423&p=44832#p44832 <![CDATA[Specific Post/Page Protection also be part of Member group?]]>
If I do this can I keep it so that the individuals that just purchase the page don't have access to the rest of the pages the members do?

I want to sell the items that make up the membership separately, with the option to purchase access to all with a membership.

Finally, If a user wants to upgrade from post/page access to the membership am I bound by the 20% rule for PayPal?

Thanks for all the help!

Statistics: Posted by jmadigan — October 4th, 2011, 4:40 pm


]]>