Author Topic: Top 10 images by rating true?  (Read 5930 times)

0 Members and 1 Guest are viewing this topic.

Offline ilaslan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Top 10 images by rating true?
« on: September 22, 2010, 10:06:10 PM »
hello

i installed. 1.7.8 i am new for 4images.
i have a lot of pics in my gallery. and user sometimes rate pics. this is ok.

but. a lot of 10 points. 4 images listing alphebetic  i think.
but. if have a lot of pic 10 points ( example 45 pic 10 rated )
4images list a b c d....
but firstly must examine how many votes this 45 pic.

so this 4images codes. zzzzz.gif 14 votes and fully 10 but not listed.

aaaa.gif  1 vote it is also  10 but first pic in top images...

maybe a bit cpu is need. i dont know php exactly. but i am usiing cache :P

( my english is not very good sory if a problem I wrote )
 

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Top 10 images by rating true?
« Reply #1 on: September 22, 2010, 10:20:07 PM »
Easy fix.
In top.php find:
Code: [Select]
        ORDER BY i.image_rating DESC, i.image_name ASC
Replace it with:
Code: [Select]
        ORDER BY i.image_rating DESC, i.image_votes DESC

In addition if you want the top 10 by votes sorted by rating, then find:

Code: [Select]
        ORDER BY i.image_votes DESC, i.image_name ASC
Replace it with:
Code: [Select]
        ORDER BY i.image_votes DESC, i.image_rating DESC
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ilaslan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Top 10 images by rating true?
« Reply #2 on: September 22, 2010, 10:48:31 PM »
thnx a lot
it is ok.
code is work.