简体   繁体   English

评论中所有评分的平均分数

[英]Average Score of all ratings in comments

I have a rating system in comments, for each comment user can rate 1-5 Stars. 我在评论中有一个评分系统,每个评论用户可以评分1-5星。

Now, what I want is the average ratings of the comments for each post. 现在,我想要的是每个帖子的评论的平均评分。

Here is the link to the code file related to My rating System. 这是与我的评分系统相关的代码文件的链接。 Current Users can rate and comment, but I want the average of all comment ratings in that post. 当前用户可以评分和评论,但是我想要该帖子中所有评论评分的平均值。 And this is a custom Post type. 这是一个自定义的Post类型。

Here's the link: http://pastebin.com/LcRyjSPK 这是链接: http : //pastebin.com/LcRyjSPK

From glancing at your code it seems the average rating should already be available. 通过浏览您的代码,似乎平均评级应该已经可用。 Is there a specific problem you're running into trying to access that data...? 您在尝试访问该数据时是否遇到特定问题...? Is it not there, incorrect, are you getting php errors? 它不在那里,不正确,您是否收到php错误?

More info please. 请提供更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM