feat:explain the users query

This commit is contained in:
2023-12-26 22:58:20 -05:00
parent 404bd217ac
commit 39dd311cee
4 changed files with 75 additions and 0 deletions

View File

@ -1,6 +1,7 @@
<?php
include('scrapers/wallhaven.php');
include('style/header.php');
include('misc/tools.php');
$config = require('config.php');
$_SERVER['REQUEST_URI'] = "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
@ -21,6 +22,9 @@
$_GET["page"] ? $page = $_GET["page"] : $page = 1;
$res = getwallpapers("https://wallhaven.cc/api/v1/search?q=".$_GET["q"]."&purity=".$purity."&categories=".$categories."&page=".$page);
/* explain query */
printf("<div id='queryinfo'><p>%s Wallpapers found for \"<a href='/query.php?q=%s'>%s</a>\"</p></div>", $res[1]["total"], $_GET["q"], humanquery($_GET["q"], $_GET["NSFW"] ? true : false));
/* display wallpapers */
printf("<div id='wallpapers'>\n");
if (!$res[0])