diff options
-rw-r--r-- | include/ws_functions/pwg.tags.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/ws_functions/pwg.tags.php b/include/ws_functions/pwg.tags.php index 09ce21bd0..c4ce2b7fc 100644 --- a/include/ws_functions/pwg.tags.php +++ b/include/ws_functions/pwg.tags.php @@ -110,11 +110,16 @@ function ws_tags_getImages($params, &$service) $where_clauses = implode(' AND ', $where_clauses); } + $order_by = ws_std_image_sql_order($params, 'i.'); + if (!empty($order_by)) + { + $order_by = 'ORDER BY '.$order_by; + } $image_ids = get_image_ids_for_tags( $tag_ids, $params['tag_mode_and'] ? 'AND' : 'OR', $where_clauses, - ws_std_image_sql_order($params) + $order_by ); $count_set = count($image_ids); @@ -136,7 +141,6 @@ SELECT image_id, GROUP_CONCAT(tag_id) AS tag_ids while ($row = pwg_db_fetch_assoc($result)) { $row['image_id'] = (int)$row['image_id']; - $image_ids[] = $row['image_id']; $image_tag_map[ $row['image_id'] ] = explode(',', $row['tag_ids']); } } |