Community Support Forums — WordPress® ( Users Helping Users ) — 2011-03-26T21:36:12-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=2789 2011-03-26T21:36:12-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2789&p=8422#p8422 <![CDATA[Re: S2Member - List restricted pages]]> You're very welcome. Thanks for the follow-up.
prema wrote:
Thats Great!!
One more doubt.
Can we get these restricted IDs after a s2Member login ?
Coz, Before logging in its working fine, didnt give any output after login.

These options only change when you modify your s2Member configuration in the s2Member -> General Options panel. If you are seeing differences between being logged-in vs. not logged-in; I suspect the issue is originating from something other than the code sample above. So to answer your question, no. These option values do not change; even when a User/Member is logged-in.

Statistics: Posted by Jason Caldwell — March 26th, 2011, 9:36 pm


]]>
2011-03-26T07:03:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2789&p=8382#p8382 <![CDATA[Re: S2Member - List restricted pages]]>
One more doubt.

Can we get these restricted IDs after a s2Member login ?

Coz, Before logging in its working fine, didnt give any output after login.


!!!!

Statistics: Posted by prema — March 26th, 2011, 7:03 am


]]>
2011-03-26T04:09:53-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2789&p=8381#p8381 <![CDATA[Re: S2Member - List restricted pages]]> Thanks for the excellent question.
~ and thank you for bringing this to my attention Cristián.

s2Member stores this information in it's array of configured options.
Code:
<?php
$protected_level1_posts_array 
= preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_posts"]);
$protected_level1_pages_array = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"]);
$protected_level1_posts_pages_array = array_merge ($protected_level1_posts_array, $protected_level1_pages_array);

$my_protected_ids = $protected_level1_posts_pages_array;
?>
* Of course, you may need to alter this code ( or add to it )
if you have protected Posts/Pages at many different Membership Levels.

Statistics: Posted by Jason Caldwell — March 26th, 2011, 4:09 am


]]>
2011-03-25T06:28:36-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2789&p=8332#p8332 <![CDATA[Re: S2Member - List restricted pages]]>
How to get dynamically through code instead of hard coding like

$my_protected_ids = array(123,345,456,567);

?

Statistics: Posted by prema — March 25th, 2011, 6:28 am


]]>
2011-03-25T00:11:30-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2789&p=8317#p8317 <![CDATA[Re: S2Member - List restricted pages]]>
If you protected IDs 123,345,456,567 then your array could be

Code:
$my_protected_ids = array(123,345,456,567); 

Statistics: Posted by Cristián Lávaque — March 25th, 2011, 12:11 am


]]>
2011-03-24T03:51:44-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2789&p=8264#p8264 <![CDATA[Re: S2Member - List restricted pages]]> But how to get an array of restricted Post Titles ?

Statistics: Posted by prema — March 24th, 2011, 3:51 am


]]>
2011-03-23T21:01:56-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2789&p=8238#p8238 <![CDATA[Re: S2Member - List restricted pages]]>
You'll need to create a widget with some PHP to show that custom output.

You could update the list with an array containing the IDs of the pages that you protected and then foreach it to create the HTML list in the widget.

If you also want to display in some way if the current user has access to each page or not, you'd need to use some advanced query conditionals too: WP Admin -> s2Member -> API / Scripting -> Advanced Query Conditionals.

Hope that helps. :)

Statistics: Posted by Cristián Lávaque — March 23rd, 2011, 9:01 pm


]]>
2011-03-23T10:43:16-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2789&p=8212#p8212 <![CDATA[S2Member - List restricted pages]]>
I m using S2 member plugin & restricted few pages & posts.
How to display a list of restricted pages & posts in right side bar ?

Statistics: Posted by prema — March 23rd, 2011, 10:43 am


]]>