• Hi

    I have come accress an old post which seems to be still an open issue
    https://www.ads-software.com/support/topic/plugin-relevanssi-a-better-search-search-displaying-member-only-pages

    I am also using WLM and Relevanssi together and we found the same issue when looking at the search results

    I have added the following code to relevanssi_default_post_ok function, the only issue is that in each site you need to write yourself the function UserCanViewPost that determines if the user can view the post or not since WLM does not have this in it’s API

    // first check if WLM is activated
    $mywlmapi= new WLMAPI();
    if ( method_exists($mywlmapi, ‘GetLevels’) ) {

    // now lets finds out the user levels
    $current_user = wp_get_current_user();
    $levels = $mywlmapi-> GetUserLevels($current_user->ID);

    // finds out the post levels
    $postlevels = $mywlmapi->GetPostLevels($doc);

    // now we have two arrays and we need to check if user can view post
    if (!UserCanViewPost($postlevels,$levels)) $post_ok = false;
    }

    If more info is need you are welcome to drop me an email

    https://www.ads-software.com/extend/plugins/relevanssi/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Thanks, this is useful. If you don’t mind, I’ll post this to the Relevanssi.com Knowledge Base.

    Thread Starter CreativeMindsSolutions

    (@creativemindssolutions)

    Sure

    Just to give an idea of what the UserCanViewPost is all about

    Since WLM does not include in its API any functions which support this action (although it should be trivial), we need to compare the post levels with the user level and decide if the user can view the post

    The compare need to take into account the hierarchy of each level, so it could be that although the post levels are different from the user levels, the user levels are higher and contain permission to view the post level

    Hey,

    I have had major problems with WLM and Relevanssi. I am not a fan of WLM but am using it on someone else’s site. However, now Relevanssi does not work. I have tried adding the code above to version 3.1.5 in the common.php under the relevanssi_default_post_ok function.

    If anyone could clue me in to get this to work it would be great. Relavanssi won’t index anything on the site. I have tried upgrading, dropping the tables, etc.

    Whenever I deactivate WLM and try to build the index I get hundreds of preg_replace errors.

    Any ideas? I appreciate your help. Not really any of your problem, but this is the closest thing I have found to a solution.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Relevanssi – A Better Search] Relevanssi and Wishlist Member’ is closed to new replies.