 |
 |
 |
 |
 |
| Author |
Message |
scottdallas

Joined: 04 May 2006 Posts: 1943 Location: US |
|
$sort by {rating-middle} |
|
How hard is it to add $sort by {rating-middle}?
_________________ www.scottdizzle.com uses cnr
last update: 07-22-08: 8:30 pm |
|
| Fri Dec 22, 2006 2:36 am |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2801 Location: Germany |
|
|
|
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 |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1943 Location: US |
|
|
|
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
last update: 07-22-08: 8:30 pm |
|
| Fri Dec 22, 2006 9:35 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2801 Location: Germany |
|
|
|
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 |
|
 |
|
|
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
|
|
 |
 |
 |
|