Forums

GD Star Rating - weighting (6 posts)

  1. iperez_genius
    Member
    Posted 2 years ago #

    I have n oticed that even though i have added a weighting to my rated values they aren't computing properly...

    Do i need to turn something on?

    Ilan

  2. Milan Petrovic
    Member
    Posted 2 years ago #

    Values for weights should be between 0 and 2, that's 100% bellow and above the normalized value of 1. It's calculated like this:

    $weight_norm = array_sum($set->weight);
    $overall = 0;
    for ($i = 0; $i < count($values); $i++) {
      $overall += ($values[$i] * $set->weight[$i]) / $weight_norm;
    }
    $overall = @number_format($overall, 1);
  3. iperez_genius
    Member
    Posted 2 years ago #

    i have updated my weights to be .25 each as there are 4 options to rate by in my multi rating block.

    The Part where it says
    Rate: 3.1/5 should really say 62/100

    I understand that this is supposed to be working...but is the rate supposed to be rendered like that.

    Ilan

  4. Milan Petrovic
    Member
    Posted 2 years ago #

    All ratings are in the end normalized to number of stars. You can use filters to adjust what is actually displayed. But if you set 5 stars for a rating block, maximum value is 5, not 100.

  5. iperez_genius
    Member
    Posted 2 years ago #

    i understand how it works now...

    so because i have set weighting values equally the final rating comes out without any real changes...

    maybe it is something you should include in a future build...

    just a thought.

    Thanks for the help, and a great plugin

    ilan

  6. Milan Petrovic
    Member
    Posted 2 years ago #

    As I said, output can be modified by adding filter function, and I don't plan to do anything else about this.

Topic Closed

This topic has been closed to new replies.

About this Topic