Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
$sort by {rating-middle}

 
Reply to topic    Forum Index » Suggestions View previous topic
View next topic
$sort by {rating-middle}
Author Message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post $sort by {rating-middle} Reply with quote
How hard is it to add $sort by {rating-middle}?

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Fri Dec 22, 2006 2:36 am View user's profile Send private message Visit poster's website AIM Address
Guest








Please login to hide the ads.

FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
As it is now, it's quite impossible because you can only sort by a column in the table. That means you can sort by votes or by total points. You can show rating-middle by calculating it (total points / number of votes). But you can't sort by it because it's not in the table.



But it should be possible to create a column "middle" in the table and to save the calculated value in that column. The script needs some modifications. Then you are able to sort by average rating.
Fri Dec 22, 2006 7:47 pm View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
Alright I follow you. So, how did you learn so much about how the database is organized in cutenews? Would I learn a lot by going in phpmyadmin and viewing how the tables and content are stored and organized? Is that what you did?

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Fri Dec 22, 2006 9:35 pm View user's profile Send private message Visit poster's website AIM Address
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Well, using phpmyadmin is one way to check out the database structure. Another one is to look at install/db.php which creates the tables during the install process.



Generally, the best way to learn PHP is to understand this script and the plugins. Many of my plugins base on existing code taken from CuteNews.RU or any other PHP script. As soon as you understand what the code does you can copy and paste it and tweak it until it does what you want it to do. That's how I started about 2 years ago, and that's how I'm still working today.



I'm confident that if you understand about 50% of CuteNews.RU you are able to create your own plugins, hacks and mods.
Fri Dec 22, 2006 11:28 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Suggestions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.