Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Top rated sorting bug  (Read 2330 times)

0 Members and 1 Guest are viewing this topic.

Vadim

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Top rated sorting bug
« on: February 15, 2005, 12:44:50 am »

Hi,

I've noticed, that Top rated pictures are not sorted coorectly
Look here: http://coppermine.sourceforge.net/demo/displayimage.php?album=toprated&cat=0&pos=0 , this picture has  4.5 / 5, and this http://coppermine.sourceforge.net/demo/displayimage.php?album=toprated&cat=0&pos=1 (which is on the 2nd place) 4.7 / 5

I think that the solution is to change sort order query in include/functions.inc.php Line 703 to
Code: [Select]
$result = db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' AND votes >= '{$CONFIG['min_votes_for_rating']}' $ALBUM_SET ORDER BY ROUND(((pic_rating+1)/2000), 2) DESC, votes DESC, filename $limit");
When adding ROUND()  parameter sorting becomes more accurate
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Top rated sorting bug
« Reply #2 on: February 16, 2005, 12:07:22 am »

Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 21 queries.