vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   10 Star Rating System - JS (https://vborg.vbsupport.ru/showthread.php?t=176345)

legionofangels 04-16-2008 03:12 PM

10 Star Rating System - JS
 
Hello,

I am trying to do a 10 Star Rating System and I don't see a lot of resources out there for this. I have found several free versions of 5 Star Rating Systems, or cheap like $5 versions. But I really want to edit the code to 10 Star Rating System.

So if I take a look at this code:

Code:

<%= number_with_precision(asset.rating, 1) %>/5 Stars<br>
<ul class='star-rating'>
    <li class='current-rating' style='width:<%= (asset.rating * 30).to_i -%>px;'>
          Currently <%= number_with_precision(asset.rating, 1) %>/5 Stars.
        </li>
    <li>
        <%= link_to_remote( "1", {:url => { :controller => "rating_demo",
            :action => "rate", :id => asset.id, :rating => 1}},
            :class => 'one-star', :name => '1 star out of 5') %>
    </li>
    <li>
        <%= link_to_remote( "2", {:url => { :controller => "rating_demo",
            :action => "rate", :id => asset.id, :rating => 2}},
            :class => 'two-stars', :name => '2 stars out of 5') %>   
    </li>
    <li>
        <%= link_to_remote( "3", {:url => { :controller => "rating_demo",
            :action => "rate", :id => asset.id, :rating => 3}},
            :class => 'three-stars', :name => '3 stars out of 5') %>
    </li>
    <li>
        <%= link_to_remote( "4", {:url => { :controller => "rating_demo",
            :action => "rate", :id => asset.id, :rating => 4}},
            :class => 'four-stars', :name => '4 stars out of 5') %>   
    </li>
    <li>
        <%= link_to_remote( "5", {:url => { :controller => "rating_demo",
            :action => "rate", :id => asset.id, :rating => 5}},
            :class => 'five-stars', :name => '5 stars out of 5') %>
    </li>
</ul>

found here:

http://www.naffis.com/2006/8/31/rail...-rating-system

Why can't I change the 5 stars out of 5 to like 5 stars out of 10, 6 stars out of 10, etc.???


Will this code actually work for me, or what that person posted on that page?

iogames 04-16-2008 04:56 PM

Five Stars and Top Ten aren't 2 different popular systems?

legionofangels 04-16-2008 06:02 PM

Quote:

Originally Posted by iogames (Post 1492283)
Five Stars and Top Ten aren't 2 different popular systems?

What?

Trying to do 10 stars instead of a 5 star system.

--------------- Added [DATE]1208401243[/DATE] at [TIME]1208401243[/TIME] ---------------

Anyone?

legionofangels 04-18-2008 07:28 PM

Anyone?

--------------- Added [DATE]1208553442[/DATE] at [TIME]1208553442[/TIME] ---------------

NEVERMIND - Found the information I needed finally.


All times are GMT. The time now is 07:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01171 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete