Page 1 of 1

restriction options

PostPosted: December 9th, 2011, 11:28 am
by trc4949
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

Re: restriction options

PostPosted: December 9th, 2011, 8:03 pm
by trc4949
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.

Re: restriction options

PostPosted: December 10th, 2011, 8:31 pm
by Cristián Lávaque
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.

Re: restriction options

PostPosted: December 10th, 2011, 10:14 pm
by trc4949
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 :)