I'm trying to order an array of results using a rating forumula I have created, it works by creating a new rating value based on time since posting.
Heres the rating formula: Ratings decrease overtime (Times are in unix timestamps format)
$new_rating = $current_rating / ($current_time - $post_time);
Array
(
[0] => Submissions Object
(
[title] => Exploits Emerge For Linux Privilege Escalation Flaw
[link] => http://test.com
[description] => test description test
[tags] => hardware,government,libya
[rating] => 10
[date] => 1327546314
)
[1] => Submissions Object
(
[title] => High School Students Send Lego Man 24 Kilometers High
[link] => http://test.com
[description] => test description test
[tags] => hardware,government,libya
[rating] => 5
[date] => 1327546305
)
)
My question is how do I sort this array using the above formula? or is their a way I can insert this formula into the mysql query statement?
Thanks a lot everyone.