The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
I have what at first seemed to be a simple task, but now after countless attempts .. I can't figure it out. :speechless:
PHP Code:
Code:
entryid | avgrating | num_ratings ------------------------------------------- 1 1 3000 2 9 500 3 9 1 Code:
entryid | avgrating | num_ratings ------------------------------------------- 2 9 500 1 1 3000 3 9 1 Hopefully this is making some logic. I can't just do a simple query and order it by avgrating , because an entry with an avgrating of 10 and one vote would display above an entry with an avgrating of 9 and 500 votes. I can't order by num_ratings , because an entry, like entryid 1 in the example, would appear above an entry like entryid 2. The solution is probably something simple I've just overlooked, as usual.. but I need to get it done in one query (if possible), and not have to make 2 queries with extra PHP code in between. Help would be much appreciated. ![]() |
#2
|
||||
|
||||
![]()
you can try this method:
PHP Code:
|
#3
|
||||
|
||||
![]()
Thanks xenon, the method in theory is correct.. don't know why it didn't occur to me before, but a more complex algorithm is still needed... for if I had:
1 Avgrating - 4800 Results (product of 4800) 9 Avgrating - 500 Results (product of 4500) :dead: |
#4
|
||||
|
||||
![]()
I modified the query to look like:
PHP Code:
|
#5
|
||||
|
||||
![]()
you're welcome
![]() i just wanted to give the idea, the algorithm depends on how strong which value should be, so i couldn't help further ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|