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™

Relevanssi version 2.9.7 and s2member version 110731

s2Member Plugin. A Membership plugin for WordPress®.

Re: Relevanssi version 2.9.7 and s2member version 110731

Postby Jason Caldwell » September 15th, 2011, 2:16 pm

Hi there. I'm posting a friendly update on this thread, because s2Member's option value for this behavior is now changed to an 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: Select all
<?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.
    }
?>
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Relevanssi version 2.9.7 and s2member version 110731

Postby msaari » September 21st, 2011, 1:21 am

Thanks, I've now updated Premium with this fix and the free Relevanssi will get it in the next version.
User avatar
msaari
Registered User
Registered User
 
Posts: 9
Joined: August 14, 2011

Previous

Return to s2Member Plugin

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron