Home › Forums › Calendar Products › Events Calendar PRO › Calendar for logged in users only except one category
- This topic has 4 replies, 3 voices, and was last updated 10 years, 1 month ago by
Josh.
-
AuthorPosts
-
April 11, 2016 at 4:40 am #1100710
Joachim
ParticipantHi,
I just read through your info regarding redirects for users not logged in here;
https://theeventscalendar.com/knowledgebase/frontend-roles-and-permissions/What I need is a function that only makes a specific event category public and makes the rest of the calendar private (logged in only).
Something like “IF event category is not category_A -> redirect to login page if not logged in ELSE all good, display the calendar”.
Any help would be highly appreciated!
Best
JKApril 11, 2016 at 11:13 am #1100892Thomas
Participant+1
We have been looking for a way of restricting access to certain categories, too.
(as we use the same calendar for different groups)April 11, 2016 at 6:09 pm #1101124Josh
ParticipantHey,
Thanks for reaching out to us!
It may be a little tricky to utilize a redirect for a use case such as this. You could potentially have a good solution with a redirect here, however my initial assumption would be that you might get headers already sent errors when trying to run the redirect after handling the conditionals for the events.
An alternative may be to hook into the event publish and set the events assigned to the categories that you would like private as private status. This way, users that have access (you can filter that access as well to subscribers if needed as well) would be able to see those private events within the calendar views while everyone else would just see the public events.
I’m sorry I wasn’t able to give you a direct solution here however I hope it helps to get you pointed in the right direction.
Thanks!
April 13, 2016 at 4:38 am #1101851Thomas
ParticipantAlright..
thx for your reply Josh, I wasn’t sure if I understood your suggestion exactly but
I think I found a solution by using a plugin that allows me to add roles to the categories.
Also I am using one of the regular post fields to check if the user is allowed to view this event before the html content in the calendar is rendered. (by comparing the role with that specific post field)Seems to work so far, but we still have to test this in detail.
April 13, 2016 at 6:04 am #1101883Josh
ParticipantHey Thomas,
Awesome! I’m glad you were able to find an approach that works for what you’re needing for this project.
I’ll go ahead and close this thread for now. If you have any further questions regarding our plugin, please don’t hesitate to open a new one.
Thanks!
-
AuthorPosts
- The topic ‘Calendar for logged in users only except one category’ is closed to new replies.
