Changeset 11827 for trunk/include/ws_functions.inc.php
- Timestamp:
- Jul 25, 2011, 8:04:50 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/ws_functions.inc.php
r11756 r11827 782 782 } 783 783 //------------------------------------------------------------- related rates 784 $query = ' 784 $rating = array('score'=>$image_row['average_rate'], 'count'=>0, 'average'=>null); 785 if (isset($rating['score'])) 786 { 787 $query = ' 785 788 SELECT COUNT(rate) AS count 786 789 , ROUND(AVG(rate),2) AS average … … 788 791 WHERE element_id = '.$image_row['id'].' 789 792 ;'; 790 $rating = pwg_db_fetch_assoc(pwg_query($query)); 791 $rating['count'] = (int)$rating['count']; 793 $row = pwg_db_fetch_assoc(pwg_query($query)); 794 $rating['score'] = (float)$rating['score']; 795 $rating['average'] = (float)$row['average']; 796 $rating['count'] = (int)$row['count']; 797 } 792 798 793 799 //---------------------------------------------------------- related comments
Note: See TracChangeset
for help on using the changeset viewer.