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™

restriction options

s2Member Plugin. A Membership plugin for WordPress®.

restriction options

Postby trc4949 » December 9th, 2011, 11:28 am

I am testing out the restriction options.

I have 5 total postings. 3 of them have the 'free' tag. 1 of them has the 'members' tag and one has a general tag of 'cup and handle patterns'

Tags with 'free' are viewable by level 0 users and tags with 'members' are viewable by level 1 users.

I have all 4 check boxes checked in the "protect alternative views" restriction options section..

The problem is on the left sidebar of the home page

http://www.cupwithhandlepattern.com/

I have a section widget of 'Recent cup and handle posts'..... and so only one of the postings shows up in this list when no users are logged in at all.

But I would like all the 'recent cup and handle posts' to display regardless of who is signed in or if no one is signed in.

When I uncheck 'nav menus' in the protect alternate views section, then all the 'recent up and handle posts' do display in the widget on the left sidebar, but then all the postings are accessible to anyone through the 'previous posts' and 'next posts' nav menu at the bottom of posts on the home page...

so in summary:

thoughts on how to show all menu items at all times? but if not signed into appropriate member level just revert to the member options page
User avatar
trc4949
Registered User
Registered User
 
Posts: 15
Joined: March 6, 2011

Re: restriction options

Postby trc4949 » December 9th, 2011, 8:03 pm

I may have figured this out by hacking with some PHP. And using this reference pointed to in the s2member configuration

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

Code: Select all
<ul>
<?php
global $post;
$args = array( 'numberposts' => 5, 'offset'=> 1, 'tag_id' => 7 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) :   setup_postdata($post); ?>
   <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>


so i just put 3 sections in the left sidebar which correspond to the three different types of TAGs of postings

so all the postings (or most recent 10 postings) show up on the left sidebar and depending on who is signed in and at what level, some postings will show when clicked on and then others will revert to the membership options page.

I can't believe I figured out how to hack the blog with PHP. The most I know is html. wow.
User avatar
trc4949
Registered User
Registered User
 
Posts: 15
Joined: March 6, 2011

Re: restriction options

Postby Cristián Lávaque » December 10th, 2011, 8:31 pm

Well done! I'm glad you customized it the way you wanted. :)

About the prev/next links you mentioned, did you mean they show, or when you click those links you could actually go to the restricted pages although you were logged out? Just making sure.
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

Re: restriction options

Postby trc4949 » December 10th, 2011, 10:14 pm

When I had the restriction options not set to protect nav menus (unchecked) and then scrolled through the nav menus when logged out it was showing all pages despite the restricted tags. I am pretty sure that is what was happening.

Thanks for your feedback and comments :)
User avatar
trc4949
Registered User
Registered User
 
Posts: 15
Joined: March 6, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 2 guests

cron