Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

Rating Field (Stars - My Rating / Your Rating, PB Ranking)

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
12 years 2 months ago #215189 by krileon
No, users can reset their individual ratings of the user though using the button to the far left of the stars. I suppose if everyone reset their rating all at once it'd reset it back to 0. You could manually reset via database if needed though.


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.

12 years 2 months ago - 12 years 2 months ago #215199 by marriage_minded_man
Replied by marriage_minded_man on topic Re: Rating Field (Stars - My Rating / Your Rating, PB Ranking)
Im assuming you mean, setting up the field to allow multiple ratings? And then the user can vote again? But does this send a new additional vote or does it reset the original vote?

If I have multiple voting set to "no" then once I vote, there is no option to reset or vote again.


Also, when I change the words "Star" and "Stars", to something else, in the field manager where it says singular and plural, it wont update on the profile page.
Last edit: 12 years 2 months ago by marriage_minded_man.

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

12 years 2 months ago - 12 years 2 months ago #215206 by marriage_minded_man
Replied by marriage_minded_man on topic Re: Rating Field (Stars - My Rating / Your Rating, PB Ranking)

As stars or as an integer? You can re-output it elsewhere using substitutions in a delimiter field. The standard [FIELDNAME] will give you the average as an integer.


Ok, as integers worked, but how do I output the overall average rate as stars?

Or display them as a percentage, so maybe round them up or down and add a 0 at the end?
Last edit: 12 years 2 months ago by marriage_minded_man.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
12 years 2 months ago #215241 by krileon

Im assuming you mean, setting up the field to allow multiple ratings? And then the user can vote again? But does this send a new additional vote or does it reset the original vote?

When you use a "Your Rating" type field then other users rate you. Each user gets 1 rating. You can however enable multiple ratings if you want.

If I have multiple voting set to "no" then once I vote, there is no option to reset or vote again.

Correct, it's only present during the rating process. If you want them to rate again you need to enable multiple rating.

Ok, as integers worked, but how do I output the overall average rate as stars?

You'll need to use CB Query Field to query the database and calculate the average, but [FIELDNAME] is already the average based off the maximum number of stars.

Or display them as a percentage, so maybe round them up or down and add a 0 at the end?

You'd have to use CB Query Field and query the database for the rating average then use MYSQL functions on it to alter it as needed.


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.

12 years 2 months ago #215332 by marriage_minded_man
Replied by marriage_minded_man on topic Re: Rating Field (Stars - My Rating / Your Rating, PB Ranking)
Ok, if [fieldname] gives the average, I am trying to manipulate the average (eg. multiply by 10 in order to move the decimal over to the right). I'm trying to use CB query field for this, but can't seem to pull the average from the database.

When I use

SELECT `fieldname` FROM `#__comprofiler`

I just get "0" as the output on the profile.

How do I query the average through CB query field so I can use MYsql functions to manipulate it on the same query?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
12 years 2 months ago #215336 by krileon
You need to specify a user in your query. Example as follows.

SELECT `FIELD_NAME` FROM `#__comprofiler` WHERE `id` = '[user_id]'

There's no need to multiply by 10 as you can reformat, round, etc.. using MYSQL functions found below.

dev.mysql.com/doc/refman/5.6/en/functions.html


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

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

Moderators: beatnantkrileon
Powered by Kunena Forum