aboutsummaryrefslogtreecommitdiffstats
path: root/style/header.php
blob: 79a447983b2720a75ff48f3a610b0bf4fd1fdfec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
  $config = require(__DIR__.'/../config.php');

  $_GET["SFW"]     ? $SFW = "checked"     : $SFW = NULL;
  $_GET["Sketchy"] ? $Sketchy = "checked" : $Sketchy = NULL;
  $_GET["NSFW"]    ? $NSFW = "checked"    : $NSFW = NULL;
  $_GET["General"] ? $General = "checked" : $General = NULL;
  $_GET["Anime"]   ? $Anime = "checked"   : $Anime = NULL;
  $_GET["People"]  ? $People = "checked"  : $People = NULL;

  printf("<head>\n<title>WallHeaven - %s</title>\n", $_GET["q"]);
  printf("<meta name='description' content='Pictures of %s'>\n", $_GET["q"]);
  echo <<<GFG
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <link rel="stylesheet" href="/style/style.css">
  <meta charset="utf-8">
  </head>
  <a href="/" id="header"><h3>Wall<span id="heaven">Heaven</span></h3></a>
  <div id="searchbox">
  <form action="/query.php" method="GET">\n
  GFG;
  printf("<input type='text' placeholder='Search...' name='q' value='%s'>\n", $_GET["q"]);
  printf("<div id='options'>\n");
  printf(" <input type='checkbox' name='SFW' id='SFW' %s>\n", $SFW);
  printf(" <label for='SFW'>SFW</label>\n");
  printf(" <input type='checkbox' name='Sketchy' id='Sketchy' %s>\n", $Sketchy);
  printf(" <label for='Sketchy'>Sketchy</label>\n");
  if ($config["frontends"]["wallhaven"]["apikey"]) { /* only display NSFW button with apikey */
    printf(" <input type='checkbox' name='NSFW' id='NSFW' %s>\n", $NSFW);
    printf(" <label for='NSFW'>NSFW</label>\n");
  }
  printf(" <input type='checkbox' name='General' id='General' %s>\n", $General);
  printf(" <label for='General'>General</label>\n");
  printf(" <input type='checkbox' name='Anime' id='Anime' %s>\n", $Anime);
  printf(" <label for='Anime'>Anime</label>\n");
  printf(" <input type='checkbox' name='People' id='People' %s>\n", $People);
  printf(" <label for='People'>People</label>\n");
  printf("</div>\n");
  printf("</form>\n<br>\n</div>\n")
?>