Top 10 Rating

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
AndrewB
Posts: 171
Joined: Fri Aug 22, 2003 11:15 pm
Contact:

Top 10 Rating

Post by AndrewB »

How would I add the rating to the Top 10 section?

I would like a way for it to show 5 stars or whatever the rating is.
Thorsten
Posts: 15562
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi Andrew,

the SQL-Query should look like:

Code: Select all

SELECT DISTINCT faqdata.id, faqdata.lang, faqdata.active, faqdata.rubrik, faqdata.thema, ( faqvoting.vote / faqvoting.user ) AS num, faqvoting.user FROM faqdata, faqvoting WHERE faqdata.id = faqvoting.artikel GROUP BY faqdata.id ORDER BY num LIMIT 10
The rest is simple PHP. :)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
AndrewB
Posts: 171
Joined: Fri Aug 22, 2003 11:15 pm
Contact:

Post by AndrewB »

Thanks for the SQL.

Simple for you maybe...

I will have fun trying this :)
Thorsten
Posts: 15562
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi Andrew,

just look in the file admin/stat.ratings.php, you can use a lot of stuff from this file.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply