Skip to Content Skip to Menu

Cbsubs: show CB field to guest hide to Subscribers

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 594
  • Thanks: 15
  • Karma: 4
11 years 7 months ago - 11 years 7 months ago #213312 by dotcom22
hello

I would like show publicly a field and hide to all subscribers plans. In practice that mean when users are logged-in they must not see the field.

I play many time with all Fields/Tab restriction (using related CBsubs plugin) but I'm unable to get this setup. For example if a set all plans restriction in the section "Field visibility by Viewer's Subscriptions" this work when users are logged-in but of course the field is hidden for public users.

If I choose all available plans inside "Availability depending on profile Owner's subscriptions" this don't change nothing.


any clue ?

thank

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins
Last edit: 11 years 7 months ago by dotcom22.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 68629
  • Thanks: 9110
  • Karma: 1434
11 years 7 months ago #213316 by krileon
CBSubs doesn't have reverse access controls (take away something rather instead of add).

Best I can suggest is use CB Query Field to check the database for the viewing users user_id to see if they have an active subscription. Then use a delimiter field with an IF substitution to check against the query field. If they have a subscription (maybe count the rows, etc..) then hide the field.

Can also try accomplishing this with view access levels by adding users to a paid usergroup, then create a view access level for that usergroup, next use a delimiter field with an IF substitution checking if that view access level exists for the viewing user and if it doesn't then display the contents.


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.

Please Log in or Create an account to join the conversation.

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 594
  • Thanks: 15
  • Karma: 4
11 years 7 months ago - 11 years 7 months ago #213328 by dotcom22
Thank for suggestion. I used a IF substitution for let me display my field only to Guest and hide it to all others connected users. I spent almost two hours in testing for get the correct substitution code who is:

[cb:if user="#me" user_id="0"]I am A GUEST.[/cb:if]

The one present on your tutorial who seem to make the same job is:

[cb:if user="#displayedOrMe" user_id<="0"]I am A GUEST.[/cb:if]

but this one don't work for me... In found the other code in a old forum topic. In fact I don't understand also how the others following parameters work and in which case we are supposed to use it:

#me, #displayed, #displayedOrMe

What is the difference ?

Other question:

Any operator are available for check if a field is empty when using substitution ? Your tutorial make mention to only those operators:

Operators
and
or
= (equal)
>= (greater than or equal)
<= (less than or equal)
!= (not equal)
=~ (is regex)
!~ (is not regex)
&& (and)
|| (or)
includes (must have leading and trailing space)
!includes (must have leading and trialing space)

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins
Last edit: 11 years 7 months ago by dotcom22.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 68629
  • Thanks: 9110
  • Karma: 1434
11 years 6 months ago #213443 by krileon

but this one don't work for me... In found the other code in a old forum topic. In fact I don't understand also how the others following parameters work and in which case we are supposed to use it:

Below should work.

[cb:if user="#me" user_id<="0"]I am A GUEST.[/cb:if]

#me

User viewing (your self).

#displayed

User displayed (users profile you're viewing). Doesn't work anywhere but profile.

#displayedOrMe

Either/or depending on the situation.


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.

Please Log in or Create an account to join the conversation.

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 594
  • Thanks: 15
  • Karma: 4
11 years 6 months ago #213463 by dotcom22
Ok....

Can you reply to my other question related to a possible use of empty/not empty operator ?

thank

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 68629
  • Thanks: 9110
  • Karma: 1434
11 years 6 months ago #213524 by krileon
You'd just do !="" or ="". There's no operator specific to the value being empty.


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: dotcom22

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum

Facebook Twitter LinkedIn