Parašė Žmogus· 2008 Lie. 22 12:07:54
#3
$result = dbquery(
"SELECT tp.*, tu.user_id,user_name, SUM(tr.rating_vote) AS sum_rating, COUNT(tr.rating_item_id) AS count_votes
FROM ".$db_prefix."photos tp
LEFT JOIN ".$db_prefix."users tu ON tp.photo_user=tu.user_id
LEFT JOIN ".$db_prefix."ratings tr ON tr.rating_item_id = tp.photo_id AND tr.rating_type='P'
WHERE album_id=$album_id GROUP BY photo_id ORDER BY photo_order LIMIT $rowstart,".$settings['thumbs_per_page']
);
Redagavo Žmogus· 2008 Lie. 22 12:07:03