Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • hello guys

    I have the same problem. Below you can se my setting.
    Other issue: an article with only one vote and 5 stars is ranked first then an article with 10 votes all 5 stars!! Do you know why it prefers recent post? I can I have a real ranking that count the average as well?

    Thanks

    public function grs_legend($legend, $id)
    {
    if(parent::get_options(‘kksr_grs’))
    {
    $title = get_the_title($id);

    $best = parent::get_options(‘kksr_stars’);
    $score = get_post_meta($id, ‘_kksr_ratings’, true) ? get_post_meta($id, ‘_kksr_ratings’, true) : 0;

    if($score)
    {
    $votes = get_post_meta($id, ‘_kksr_casts’, true) ? get_post_meta($id, ‘_kksr_casts’, true) : 0;
    $avg = $score ? number_format((float)($score/$votes), 2, ‘.’, ”) : 0;
    $per = $score ? number_format((float)((($score/$votes)/5)*100), 2, ‘.’, ”) : 0;

    $leg = str_replace(‘[total]’, ‘<span property=”v:votes”>’.$votes.'</span>’, $legend);
    $leg = str_replace(‘[avg]’, ‘<span property=”v:average”>’.$avg.'</span>/<span property=”v:best”>’.$best.'</span>’, $leg);
    $leg = str_replace(‘[per]’,$per.’%’, $leg);
    $leg = str_replace(‘[s]’, $votes==1?”:’s’, $leg);

    $snippet = ‘<div xmlns:v=”http://rdf.data-vocabulary.org/#&#8221; typeof=”v:Review-aggregate”>’;
    $snippet .= ‘<span property=”v:itemreviewed” class=”kksr-title”>’ . $title . ‘</span>’;
    $snippet .= ‘<span rel=”v:rating”>’;
    $snippet .= ‘ <span typeof=”v:Rating”>’;
    $snippet .= $leg;
    $snippet .= ‘ </span>’;
    $snippet .= ‘</span>’;
    $snippet .= ‘</div>’;
    }

    hi guys,

    I read this post but i still have a problem with the rating.

    If a recent article gets just 1 vote and 5 stars it goes on top above the other articles that have 10 votes and 100% of average (all 10 voted 5 stars).

    How can i keep the most voted articles by average on top?

Viewing 2 replies - 1 through 2 (of 2 total)