diff --git a/engines/google/image.php b/engines/google/image.php index 9bd5e58..a4eae7b 100644 --- a/engines/google/image.php +++ b/engines/google/image.php @@ -15,23 +15,18 @@ $image = $xpath->evaluate(".//img[@data-src]", $result)[0]; $url = $xpath->evaluate(".//a/@href", $result)[0]->textContent; - $url = check_for_privacy_frontend($url); + $url = check_for_privacy_frontend($url); if (!empty($image)) { $alt = $image->getAttribute("alt"); - $src = $image->getAttribute("data-src"); - + $thumbnail = $image->getAttribute("data-src"); + if (!empty($alt)) { - $ch = curl_init($src); - curl_setopt_array($ch, $config->curl_settings); - array_push($chs, $ch); - curl_multi_add_handle($mh, $ch); - array_push($results, array ( - "base64" => "", + "thumbnail" => $thumbnail, "alt" => htmlspecialchars($alt), "url" => htmlspecialchars($url) ) @@ -40,17 +35,6 @@ } } - $running = null; - do { - curl_multi_exec($mh, $running); - } while ($running); - - for ($i=0; count($chs)>$i; $i++) - { - $img_base64 = base64_encode(curl_multi_getcontent($chs[$i])); - $results[$i]["base64"] = $img_base64; - } - return $results; } @@ -60,12 +44,12 @@ foreach($results as $result) { - $src = $result["base64"]; + $thumbnail = $result["thumbnail"]; $alt = $result["alt"]; $url = $result["url"]; echo ""; - echo ""; + echo ""; echo ""; } diff --git a/engines/google/image_proxy.php b/engines/google/image_proxy.php new file mode 100644 index 0000000..0431c22 --- /dev/null +++ b/engines/google/image_proxy.php @@ -0,0 +1,11 @@ + diff --git a/engines/google/text.php b/engines/google/text.php index 772bd64..50c1724 100644 --- a/engines/google/text.php +++ b/engines/google/text.php @@ -142,7 +142,10 @@ echo "

"; if (array_key_exists("image", $special["special_response"])) - echo ""; + { + $image_url = $special["special_response"]["image"]; + echo ""; + } echo $response; echo "$source"; echo "

