Skip to content

Commit

Permalink
Fix renderRating
Browse files Browse the repository at this point in the history
  • Loading branch information
vanchelo committed Feb 22, 2015
1 parent 0d1bd0c commit 6ec4db6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 108 deletions.
103 changes: 0 additions & 103 deletions assets/snippets/star_rating/libs/starRatingView.class.php

This file was deleted.

7 changes: 2 additions & 5 deletions assets/snippets/star_rating/starrating.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,10 @@ public function getRating($id) {
private function renderRating($id) {
$data = $this->getRating($id);

$votes = $data ? $data['votes'] : 0;
$rating = $data ? round($data['total'] / $data['votes'], 2) : 0;

$params = array(
'id' => $id,
'votes' => $votes,
'rating' => $rating,
'votes' => isset($data['votes']) ? $data['votes'] : 0,
'rating' => isset($data['rating']) ? $data['rating'] : 0,
'class' => $this->config['class'],
'stars' => $this->config['stars'],
'starOn' => $this->config['starOn'],
Expand Down

0 comments on commit 6ec4db6

Please sign in to comment.