From d2dc7ccfa1c3f296e6ca5e5ef9459ab154670b70 Mon Sep 17 00:00:00 2001 From: horus Date: Mon, 15 Mar 2021 18:16:14 +0100 Subject: Add untrack --- .gitmodules | 3 +++ app.php | 10 +--------- functions.php | 12 ++++++++++++ public/index.php | 10 ++++++++-- public/resolve.php | 5 +++++ views/tools.html | 2 +- views/tools/untrack | 1 + 7 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 functions.php create mode 100644 public/resolve.php create mode 160000 views/tools/untrack diff --git a/.gitmodules b/.gitmodules index 137c576..07a2e27 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "views/tools/pizza"] path = views/tools/pizza url = git@git.iamfabulous.de:pizza +[submodule "views/tools/untrack"] + path = views/tools/untrack + url = git@git.iamfabulous.de:untrack diff --git a/app.php b/app.php index 53ca7eb..bac509e 100644 --- a/app.php +++ b/app.php @@ -1,6 +1,7 @@ addFunction($function); - -function get_faces(){ - return json_decode( file_get_contents( __DIR__ . '/views/tools/faces/faces.json' ), true ); -} - -function str_starts_with( $haystack, $needle ) { - $length = strlen( $needle ); - return substr( $haystack, 0, $length ) === $needle; -} diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..a0ec825 --- /dev/null +++ b/functions.php @@ -0,0 +1,12 @@ + get_faces() ]); - switch( $url ) { case("/"): @@ -28,6 +26,14 @@ case("/tools/pizza"): case("/tools/pizza/"): echo $twig->render('tools/pizza/index.html'); break; +case("/tools/untrack"): +case("/tools/untrack/"): + $_url = ""; + if ( isset($_REQUEST['url']) ) { + $_url = htmlspecialchars($_REQUEST['url']); + } + echo $twig->render('tools/untrack/index.html', [ "url" => $_url ]); + break; default: http_response_code(404); echo $twig->render('404.html'); diff --git a/public/resolve.php b/public/resolve.php new file mode 100644 index 0000000..9d2cdb2 --- /dev/null +++ b/public/resolve.php @@ -0,0 +1,5 @@ +Best faces on the net