Community Support Forums — WordPress® ( Users Helping Users ) — 2011-09-21T01:21:25-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14398 2011-09-21T01:21:25-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=38857#p38857 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> Statistics: Posted by msaari — September 21st, 2011, 1:21 am


]]>
2011-09-15T14:16:17-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=37266#p37266 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> array() instead of a string, starting with s2Member v110912+. So this change WILL impact the code sample I gave you before on installations running s2Member v110912+.

Here is an updated code sample for you that covers both versions.
Please let me know if you have any questions/concerns.

Code:
<?php
$alt_view_protect 
= $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["filter_wp_query"];

if (version_compare (WS_PLUGIN__S2MEMBER_VERSION, "110912", ">="))
        $completely_hide_protected_search_results = (in_array ("all", $alt_view_protect) || in_array ("searches", $alt_view_protect)) ? true : false;
else /* Backward compatibility with versions of s2Member, prior to v110912. */
        $completely_hide_protected_search_results = (strpos ($alt_view_protect, "all") !== false || strpos ($alt_view_protect, "searches") !== false) ? true : false;

if (is_permitted_by_s2member (123))
    {
        // Show title and excerpt, even full content if you like.
        // The current User/Member has access to Post or Page ID: 123.
    }
else if (!is_permitted_by_s2member (123) && $completely_hide_protected_search_results === false)
    {
        // Show title and excerpt. Alt View Protection is NOT enabled for search results. However, do NOT show full content body.
        // The current User/Member has no access to this content, but Alt View Protection is NOT enabled for search results.
        // So in this case, s2Member site owners would expect to see protected titles/excerpts in search results.
    }
else /* Do NOT show the search result at all. */
    {
        // Hide this search result completely.
        // The User does not have access to this content, and Alt View Protection IS enabled for search results.
    }
?>

Statistics: Posted by Jason Caldwell — September 15th, 2011, 2:16 pm


]]>
2011-09-04T14:50:37-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=33986#p33986 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]>
msaari wrote:
Great. Relevanssi Premium 1.6 now has upgraded s2member support and the free version will have it too in the next release.


Great! so cool to see 2 awesome plugins working nicely together! kudos to msaari!

I reactivated Relevanssi , and it displays excerpts from protected posts according to my settings in s2member!

Statistics: Posted by arthomas — September 4th, 2011, 2:50 pm


]]>
2011-08-28T02:05:08-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=33170#p33170 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]>

Statistics: Posted by Cristián Lávaque — August 28th, 2011, 2:05 am


]]>
2011-08-27T21:30:56-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=33135#p33135 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> Statistics: Posted by msaari — August 27th, 2011, 9:30 pm


]]>
2011-08-27T15:58:59-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=33104#p33104 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> Hey.. Thanks for the follow-up.
msaari wrote:
With the option 2 ("Show title and excerpt."), is showing the results of get_the_excerpt() ok?
Certainly, that would be just fine to do that.

Statistics: Posted by Jason Caldwell — August 27th, 2011, 3:58 pm


]]>
2011-08-27T12:44:11-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=33077#p33077 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> Statistics: Posted by msaari — August 27th, 2011, 12:44 pm


]]>
2011-08-24T12:28:09-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=32793#p32793 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> Statistics: Posted by msaari — August 24th, 2011, 12:28 pm


]]>
2011-08-23T19:05:39-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=32712#p32712 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> Please use this one instead:
See: viewtopic.php?f=4&t=14398&p=37266#p37266


Hi there. Thanks for integrating with s2Member. Great to see that!

Here is how I would handle this in your integration, for maximum compatibility with s2Member.

s2Member's Alternative View Protection allows site owners to choose whether they want protected content excerpts seen inside search results and/or feeds. As a plugin developer, you can test the value of the configured option with this global variable:
Code:
$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["filter_wp_query"] 

Possible values include: all|searches|feeds|searches,feeds
( this value is set immediately, as soon as s2Member is loaded by WordPress )

Here is a code sample that might help to explain things better for you:
Code:
<?php
$alt_view_protect 
= $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["filter_wp_query"];
$completely_hide_protected_search_results = (strpos($alt_view_protect, "all") !== false || strpos($alt_view_protect, "searches") !== false) : true : false;

if(
is_permitted_by_s2member(123))
    {
        // Show title and excerpt, even full content if you like.
        // The current User/Member has access to Post or Page ID: 123.
    }
else if(!is_permitted_by_s2member(123) && $completely_hide_protected_search_results === false)
    {
        // Show title and excerpt. Alt View Protection is NOT enabled for search results. However, do NOT show full content body.
        // The current User/Member has no access to this content, but Alt View Protection is NOT enabled for search results.
        // So in this case, s2Member site owners would expect to see protected titles/excerpts in search results.
    }
