From 21e159c76a1f90b084fe4e767ad4225f0befbf02 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 18 Jan 2024 15:20:41 +0000 Subject: [PATCH] [tag_list] make logarithms consistent across databases --- core/dbengine.php | 2 +- ext/tag_list/main.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/dbengine.php b/core/dbengine.php index 4467a296..19502551 100644 --- a/core/dbengine.php +++ b/core/dbengine.php @@ -146,7 +146,7 @@ function _log($a, $b = null): float if (is_null($b)) { return log($a); } else { - return log($a, $b); + return log($b, $a); } } function _isnull($a): bool diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php index 9fc49eba..ad22b6f2 100644 --- a/ext/tag_list/main.php +++ b/ext/tag_list/main.php @@ -390,7 +390,7 @@ class TagList extends Extension } $tag_data = $database->get_all(" - SELECT tag, count, FLOOR(LOG(count)) AS scaled + SELECT tag, count, FLOOR(LOG(10, count)) AS scaled FROM tags WHERE count >= :tags_min ORDER BY count DESC, tag ASC