TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 500
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 294
  • Total: 294

rating stars in articles

Started by ontap, May 17, 2006, 03:41:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ontap


i know the rating system has only being added, would be nice to see stars instead of "Rating: 1 (1 rates)"

bloc

Heh..that was my first thought. I opted for an easy text version though.

But what would be better? 5 stars in a row..like pressing the 4th give "4"..or simply pictures of 1 star, 2 stars, 3 stars etc.?

deniz

1 to 5 is not enough.
it should be until 10 and numeric display

ontap

1-5 or 1-10 (maybe an option to set this in TP Admin)

clickin the 4th star would rate the article 4 stars, and so on.

feline

Rating 1-10 in two colors ...

1..5 as blue, 6..10 as red
overlapped
so see only 5 stars

4 blue gives a rating of 4
2 red 3 blue gives  7
5 red gives 10  ::)

Fel


feline

I have add the Rating start for articel, steps 1..10  ::)

Look at the picture ...

Crip

I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



bloc

oh, that looked rather good! :) Good to sue small squares instead og big(ish) stars. But I am bit confused on the red/blue thing..so 1-5 is all blue squares, but what after that? Like this:

1-5 blue
6- 1 red 4 blue
7- 2 red 3 blue
8- 3 red 2 blue
9- 4 red 1 blue
10- 5 red?

Sort of like 1-5 is all blue, after that the blue starts to be replaced by red?

feline

exactly Bloc (I gives him a note ONE  ;D)

here the code:

if(isset($story['options']['rating']))
{
$ratings = '<span class="smalltext">' . $txt['tp-ratingaverage'].' ';
$rate10cnt = $story['rating_average'] - 5;
if ($rate10cnt <= 0)
{
$rate5cnt = $story['rating_average'];
$rate10cnt = 0;
}
else
{
$rate5cnt = 5 - $rate10cnt;
}
$ratings .= str_repeat('<img src="'.$settings['images_url'].'/rate10.gif" alt="" />', $rate10cnt);
$ratings .= str_repeat('<img src="'.$settings['images_url'].'/rate5.gif" alt="" />', $rate5cnt);
$opts[] .= $ratings.' ('.$story['rating_votes'].'x)</span>';
}


the starpics added ...

Fel

ontap


red-blue is a big confusin, i dont get it.

nice bit of code fel

This website is proudly hosted on Crocweb Cloud Website Hosting.