From ef04bbb568f877f8d9604a361c05504be55b689f Mon Sep 17 00:00:00 2001 From: Squibid Date: Wed, 27 Dec 2023 00:18:07 -0500 Subject: make the english make sense in the context --- query.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/query.php b/query.php index 2cfa97f..0d55f1c 100644 --- a/query.php +++ b/query.php @@ -23,7 +23,18 @@ $res = getwallpapers("https://wallhaven.cc/api/v1/search?q=".$_GET["q"]."&purity=".$purity."&categories=".$categories."&page=".$page); /* explain query */ - printf("

%s Wallpapers found for \"%s\"

", $res[1]["total"], $_GET["q"], humanquery($_GET["q"], $_GET["NSFW"] ? true : false)); + /* HACK: really disgusting code might make it better but for now it works */ + printf("
"); + $humanreadable = humanquery($_GET["q"], $_GET["NSFW"] ? true : false); + if (!$_GET["q"]) + printf("

%s Wallpapers found", $res[1]["total"]); + else { + if (preg_match("/like:/", $_GET["q"])) + printf("

%s Wallpapers found \"%s\"

", $res[1]["total"], $_GET["q"], $humanreadable); + else + printf("

%s Wallpapers found for \"%s\"

", $res[1]["total"], $_GET["q"], $humanreadable); + } + printf("
"); /* display wallpapers */ printf("
\n"); -- cgit v1.2.1