Changeset 2309 for trunk/include/picture_rate.inc.php
- Timestamp:
- Apr 26, 2008, 1:38:04 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/picture_rate.inc.php
r2299 r2309 29 29 if ($conf['rate']) 30 30 { 31 $query = ' 31 if ( NULL != $picture['current']['average_rate'] ) 32 { 33 $query = ' 32 34 SELECT COUNT(rate) AS count 33 35 , ROUND(AVG(rate),2) AS average … … 36 38 WHERE element_id = '.$picture['current']['id'].' 37 39 ;'; 38 $row = mysql_fetch_array(pwg_query($query)); 40 $row = mysql_fetch_array(pwg_query($query)); 41 } 42 else 43 { // avg rate null -> no rate -> no need to query db 44 $row = array( 'count'=>0, 'average'=>NULL, 'std'=>NULL ); 45 } 39 46 $template->assign('rate_summary', $row); 40 47
Note: See TracChangeset
for help on using the changeset viewer.