Changeset 11827 for trunk/include/picture_rate.inc.php
- Timestamp:
- Jul 25, 2011, 8:04:50 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/picture_rate.inc.php
r8728 r11827 29 29 if ($conf['rate']) 30 30 { 31 if ( NULL != $picture['current']['average_rate'] ) 31 $rate_summary = array( 'count'=>0, 'score'=>$picture['current']['average_rate'], 'average'=>null ); 32 if ( NULL != $rate_summary['score'] ) 32 33 { 33 34 $query = ' … … 37 38 WHERE element_id = '.$picture['current']['id'].' 38 39 ;'; 39 $row = pwg_db_fetch_assoc(pwg_query($query));40 list($rate_summary['count'], $rate_summary['average']) = pwg_db_fetch_row(pwg_query($query)); 40 41 } 41 else 42 { // avg rate null -> no rate -> no need to query db 43 $row = array( 'count'=>0, 'average'=>NULL ); 44 } 45 $template->assign('rate_summary', $row); 42 $template->assign('rate_summary', $rate_summary); 46 43 47 44 $user_rate = null; 48 45 if ($conf['rate_anonymous'] or is_autorize_status(ACCESS_CLASSIC) ) 49 46 { 50 if ($r ow['count']>0)47 if ($rate_summary['count']>0) 51 48 { 52 49 $query = 'SELECT rate
Note: See TracChangeset
for help on using the changeset viewer.