Skip to Content Skip to Menu

[SOLVED] fields with several cumulative values

  • mfe13
  • mfe13
  • OFFLINE
  • Posts: 572
  • Thanks: 26
  • Karma: 5
10 years 9 months ago - 10 years 9 months ago #239613 by mfe13
Hello,

I searched the forum and substitutions but I didn't find what I want.

I want to create a "popularity" field based on several values.

Is it possible to add different values ​​and show the results in a single field delimiter.
For example, adding the value of Hits(eg 10) + Connections or AUP value (eg 15) to show a result of 25 ?

Thanks
Last edit: 10 years 9 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 9 months ago #239614 by krileon
Replied by krileon on topic fields with several cumulative values
You'll need to use CB Query Field for that. In the future we'll have a CB Code Field plugin that would probably be a better approach. For now the below query example for CB Query Field should do what you're wanting.

Code:
SELECT ( `hits` + `connections` ) FROM `#__comprofiler` WHERE `id` = '[user_id]'


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.

  • mfe13
  • mfe13
  • OFFLINE
  • Posts: 572
  • Thanks: 26
  • Karma: 5
10 years 9 months ago #239625 by mfe13
Replied by mfe13 on topic fields with several cumulative values
Thanks,

I created query field (cb_pop)with code and after, I created customer field with
Code:
[cb:if cb_pop>="0" and cb_pop<="300"]option 1[/cb:if] OR [cb:if cb_pop<="300" and cb_pop>="0"]option 1[/cb:if]

but it don't works !are you sure these two values ​​can be combined?

Thanks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 9 months ago - 10 years 9 months ago #239626 by krileon
Replied by krileon on topic fields with several cumulative values
Check the query field on the users profile and ensure it outputs the expected value. Don't go straight to substitution usage. Please always test your usages before moving forward. Also yes they can be added as they're both integer columns.


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.
Last edit: 10 years 9 months ago by krileon.

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

  • mfe13
  • mfe13
  • OFFLINE
  • Posts: 572
  • Thanks: 26
  • Karma: 5
10 years 9 months ago #239631 by mfe13
Replied by mfe13 on topic fields with several cumulative values
Connections and hits are published, and I already used their substitution elsewhere.
No, it does not deliver value, but only the name of the field [cb_pop]

Don't go straight to substitution usage.


I tried to get the result of the query in another delimiter but it changes nothing.

Thanks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 9 months ago #239654 by krileon
Replied by krileon on topic fields with several cumulative values
If the Query Field it self is not outputting your expected value on profile then a substitution for it isn't going to output either. View a users profile directly and view the query fields actual output. If still nothing then you could have an error in the query. Enable debug mode and maximum error reporting in Joomla global configuration then view your profile to see if any fatal errors are occurring 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.

Moderators: beatnantkrileon
Powered by Kunena Forum