else /* Do NOT show the search result at all. */
    {
        // Hide this search result completely.
        // The User does not have access to this content, and Alt View Protection IS enabled for search results.
    }
?>
* See also, docs here: viewtopic.php?f=40&t=12453&src_doc_v=110815#src_doc_is_permitted_by_s2member%28%29

Statistics: Posted by Jason Caldwell — August 23rd, 2011, 7:05 pm


]]>
2011-08-21T13:18:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=32580#p32580 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> Statistics: Posted by msaari — August 21st, 2011, 1:18 pm


]]>
2011-08-19T22:04:08-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=32422#p32422 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]>
msaari wrote:
Now Relevanssi is showing posts if s2member says it should.


Does it mean Relevanssi now works depending on the s2Member Alternative Views setting?

Statistics: Posted by Cristián Lávaque — August 19th, 2011, 10:04 pm


]]>
2011-08-19T12:27:05-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=32398#p32398 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]>
Jason, is there such an option?

Statistics: Posted by arthomas — August 19th, 2011, 12:27 pm


]]>
2011-08-19T12:21:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=32397#p32397 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]>
I'm currently using is_permitted_by_s2member() to check whether the user should be able to see the post. As far as I can tell that is the only function that does what I need. If there's a function that tells whether the user is allowed to see the excerpt, then please let me know and I can fix it. Now Relevanssi is showing posts if s2member says it should.

Statistics: Posted by msaari — August 19th, 2011, 12:21 pm


]]>
2011-08-19T12:03:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=32395#p32395 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]>
msaari wrote:
If you want to adjust the way protected posts are managed, you can write a function that hooks to relevanssi_post_ok hook. Copy (and unhook) the default function and remove the part about s2member, that will make Relevanssi work like it did before.


Thanks for the quick reply,

Honestly, I have no clue how to it, I am not that advanced.

But shouldent it comply with the s2member settings? like the default Word Press search?

For now I have deactivated Relevanssi, I want my users to see search results, Just not the full post, Otherwise they would think that we dont have the content they are looking for, because currently it simply returns a "no results found" message.

Statistics: Posted by arthomas — August 19th, 2011, 12:03 pm


]]>
2011-08-19T11:36:47-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=32394#p32394 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> Statistics: Posted by msaari — August 19th, 2011, 11:36 am


]]>
2011-08-19T11:23:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=32393#p32393 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]>
The updated version of Relevansi is not showing any restricted page results now, even though I have set "Alternative View Protection" to NONE.

I want restricted search results to be shown (they are only excerpts)

Statistics: Posted by arthomas — August 19th, 2011, 11:23 am


]]>
2011-08-15T14:42:15-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=31554#p31554 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]>

Statistics: Posted by Cristián Lávaque — August 15th, 2011, 2:42 pm


]]>
2011-08-14T06:06:06-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=30737#p30737 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]>
For every search result document (or category page), Relevanssi checks using 'is_permitted_by_s2member' whether the current user can see the result and displays or hides them according to that. This is automatic and requires no adjustment of settings or anything, Relevanssi triggers this on if the function is present.

Thanks for good documentation, not every plugin has API documentation as good as this.

Statistics: Posted by msaari — August 14th, 2011, 6:06 am


]]>
2011-08-13T12:59:03-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=30676#p30676 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]>

Statistics: Posted by Cristián Lávaque — August 13th, 2011, 12:59 pm


]]>
2011-08-13T04:36:14-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=30667#p30667 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> Statistics: Posted by tasitasi — August 13th, 2011, 4:36 am


]]>
2011-08-13T01:43:53-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=30663#p30663 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> Statistics: Posted by tasitasi — August 13th, 2011, 1:43 am


]]>
2011-08-12T22:30:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=30653#p30653 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> Statistics: Posted by tasitasi — August 12th, 2011, 10:30 pm


]]>
2011-08-12T22:13:16-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=30652#p30652 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]> viewtopic.php?f=4&t=14398#p30397

Statistics: Posted by Cristián Lávaque — August 12th, 2011, 10:13 pm


]]>
2011-08-12T21:59:58-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=30648#p30648 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]>
Please help!

Statistics: Posted by tasitasi — August 12th, 2011, 9:59 pm


]]>
2011-08-10T18:19:43-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14398&p=30453#p30453 <![CDATA[Re: Relevanssi version 2.9.7 and s2member version 110731]]>
I have noticed this problem occurs with wp search as well.

Statistics: Posted by tasitasi — August 10th, 2011, 6:19 pm


]]>