Top rated sorting Top rated sorting
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Top rated sorting

Started by dustbunny, August 23, 2006, 08:07:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dustbunny

I would like it if the stars with more votes would be shown first.

How do I do that?





Nibbler

include/functions.inc.php

$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' AND votes >= '{$CONFIG['min_votes_for_rating']}' $META_ALBUM_SET ORDER BY pic_rating DESC, votes DESC, pid DESC $limit";

Change to

$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' AND votes >= '{$CONFIG['min_votes_for_rating']}' $META_ALBUM_SET ORDER BY votes DESC, pic_rating DESC, pid DESC $limit";

or however you'd like them to be sorted.

dustbunny

When I read the original code it seems that it goes by highest pic_rating and within sorted by number of votes.
EG:
5stars 8votes,
5stars 3votes,
5stars 2votes,
4stars 9votes,
4stars 7votes,
4stars 5votes,
etc.
If so then something is screwed up with my code cause it only sorts by rating only.
EG:
5stars 2votes,
5stars 8votes,
5stars 3votes,
4stars 5votes,
4stars 9votes,
4stars 7votes,
etc. 


Nibbler


dustbunny

Additional point: When I just upgraded from v1.3 to v1.4 it didn't sort correctly since then, even before I did any modifications.

--Warning--
This site has art depicting explicit sexual situations.
http://www.spacefurrs.com/

Nibbler, if this is a sort of thing that you do not wish to see let me know and thanks for the help.
Dustbunny