Skip to Content Skip to Menu

View Profile and CB Subs

  • stuntlist
  • stuntlist
  • OFFLINE
  • Posts: 93
  • Thanks: 4
  • Karma: 0
10 years 9 months ago - 10 years 7 months ago #240509 by stuntlist
View Profile and CB Subs was created by stuntlist
Hi,

I have a user list which shows all the users in my site. Each user in the list has an avatar, their name and a link to View Profile, whether they have an active CB Subs subscription or not.

The behaviour that I am trying to accomplish is that if you click the View Profile link and the person has an active valid subscription you go to their profile page, but if they have not bought a subscription or their subscription has expired the user gets taken to a page that says the user is inactive. Is there a CB Plugin that I could use that will help accomplish this behaviour rather than having to hack core files to do it?

Would the "CB Auto Actions plugin" help with this? if so, how would you set it up?

Thank you.
Last edit: 10 years 7 months ago by stuntlist. Reason: found a problem

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 9 months ago #240568 by krileon
Replied by krileon on topic View Profile and CB Subs
I recommend filtering your userlist to only display users with an active subscription as it'd be significantly more user friendly. Please see the below topic on how to do this.

www.joomlapolis.com/forum/277-cbsubs-gpl-support/224108-solved-cb-list-management-a-cbsubs#239628


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.

  • stuntlist
  • stuntlist
  • OFFLINE
  • Posts: 93
  • Thanks: 4
  • Karma: 0
10 years 8 months ago #240862 by stuntlist
Replied by stuntlist on topic View Profile and CB Subs
Hi,

Agreed that it would, but that is not the functionality that the client wants. He wants unsubscribe members to show in the list, but not to be able to get more information if they are not subscribed.

So any ideas how to do this?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 8 months ago #240867 by krileon
Replied by krileon on topic View Profile and CB Subs
Best I can suggest is use a redirect action on the profile display trigger. You'll need to use a CB Query Field to query for an active subscription. You'd then condition against the query field and if they don't have an active subscription redirect away.

The below query for example will count how many active subscriptions they have.

Code:
SELECT COUNT(*) FROM `#__cbsubs_subscriptions` WHERE `user_id` = '[user_id]' AND `status` = 'A'

The below does the same except for a specific plan.

Code:
SELECT COUNT(*) FROM `#__cbsubs_subscriptions` WHERE `user_id` = '[user_id]' AND `id` = PLAN_ID_HERE AND `status` = 'A'


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.

  • stuntlist
  • stuntlist
  • OFFLINE
  • Posts: 93
  • Thanks: 4
  • Karma: 0
10 years 8 months ago #240951 by stuntlist
Replied by stuntlist on topic View Profile and CB Subs
Hi Kyle,

I added a Query field called cb_activesubscriptions with the first SQL query you have below. I set it to show in my Admin tab. But when I look at any users, that field is not showing up and when I look in the database, there isn't a cb_activesubscriptions field for any of the users in the com_comprofiler table. The cb_activesubscriptions field is published.



In the Auto Action I have the condition if cb_activesubscriptions <= 1 to do the redirect but it always comes back as the condition failed even though the user has 1 active subscription. I set the User field to Automatic.



Thank you for your help with this.
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 8 months ago #240983 by krileon
Replied by krileon on topic View Profile and CB Subs
Your left conditional is just a string, it is not a valid substitution. It must be surrounded with brackets (e.g. [FIELD_NAME]). Please see the below tutorial for substitution usage information.

www.joomlapolis.com/support/tutorials/107-use-cases/18353-using-substitutions-throughout-cb


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