• Hello

    I’m using this wonderful plugin for a new project I’m working on, and I have stumbled upon a little problem, maybe a bug or it’s just me thinking on this the wrong way.

    Let me first try to explain what I’m trying to accomplish.

    On the site we are building there we be 3 different types of users:

    • public users WITHOUT login
    • normal users with login (role: subscriber)
    • and premium users (role: premium user)

    On the site we will host 3 different types of events:

    • events open for everyone
    • events open only for subscribers and premium users
    • events open only for premium users

    (actually there are more types, but I just wanted to keep it simple)

    To handle all the different roles and capabilities I’m also using a plugin named Role Scoper (https://www.ads-software.com/extend/plugins/role-scoper/)

    At the moment i have 5 events on my front page where 1 of them only should be visible to premium users.

    Here is my problem, when I visit the page without logging in, i should only see my 4 normal events, but I still can see my premium event.

    But when trying to enter my premium event, I get 404 page, which means it’s working. At first I thought it was my other plugin (Role Scoper) that was the cause of my problems but when I tried to enter my events page on mysite.com/events/ it only showed up 4 events.

    Here is the code that outputs my list on my front page.

    if (class_exists('EM_Events')) {
    	echo EM_Events::output(array(
    		'limit' => 10,
    		'format' => '<h4>#_EVENTLINK</h4>',
    	));
    }

    So here is my question: Is this intended? I mean why output a event which returns a 404? or am I doing this the wrong way? missing any arguments?

    Any feedback, help I can get is much appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi hixen,
    i have deal a lot with that issue under the role-scoper.
    If you read in the support forum of tthe RS plugin you can read a really long conversation between kevinB (the brilliant RS developer) and me.
    the problem of being possible for all users to read the posts you want to restrict is that, as kevinB explained, once a user has access to one category, he can see all post within that category because the RS is done to GRANT access to all posts that user has access.
    In my opinion is an strength of RS once you make it clear for yourself (it took me a lot). That means, with two restricted categories if a user has access to one of it, he could read all posts even if they have the two categories selected.
    So if you want to restrict the posts you can do it via editing the post-> restricting access to readers.
    Hope being helpful

    Thread Starter hixen

    (@hixen)

    doiches: are you sure we have the same issue? I do really appreciate your feedback and it’s good to know if I ever have 2 categories with different capabilities set to them.

    My problem is that EM_Events class outputs my private posts, let me give you and example.

    Using the Em_Events code above it outputs the following 5 events.

    • Lorem ipsum dolor sit amet (normal)
    • Consectetur adipiscing elit (normal)
    • Proin scelerisque varius dolor. (normal)
    • Sit amet vulputate sapien faucibus. (private)
    • Pellentesque non turpis massa. (normal)

    Here you see it outputs my private post Sit amet vulputate sapien faucibus.

    But if i’m using this WP_Query to call my posts, it outputs:

    <?php
    $loop = new WP_Query( array(
    	'post_type' => 'event',
    	'posts_per_page' => 5,
    )); ?>
    
    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    	<h1><?php the_title() ?></h1>
    <?php endwhile; ?>

    It outputs this list:

    • Lorem ipsum dolor sit amet (normal)
    • Consectetur adipiscing elit (normal)
    • Proin scelerisque varius dolor. (normal)
    • Pellentesque non turpis massa. (normal)

    And the reason i’m not using the WP_Query to get my events, it’s becuase I don’t know and is unable to find a way to get my featured events in the right order.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Events Manager] Keeps showing private events on the front page’ is closed to new replies.