How could I sort the images in gallery based on a calculation (average rating)? Something like this where p.totalratings is the calculation.
case 'mostrated':
$sortby = 'p.totalratings';
break;
Also, what's the difference between sortby and sortby2?
Thanks,
mashby
Just to add more information, I'm running this code:
while($row = mysql_fetch_assoc($dbresult))
{
if ($row['totalratings']!=0)
$mashbynumber=($row['rating'] / ($row['totalratings']* 100) * 100);
else $mashbynumber='0.000001';
MORE CODE FROM HERE ON DOWN SHOWS IMAGES IN A SPECIFIC GALLERY
So, you can see that $mashbynumber is being reset for each image in the gallery. If I had X number of images in a gallery, how can I capture $mashbynumber and order the images descending based on the $mashbynumber for X number of images? I'm hoping to integrate this same logic in a phpbox on my home page as well.