Change review ratin...
 
Notifications
Clear all

Change review rating numbers to words

3 Posts
2 Users
0 Reactions
1,300 Views
Jan_AQ
(@jan_aq)
Posts: 1300
Noble Member
Topic starter
 

Hi, can someone point me in the right direction of a resource to look up please?

My users don't seem to use the rating system properly, they rate most everything a 10 no matter how bad it is.  I want to attempt to figure out how to change the 1-10 review system to 10 different words instead, like AWESOMEST, Terrific, Great, Good, Like it, OK, Alright, Ummm, Dreadful, Troll that would then input as a number.

I figured out that the file to look at is includes/reviewform. It looks like it uses a shorthand to get the 1-10 to show up without listing each number separately, so it would have to be completely rewritten, probably more complicated than before.

Can someone please give me a link, or the terms to search for the 1-10 drop down list in php, and what a drop down list of words in php would be? If I can recreate one by itself that would be step one in figuring this out. Then I'll have to figure out how to translate the word into a number, and then input that into the database. Intuitively I think that this may be the right direction and something easy enough that I could figure out in time. Is this possible?

Thank you in advance!


Whoever said nothing is impossible never tried slamming a revolving door.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 05/11/2010 1:30 am
(@tammy)
Posts: 2577
Member Moderator
 

Right.  You'll need to change this section of includes/reviewsform.php


for($x=10; $x > 0; $x--) {
$form .= "<option value="$x"".($review['rating'] == $x ? " selected" : "").">$x</option>";
}

I would add an array of options like this:


$opts = array(
10 => "Wow!",
9 => "Awesome!",
8 => "Terrific!",
7 => "Great!",
6 => "Good",
5 => "Okay",
4 => "So-so",
3 => "Needs work",
2 => "Bad",
1 => "Awful"
);
for($x=10; $x > 0; $x--) {
$form .= "<option value="$x"".($review['rating'] == $x ? " selected" : "").">".$opts[$x]."</option>";
}

My usual disclaimer on this...I haven't tested it. 


 
Posted : 05/11/2010 9:51 am
Jan_AQ
(@jan_aq)
Posts: 1300
Noble Member
Topic starter
 

Wow, thank you so much Tammy!! πŸ™‚ I will try and practice with that in depth and try to learn from it. πŸ˜€ I need a hobby while in school, right?


Whoever said nothing is impossible never tried slamming a revolving door.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 05/11/2010 3:00 pm
Share: