Community Support Forums — WordPress® ( Users Helping Users ) — 2010-08-27T11:33:33-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=522 2010-08-27T11:33:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=522&p=2604#p2604 <![CDATA[Re: Permissions when pulling listings from site]]> Hi John. This has been implemented in s2Member v3.2.3 ( to be released soon ).
@COMPLETED/TODO :: add API functions.

~ Here is a beta release if you'd like to start early.
s2member-3.2.3-beta-1.zip
( check the Changelog for details on this new functionality )
( inside /s2member/readme.txt )

Statistics: Posted by Jason Caldwell — August 27th, 2010, 11:33 am


]]>
2010-08-18T12:31:30-05:00 http://www.primothemes.com/forums/viewtopic.php?t=522&p=2470#p2470 <![CDATA[Re: Permissions when pulling listings from site]]>
Jason Caldwell wrote:
Hi John. I'm very sorry for my extremely delayed response to this question.


No worries about the delay, I've been slammed myself. :)

I think I'll wait it out for the next release since I've got some other things to do (like testing PayPal Pro). Knowing that you're adding this is awesome, because I think it will really help expand the functionality of the the plugin.

Statistics: Posted by johnmont — August 18th, 2010, 12:31 pm


]]>
2010-08-17T15:01:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=522&p=2389#p2389 <![CDATA[Re: Permissions when pulling listings from site]]> Hi John. I'm very sorry for my extremely delayed response to this question.

Thanks for the great suggestion.

No, this is NOT possible yet, at least not without custom coding.
However, I'm pushing this up to the tippy top of our TODO list.

@C/TODO :: add API functions:
s2member_is_category_protected([ cat ID ])
s2member_is_single_protected([ post ID])
s2member_is_uri_protected([ URI ])
etc, etc.
or some variation of these concepts.


You can expect to see this feature added in the very next release.
In the mean time, I would suggest that you have a look at these files:

Code:
/includes/functions/catg-level-access.inc.php
/includes/functions/post-level-access.inc.php

Using the same logic as you'll see in those files,
you could build a custom function that would behave the way you need.

Statistics: Posted by Jason Caldwell — August 17th, 2010, 3:01 pm


]]>
2010-08-17T10:23:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=522&p=2346#p2346 <![CDATA[Re: Permissions when pulling listings from site]]>
if (MEMBER CANNNOT ACCESS CATEGORY) continue; <<<<---- check and skip
if (MEMBER CANNNOT ACCESS POST) continue; <<<<---- check and skip

Is this possible outside the loop?

Statistics: Posted by johnmont — August 17th, 2010, 10:23 am


]]>
2010-08-07T10:45:07-05:00 http://www.primothemes.com/forums/viewtopic.php?t=522&p=2203#p2203 <![CDATA[Permissions when pulling listings from site]]>
One aspect of my site is creating an XML listing for an external application (which would be logged into the site via the login mechanism). This would be a list of ids that the application can then build a menu for showing what is available. An example URL the app requests would be:

http://site.com/getListing?catids=13,15,16

The problem is that I don't see a way to determine if a particular post or category is restricted. I've included my php code below, with <<<<----- signifying where I want to do a check.

Any suggestions...and sorry if this is plainly covered somewhere.

Code:
foreach( $catids as $catID ) {
   
   if (MEMBER CANNNOT ACCESS CATEGORY) continue;   <<<<---- check and skip
   $args = array( 'posts_per_page' => $numposts, 'cat' => $catID, 'post_type' => array( 'post', 'gallery','ad') ); 
   $my_query = new WP_Query($args);
   while ($my_query->have_posts()) : $my_query->the_post();
          if (MEMBER CANNNOT ACCESS POST) continue;   <<<<---- check and skip
          echo  $post->ID;
   endwhile;
}


If I can pass something on to query_args, I can do this as well -- using something like this:
Code:
  $args = array( 'posts_per_page' => $numposts, 'cat' => $catID); 
  $my_query = new WP_Query($args);

Statistics: Posted by johnmont — August 7th, 2010, 10:45 am


]]>