Ignore:
Timestamp:
Jan 12, 2011, 12:38:45 PM (13 years ago)
Author:
plg
Message:

fix bug on RecentPictures module in PWG Stuffs plugin when rank is used in the order by configuration parameter

File:
1 edited

Legend:

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

    r3609 r8625  
    4141$query .= '
    4242    '.$forbidden.'
    43     '. str_replace('ORDER BY ', 'ORDER BY date_available DESC, ', $conf['order_by']).'
     43    ORDER BY i.id DESC
    4444    LIMIT 0, '.$datas['nb_images'].'
    4545  ;';
     
    5050if (count($selection) > 0)
    5151{
    52   $rank_of = array_flip($selection);
    53 
    5452  $query = '
    5553SELECT *
    5654  FROM '.IMAGES_TABLE.'
    5755  WHERE id IN ('.implode(',', $selection).')
     56  ORDER BY id DESC
    5857;';
    5958  $result = pwg_query($query);
    6059  while ($row = mysql_fetch_assoc($result))
    6160  {
    62     $row['rank'] = $rank_of[ $row['id'] ];
    63 
    6461    array_push($pictures, $row);
    6562  }
    66 
    67   usort($pictures, 'rank_compare');
    68   unset($rank_of);
    6963}
    7064
Note: See TracChangeset for help on using the changeset viewer.