diff options
Diffstat (limited to 'apps/bookmarks/ajax')
-rw-r--r-- | apps/bookmarks/ajax/updateList.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/bookmarks/ajax/updateList.php b/apps/bookmarks/ajax/updateList.php index 9290757d0b1..61983cc0f5b 100644 --- a/apps/bookmarks/ajax/updateList.php +++ b/apps/bookmarks/ajax/updateList.php @@ -50,6 +50,13 @@ if($filterTag){ $offset = isset($_GET['page']) ? intval($_GET['page']) * 10 : 0; $params[] = $offset; +$sort = isset($_GET['sort']) ? ($_GET['sort']) : 'bookmarks_sorting_recent'; +if($sort == 'bookmarks_sorting_clicks') { + $sqlSort = 'clickcount DESC'; +} else { + $sqlSort = 'id DESC'; +} + if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ $_gc_separator = ', \' \''; } else { @@ -72,7 +79,7 @@ $query = OC_DB::prepare(' AND *PREFIX*bookmarks.user_id = ? GROUP BY url '.$sqlFilterTag.' - ORDER BY *PREFIX*bookmarks.id DESC + ORDER BY *PREFIX*bookmarks.'.$sqlSort.' LIMIT ?, 10'); $bookmarks = $query->execute($params)->fetchAll(); |