number of raing

13 years 3 months ago #149427 by Nuzzina
number of raing was created by Nuzzina
Is possibile to show also the number of votes near the Rating in Stats List?

Please Log in to join the conversation.

13 years 3 months ago #149484 by krileon
Replied by krileon on topic Re:number of raing
Nuzzina wrote:

Is possibile to show also the number of votes near the Rating in Stats List?

No, the number of votes is not shown.

You could use documentation subscriber incubator project CB Query Field which allows creating fields whose results are from a database query. This means you could make a query for the user (which supports substitutions) using this new fieldtype to count the amount of votes and simply display it on profile.


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 to join the conversation.

13 years 3 months ago #149560 by Nuzzina
Replied by Nuzzina on topic Re:number of raing

This means you could make a query for the user (which supports substitutions) using this new fieldtype to count the amount of votes and simply display it on profile.

Make a query? How?

Please Log in to join the conversation.

13 years 3 months ago #149568 by krileon
Replied by krileon on topic Re:number of raing

Make a query? How?

By reviewing the database and formulating a query to grab the vote count. Example as follows.

[code:1]
SELECT COUNT(*) FROM `#__comprofiler_ratingfield_log` WHERE `rateduserid` = [user_id]
[/code:1]

This would give you the number of votes a user has received. This database table is shared among all "Rating" fields, but shouldn't matter as long as the only rating field you're using is the one from ProfileBook. Otherwise you'd need to extend the where to include field ID as follows.


[code:1]
SELECT COUNT(*) FROM `#__comprofiler_ratingfield_log` WHERE `fieldid` = FIELD_ID_HERE AND `rateduserid` = [user_id]
[/code:1]


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 to join the conversation.

13 years 3 months ago #149586 by Nuzzina
Replied by Nuzzina on topic Re:number of raing
my case is the second... so, how I find the userid?

Please Log in to join the conversation.

13 years 3 months ago #149598 by krileon
Replied by krileon on topic Re:number of raing
Nuzzina wrote:

my case is the second... so, how I find the userid?

You don't find the user_id, if you use as suggested documentation subscriber incubator project CB Query Field then [user_id] substitution will add the user_id for you. If you're developing this query elsewhere then you'll need to find the Joomla API to obtain the user_id (or CBs API if inside of a CB plugin).


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.173 seconds

Facebook Twitter LinkedIn