<?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
Statistics: Posted by arthomas — September 4th, 2011, 2:50 pm
Statistics: Posted by Cristián Lávaque — August 28th, 2011, 2:05 am
Certainly, that would be just fine to do that.msaari wrote:
With the option 2 ("Show title and excerpt."), is showing the results of get_the_excerpt() ok?
Statistics: Posted by Jason Caldwell — August 27th, 2011, 3:58 pm
$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["filter_wp_query"]
<?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.
}
?>
Statistics: Posted by Jason Caldwell — August 23rd, 2011, 7:05 pm
Statistics: Posted by Cristián Lávaque — August 19th, 2011, 10:04 pm
Statistics: Posted by arthomas — August 19th, 2011, 12:27 pm
Statistics: Posted by msaari — August 19th, 2011, 12:21 pm
Statistics: Posted by arthomas — August 19th, 2011, 12:03 pm
Statistics: Posted by arthomas — August 19th, 2011, 11:23 am
Statistics: Posted by Cristián Lávaque — August 15th, 2011, 2:42 pm
Statistics: Posted by msaari — August 14th, 2011, 6:06 am
Statistics: Posted by Cristián Lávaque — August 13th, 2011, 12:59 pm
Statistics: Posted by Cristián Lávaque — August 12th, 2011, 10:13 pm
Statistics: Posted by tasitasi — August 12th, 2011, 9:59 pm
Statistics: Posted by tasitasi — August 10th, 2011, 6:19 pm