1
ghia
News and Rating in text
  • 2008/8/27 9:25

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Would it be nicer if the rating showed you excellent, interesting, boring or AAA, B- or ... in stead of 7.22, 5.65 etc.
If you want the display of the rating with a textual description in stead of a number, you can use this modification in modules\news\class\class.newsstory.php .
Change

$story['rating'] = number_format($this->rating(), 2);

to

if ($this->rating() > 8) {
  
$story['rating'] = 'Excellent';
 } else if (
$this->rating() > 5) {
  
$story['rating'] = 'Interesting';
 } else if (
$this->rating() > 2) {
  
$story['rating'] = 'Boring';
 } else if (
$this->rating() > 0) {
  
$story['rating'] = 'Skip';
 } else {
  
$story['rating'] = 'Be the first!';
 }


The texts and divisions are of course easy to adapt to your desire. (The equations have to be done in descending order.)

Login

Who's Online

158 user(s) are online (97 user(s) are browsing Support Forums)


Members: 0


Guests: 158


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits