[SOLVED] CBSubs + K2 items

6 years 3 months ago - 6 years 3 months ago #301225 by akasharkbow
[SOLVED] CBSubs + K2 items was created by akasharkbow
Hi there

I'm trying to protect *almost* all K2 items, while still showing their categories, etc. From Krileon's post here:
www.joomlapolis.com/forum/255-developer-members-support/222013-solved-cb-subs-k2-category-content-support

I've managed to achieve this using the following:
option=com_k2&view=item

However, there are just a few K2 items I'd like to grant public access to.

It seems that it is possible to protect individual K2 items (eg using: option=com_k2&view=item&id=ARTICLE_ID_HERE)

Is there also a way to UN-protect individual K2 items? My site has hundreds of items on it, with new ones being added regularly, so it's not a practical solution for us to keep adding individual item IDs to our various plans.

Thanks in advance.

Please Log in to join the conversation.

6 years 3 months ago #301238 by krileon
Replied by krileon on topic CBSubs + K2 items

Is there also a way to UN-protect individual K2 items?

No, the protection can not be used in reverse.

My site has hundreds of items on it, with new ones being added regularly, so it's not a practical solution for us to keep adding individual item IDs to our various plans.

Best I can suggest is use REGEX and protect all ids except those listed in the REGEX. Example as follows.

option=com_k2&view=item&id=/^(?!(43|44|42)$).*$/

With the above it should match all ids except 43, 44, and 42. Replace those as needed and add more with | separating the ids.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: akasharkbow

Please Log in to join the conversation.

6 years 3 months ago #301274 by akasharkbow
Replied by akasharkbow on topic CBSubs + K2 items
Yep - this is just what I needed. A big thank you!
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.178 seconds

Facebook Twitter LinkedIn