From 29d440b8687359952dc5b46d8230c9b1c0189b1e Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 7 Jun 2025 00:19:23 +0400 Subject: upd: hide TOS/PRIVACY section if there is no corresponding files --- .gitignore | 5 ++++- public/index.php | 22 +++++++++++++++++----- public/static/PRIVACY.txt | 2 -- public/static/TOS.txt | 2 -- 4 files changed, 21 insertions(+), 10 deletions(-) delete mode 100644 public/static/PRIVACY.txt delete mode 100644 public/static/TOS.txt diff --git a/.gitignore b/.gitignore index 4f3dd73..b677f44 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ config.php *.ini *.db -userdata/ \ No newline at end of file +userdata/ + +TOS.txt +PRIVACY.txt \ No newline at end of file diff --git a/public/index.php b/public/index.php index 4176415..cf88a1b 100644 --- a/public/index.php +++ b/public/index.php @@ -105,6 +105,9 @@ if (FILE_CATALOG_FANCY_VIEW && $file_id) { $file['resolution'] = trim(shell_exec('wc -l < ' . escapeshellarg($file_path))) . ' lines'; } } + +$tos_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/TOS.txt'); +$privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt'); ?> @@ -210,11 +213,20 @@ if (FILE_CATALOG_FANCY_VIEW && $file_id) { Users do not need an account to start uploading.

Click the button below and share the files with your friends today! -
- But, read TOS and Privacy Policy - before - interacting with the - website. + +
+ But, read + + TOS + + and + + Privacy Policy + + before + interacting with the + website. +

diff --git a/public/static/PRIVACY.txt b/public/static/PRIVACY.txt deleted file mode 100644 index 9cebe94..0000000 --- a/public/static/PRIVACY.txt +++ /dev/null @@ -1,2 +0,0 @@ -There is your privacy policy. -If you see this, then the administrator hasn't set privacy policy. \ No newline at end of file diff --git a/public/static/TOS.txt b/public/static/TOS.txt deleted file mode 100644 index 897ed5e..0000000 --- a/public/static/TOS.txt +++ /dev/null @@ -1,2 +0,0 @@ -There is your TOS. -If you see this, then the administrator hasn't set TOS. \ No newline at end of file -- cgit v1.2.3