Changeset 17181
- Timestamp:
- Jul 27, 2012, 6:57:18 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ExtendedDescription/main.inc.php
r17180 r17181 530 530 function get_slider($param) 531 531 { 532 global $template, $conf ;532 global $template, $conf, $ids; // global $ids for the callback 533 533 534 534 $default_params = array( … … 594 594 LIMIT '.$params['nb_images'].' 595 595 ;'; 596 $ params['list'] = implode(',', array_from_query($query, 'image_id'));596 $ids = array_from_query($query, 'image_id'); 597 597 } 598 598 // ...or pictures list 599 if (empty($params['list']))599 else if (empty($params['list'])) 600 600 { 601 601 return 'missing album id or empty picture list'; 602 602 } 603 else 604 { 605 $ids = explode(',', $params['list']); 606 } 607 603 608 604 609 // get pictures … … 606 611 SELECT * 607 612 FROM '.IMAGES_TABLE.' 608 WHERE id IN ('. $params['list'].')613 WHERE id IN ('.implode(',', $ids).') 609 614 ;'; 610 615 $pictures = hash_from_query($query, 'id'); 611 616 617 // sort pictures 618 function rank_sort($a, $b) 619 { 620 global $ids; 621 return array_search($a, $ids) > array_search($b, $ids); 622 } 623 uksort($pictures, 'rank_sort'); 624 612 625 foreach ($pictures as $row) 613 626 {
Note: See TracChangeset
for help on using the changeset viewer.