Follow ReviewsForJoomla on Twitter
 
September 09, 2010, 11:23:47 AM

Login with username, password and session length

FORUM POSTING GUIDELINES - Please read and follow them.

Pages: [1]
  Print  
Author Topic: Overall Rating (weighted) as a percent of 100  (Read 803 times)
akah0mer
Newbie
*
Offline Offline

Posts: 17



WWW
« on: July 19, 2008, 11:40:28 PM »

Alejandro,

I love this software.  But I have to admit that I am still learning it.

I really like the weighted averages, it relates perfectly to what I am rating (the items are weighted when being judged (different criteria/different weight) and are give a percent of 100 as a final score).  But in this instance, I would like to show the "Overall Rating (weighted) " as a percent.  For the most part, multiply the Overall Rating (weighted) by 5 and display it.  For the life of me I can not figure out where or if I can do it.

Please let me know if this is possible. 

H0mer
Logged

Please stop by CellarMonk ~ Beer and let me know what you think.
Alejandro
Global Moderator
Administrator
Hero Member
*
Online Online

Posts: 17032


« Reply #1 on: July 20, 2008, 08:29:05 AM »

In jReviews 1.x it's a bit more complicated, in jReviews 2.x you can edit the /jreviews/views/themes/default/elements/detailed_ratings.thtml file where you'll find the output and just multiply by 5:

Code:
   <td class="rating_label"><?php __t("Overall rating");?>:</td>
   <td><?php echo $Rating->drawStars($review['Rating']['average_rating'], $this->Config->rating_scale$this->Config->rating_graph$reviewType);?></td>
   <td class="rating_value"><?php echo 5*$Rating->round($review['Rating']['average_rating'],$this->Config->rating_scale);?></td>


I can't help you with the change for 1.x because it requires code changes instead of just a theme change.
Logged

Leave a testimonial for JReviews
Reviews Ahoy! - Submit your jReviews site here.
akah0mer
Newbie
*
Offline Offline

Posts: 17



WWW
« Reply #2 on: July 20, 2008, 10:50:15 PM »

Alejandro,

Thank you, I will be moving to 2.0 shortly.  I will make the change then.

Logged

Please stop by CellarMonk ~ Beer and let me know what you think.
FSS
Newbie
*
Offline Offline

Posts: 6


« Reply #3 on: February 08, 2010, 02:14:31 PM »

Hi Alejandro,

I know this original post was quite a while ago, but I am doing the same thing with my site. I have a 10 scale rating, and needed to multiply each rating increment by 10. So it goes 10, 20, 30...100 instead of 1,2,3...10.

I made the change you suggested above, and that worked perfect in the user reviews section, but up in the title of the article, where it shows author, date, hits, ect, that value is still on the 1x scale, so it displays 6.3 instead of 63.

What file do I need to change to modify that output?

Thanks!

Steve
Logged
Alejandro
Global Moderator
Administrator
Hero Member
*
Online Online

Posts: 17032


« Reply #4 on: February 08, 2010, 02:38:44 PM »

Edit the list and detail theme files and find the output for the rating and multiply it there. It should be easy to locate since the rating blocks are commented.

http://docs.reviewsforjoomla.com/Default_theme_overview
Logged

Leave a testimonial for JReviews
Reviews Ahoy! - Submit your jReviews site here.
FSS
Newbie
*
Offline Offline

Posts: 6


« Reply #5 on: February 08, 2010, 03:53:56 PM »

Found it, thanks!

Anyone else looking to make a similar change, an easy way is to do a global find and replace (to make sure the change is reflected anywhere ratings are displayed on the site).

Search for:
echo $Rating->round

Replace with:
echo 10*$Rating->round

Obviously change 10* to whatever number you need to multiply with.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!