Ignore:
Timestamp:
10/10/11 18:37:18 (8 years ago)
Author:
patdenice
Message:

Best rated module is now compatible with piwigo 2.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PWG_Stuffs/trunk/modules/BestRated/main.inc.php

    r9581 r12401  
    2424  ); 
    2525 
    26 $query =' 
     26$query = ' 
    2727SELECT DISTINCT(i.id) 
    2828  FROM '.IMAGES_TABLE.' AS i 
    2929    INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id = ic.image_id 
    3030    INNER JOIN '.CATEGORIES_TABLE.' AS c ON ic.category_id = c.id 
    31   WHERE i.average_rate IS NOT NULL'; 
     31  WHERE i.rating_score IS NOT NULL'; 
    3232 
    3333if (isset($page['category'])) 
     
    4040$query .= ' 
    4141      '.$forbidden.' 
    42       ORDER BY i.average_rate DESC, i.id ASC 
    43     LIMIT 0, '.$datas['nb_images'].' 
    44   ;'; 
     42  ORDER BY i.rating_score DESC, i.id DESC 
     43  LIMIT 0, '.$datas['nb_images'].' 
     44;'; 
    4545 
    4646$pictures = array(); 
     
    127127    } 
    128128 
    129     if ($conf['show_thumbnail_caption']) 
    130     {// name of the picture 
    131       if (isset($row['name']) and $row['name'] != '') 
    132       { 
    133         $name = $row['name']; 
    134       } 
    135       else 
    136       { 
    137         $name = str_replace('_', ' ', get_filename_wo_extension($row['file'])); 
    138       } 
     129    if (isset($row['name']) and $row['name'] != '') 
     130    { 
     131      $name = $row['name']; 
     132    } 
     133    else 
     134    { 
     135      $name = str_replace('_', ' ', get_filename_wo_extension($row['file'])); 
     136    } 
    139137 
    140       $tpl_var['NAME'] = '('.$row['average_rate'].') '.$name; 
    141     } 
     138    $tpl_var['NAME'] = '('.$row['rating_score'].') '.$name; 
    142139 
    143140    if ( isset($nb_comments_of) ) 
Note: See TracChangeset for help on using the changeset viewer.