Skip to Content Skip to Menu

CB List

  • SCLRWeb
  • SCLRWeb
  • OFFLINE
  • Posts: 30
  • Thanks: 3
  • Karma: 0
6 years 4 months ago #305782 by SCLRWeb
CB List was created by SCLRWeb
have a list where I'd like to see all Active subscribers..

I have two plans if someone is a part of them then want to list them in the list as active members.

Trick is the only field that would work is under
Community Builder > user management
and the heading isn't an option via sql - not sure where it is.

If equals Plan 1 or 2 the show in list
if anything else then don't show.

so based on that I'm not finding which table has the plan ID...
it wasn't showing in comprofiler table...
which table would I use for that query/ statement?

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 4 months ago #305814 by krileon
Replied by krileon on topic CB List
I assume by plans you mean from CBSubs. You can use Advanced filters to filter the users down to active subscribers. Examples as follows.

www.joomlapolis.com/forum/153-professional-member-support/237148-solved-how-to-create-a-list-showing-active-members-only#296273

Adjust the example queries as needed if you need the filtering to be plan specific.


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.

  • SCLRWeb
  • SCLRWeb
  • OFFLINE
  • Posts: 30
  • Thanks: 3
  • Karma: 0
6 years 4 months ago #305816 by SCLRWeb
Replied by SCLRWeb on topic CB List
Pretty close
However i only want to show where plan is 1 or 2 vs any active plans.

reason is, there are sponsor / reciprocal plans that don't need to be listed
but now that I'm seeing the layout I might be able to make it work -

#__cbsubs_subscriptions - looking in here - but not sure if I need the count if ... most likely I will..

..plan_id should cover what I'm after but also status has to = A
which makes sense now looking at the table.

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 4 months ago #305818 by krileon
Replied by krileon on topic CB List

However i only want to show where plan is 1 or 2 vs any active plans.

You'll need to modify the query then and extend it with plan_id check in its WHERE statement. Should be all you'll need to change in the query.


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.

  • SCLRWeb
  • SCLRWeb
  • OFFLINE
  • Posts: 30
  • Thanks: 3
  • Karma: 0
6 years 4 months ago - 6 years 4 months ago #305820 by SCLRWeb
Replied by SCLRWeb on topic CB List
trying but haven't messed with this in awhile..
Code:
( ( SELECT COUNT(*) FROM `#__cbsubs_subscriptions` AS sub WHERE sub.`user_id` = u.`id` AND sub.`status` = 'A' AND sub.`plan_id` = '1' OR sub.`plan_id` = '2' ) >= 1)

doesn't work however this does - only
Code:
( ( SELECT COUNT(*) FROM `#__cbsubs_subscriptions` AS sub WHERE sub.`user_id` = u.`id` AND sub.`status` = 'A' AND sub.`plan_id` = '1' ) >= 1)

but doesn't include plan ID 2 members - which I'm missing the way to do it..

was looking at this:
type of sql line
Code:
AND plan_id IN (2, 5, 7, 9)

like this:
Code:
( ( SELECT COUNT(*) FROM `#__cbsubs_subscriptions` AS sub WHERE sub.`user_id` = u.`id` AND sub.`status` = 'A' AND sub.`plan_id` IN (1, 2)) >= 1)

Think this is working...

does it look accurate to you?
Last edit: 6 years 4 months ago by SCLRWeb.

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 4 months ago #305884 by krileon
Replied by krileon on topic CB List
Your final query should work fine.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum