From 1ce0429280327f18ed0faeaf4d70b32b51fa47b8 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 4 Mar 2014 17:33:38 +0100 Subject: [PATCH] Added order:file_size --- data/help.md | 1 + src/Models/SearchParsers/PostSearchParser.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/data/help.md b/data/help.md index 02297223..80a1d8b8 100644 --- a/data/help.md +++ b/data/help.md @@ -64,6 +64,7 @@ Command | Description [search]order:tags[/search] | with most tags | `tag`, `tagcount`, `tag_count` | [search]order:commentdate[/search] | recently commented | `comment_date` | [search]order:favdate[/search] | recently added to favorites | `fav_date` | +[search]order:filesize[/search] | largest files first | `file_size` | As shown with [search]-order:date[/search], any of them can be reversed in the same way as negating other tags: by placing a dash before the tag. diff --git a/src/Models/SearchParsers/PostSearchParser.php b/src/Models/SearchParsers/PostSearchParser.php index 58072389..162bf06a 100644 --- a/src/Models/SearchParsers/PostSearchParser.php +++ b/src/Models/SearchParsers/PostSearchParser.php @@ -244,6 +244,9 @@ class PostSearchParser extends AbstractSearchParser elseif (in_array($orderByString, ['favdate', 'fav_date'])) $orderColumn = 'post.fav_date'; + elseif (in_array($orderByString, ['filesize', 'file_size'])) + $orderColumn = 'post.file_size'; + elseif ($orderByString == 'random') { //seeding works like this: if you visit anything