Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 6 replies, 2 voices, and was last updated 7 years, 8 months ago by
Kera McHugh.
-
AuthorPosts
-
03/28/2016 at 12:13 am #370754
Kera McHugh
Participanthi Steve
I’m hoping you can direct me to how i can restrict the display of entries to only certain roles… eg. only “active members”. I’ve got Link installed…
03/28/2016 at 11:13 am #370771Steven Zahm
Keymaster@ Kera
Set the directory to require login to view. And then use the roles settings admin page to define which roles can view private and public entries. You would select the role assigned to your activate members.
Hope that helps!
03/28/2016 at 3:41 pm #370797Kera McHugh
Participantsadly that won’t help. i want the directory to be public. i just don’t want to have to manually keep track of which entries are actually valid.
i’ll do it manually for now. but maybe that’s a feature that could get onto the list?
“Display roles in Directory” checkbox somewhere?thanks.
03/29/2016 at 10:04 am #370892Steven Zahm
Keymaster@ Kera
Hmmm… could you give me a more detailed example of what you would like to accomplish?
03/29/2016 at 1:29 pm #370911Kera McHugh
Participanthm…
ok – so we have paid members (managed currently via s2member). And we have free members who aren’t really members, they have just registered to submit to our event calendar.
Paid – or previously paid – members have 2 possible roles, Active and Lapsed.
When they are in good standing they are active, when they don’t renew, they are lapsed.i would be super happy if the directory would automatically detect those connections entries that are attached to “Active” and ONLY display those ones, automatically… so, when a Lapsed member renews and becomes Active, I don’t have to think about making sure they are now back in the directory – or vice versa.
i have Link installed, so it seems like it should be just a query string to filter them… ? but i’m not a programmer…
i might be able to figure it out and make a custom function, and a custom template, but an admin check box sure would be easier :)does that make sense? maybe i’m dreaming.
03/29/2016 at 2:35 pm #370918Steven Zahm
Keymaster@ Kera
Ok, now I more fully understand. When you need is an action which sets an entry to unlisted when a user role switches from “Active” to “Lapsed” and visa versa. Something like this could work.
function cn_user_role( $user_id, $role, $old_roles ) { // Check to see if the user is linked to an entry, if not, bail. if ( ! $entry_id = get_user_meta( $user_id, 'connections_entry_id', TRUE ) ) return; // Change the entry status based on user role. switch ( $role ) { case 'lapsed': cnEntry_Action::visibility( 'unlisted', $entry_id ); break; case 'active': cnEntry_Action::visibility( 'public', $entry_id ); break; } } add_action( 'set_user_role', 'cn_user_role', 10, 2 );
03/29/2016 at 4:23 pm #370937Kera McHugh
ParticipantEXACTLY.
ok, i’ll try that.
thank you! -
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.