"; diff --git a/engines/special/wikipedia.php b/engines/special/wikipedia.php index b5fb7a4..7271cd9 100644 --- a/engines/special/wikipedia.php +++ b/engines/special/wikipedia.php @@ -11,7 +11,7 @@ { $description = substr($first_page["extract"], 0, 250) . "..."; - $source = check_for_privacy_frontend("https://wikipedia.org/wiki/$query_encoded"); + $source = check_for_privacy_frontend("https://wikipedia.org/wiki/$query"); $response = array( "special_response" => array( "response" => htmlspecialchars($description), @@ -21,10 +21,8 @@ if (array_key_exists("thumbnail", $first_page)) { - $img_url = $first_page["thumbnail"]["source"]; - $img_src = request($img_url); - $base64_src = base64_encode($img_src); - $response["special_response"]["image"] = $base64_src; + $image_url = $first_page["thumbnail"]["source"]; + $response["special_response"]["image"] = $image_url; } return $response; diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..f1412a9 Binary files /dev/null and b/favicon.ico differ diff --git a/misc/header.php b/misc/header.php index aa05de9..96a64f4 100644 --- a/misc/header.php +++ b/misc/header.php @@ -7,7 +7,6 @@ -
- + diff --git a/static/css/dark.css b/static/css/dark.css index 3505b37..5d6f68e 100644 --- a/static/css/dark.css +++ b/static/css/dark.css @@ -2,8 +2,6 @@ --main-bg: #202124; --main-fg: #e8eaed; - --alt-fg: #bd93f9; - --result-link-fg: #8ab4f8; --result-fg: #999da2; @@ -13,4 +11,4 @@ --footer-fg: #999da2; --footer-bg: #171717; -} \ No newline at end of file +} diff --git a/static/css/discord.css b/static/css/discord.css index db2ad07..70283dd 100644 --- a/static/css/discord.css +++ b/static/css/discord.css @@ -2,8 +2,6 @@ --main-bg: #2f3136; --main-fg: #dcddde; - --alt-fg: #bd93f9; - --result-link-fg: #747ff4; --result-fg: #dcddde; @@ -13,4 +11,4 @@ --footer-fg: #dcddde; --footer-bg: #36393f; -} \ No newline at end of file +} diff --git a/static/css/light.css b/static/css/light.css index 2bbf8b4..65733d4 100644 --- a/static/css/light.css +++ b/static/css/light.css @@ -2,8 +2,6 @@ --main-bg: #fff; --main-fg: #202124; - --alt-fg: #bd93f9; - --result-link-fg: #1a0dab; --result-fg: #70757a; @@ -13,4 +11,4 @@ --footer-fg: #70757a; --footer-bg: #f2f2f2; -} \ No newline at end of file +} diff --git a/static/css/night_owl.css b/static/css/night_owl.css index 5cddd9f..e054a6c 100644 --- a/static/css/night_owl.css +++ b/static/css/night_owl.css @@ -2,8 +2,6 @@ --main-bg: #011627; --main-fg: #d6deeb; - --alt-fg: #bd93f9; - --result-link-fg: #5f7e97; --result-fg: #d6deeb; @@ -13,4 +11,4 @@ --footer-fg: #d6deeb; --footer-bg: #011627; -} \ No newline at end of file +} diff --git a/static/css/nord.css b/static/css/nord.css index 83d0feb..d24c1c4 100644 --- a/static/css/nord.css +++ b/static/css/nord.css @@ -2,8 +2,6 @@ --main-bg: #3B4252; --main-fg: #E5E9F0; - --alt-fg: #bd93f9; - --result-link-fg: #88C0D0; --result-fg: #D8DEE9; @@ -13,4 +11,4 @@ --footer-fg: #D8DEE9; --footer-bg: #2E3440; -} \ No newline at end of file +} diff --git a/static/css/styles.css b/static/css/styles.css index b6a63a1..c712650 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -24,8 +24,11 @@ a, text-decoration: none; } -.text-result-wrapper a:visited h2 { - color: var(--alt-fg); +.text-result-wrapper a:visited h2, +.special-result-container a, +.sub-search-button-wrapper button +{ + color: #bd93f9; } a:hover, .text-result-wrapper h2:hover { @@ -106,7 +109,6 @@ a:hover, .text-result-wrapper h2:hover { .sub-search-button-wrapper button { border: none; background-color: inherit; - color: var(--alt-fg); font-size: 18px; margin-right: 25px; } @@ -187,7 +189,6 @@ a:hover, .text-result-wrapper h2:hover { .special-result-container a { display: flex; margin-top: 10px; - color: var(--alt-fg); font-size:14px; } @@ -229,9 +230,7 @@ a:hover, .text-result-wrapper h2:hover { } .image-result-container img { - border: 1px solid var(--button-bg); - width: 350px; - height: 200px; + border: 2px solid var(--button-bg); margin: 10px; } @@ -269,6 +268,22 @@ a:hover, .text-result-wrapper h2:hover { margin-right: 15px; } +.hide { + display: none; +} + +.X { + color: #bd93f9; +} + +.seeders { + color: #50fa7b; +} + +.leechers { + color: #ff79c6; +} + /* mobile view */ @media only screen and (max-width: 900px) { .search-container input { @@ -346,19 +361,3 @@ a:hover, .text-result-wrapper h2:hover { font-size: 55px; } } - -.hide { - display: none; -} - -.X { - color: #bd93f9; -} - -.seeders { - color: #50fa7b; -} - -.leechers { - color: #ff79c6; -} diff --git a/static/images/btc.png b/static/images/btc.png index d91873b..3d0b29d 100644 Binary files a/static/images/btc.png and b/static/images/btc.png differ diff --git a/static/images/image_result.png b/static/images/image_result.png index 0fb8bfa..ef76284 100644 Binary files a/static/images/image_result.png and b/static/images/image_result.png differ diff --git a/static/images/librex.png b/static/images/librex.png index 3bc670c..f1412a9 100644 Binary files a/static/images/librex.png and b/static/images/librex.png differ diff --git a/static/images/text_result.png b/static/images/text_result.png index 1462af9..742fd89 100644 Binary files a/static/images/text_result.png and b/static/images/text_result.png differ diff --git a/static/images/torrent_result.png b/static/images/torrent_result.png index 47b6eaf..d4a7e96 100644 Binary files a/static/images/torrent_result.png and b/static/images/torrent_result.png differ diff --git a/static/images/video_result.png b/static/images/video_result.png index 178f634..0d3b4c9 100644 Binary files a/static/images/video_result.png and b/static/images/video_result.png differ diff --git a/static/images/xmr.png b/static/images/xmr.png index 06f35b1..181e1d6 100644 Binary files a/static/images/xmr.png and b/static/images/xmr.png differ