From d79430be1e5a944a7c67912f7e826c742d49f61c Mon Sep 17 00:00:00 2001 From: MetallicAchu <40928922+MetallicAchu@users.noreply.github.com> Date: Thu, 17 Jun 2021 09:50:06 +0300 Subject: [PATCH] Edit sort by Categories Sort by the number of tags (sum) for each category descending This will allow the most used categories to appear first and not by alphabetical order --- ext/tag_editcloud/main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/tag_editcloud/main.php b/ext/tag_editcloud/main.php index c9b6dbdb..4edb9a0e 100644 --- a/ext/tag_editcloud/main.php +++ b/ext/tag_editcloud/main.php @@ -102,7 +102,7 @@ class TagEditCloud extends Extension SELECT tag, FLOOR(LN(LN(count - :tag_min1 + 1)+1)*150)/200 AS scaled, count FROM tags WHERE count >= :tag_min2 - ORDER BY CASE + ORDER BY SUM(count) OVER (PARTITION BY SUBSTRING_INDEX(tag, ':', 1)) DESC, CASE WHEN tag LIKE '%:%' THEN 1 ELSE 2 END, tag