diff options
| author | ilotterytea <iltsu@alright.party> | 2025-06-07 00:19:23 +0400 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-06-07 00:19:23 +0400 |
| commit | 29d440b8687359952dc5b46d8230c9b1c0189b1e (patch) | |
| tree | 8fdf47a0c6aca5c7d3c13b9ad4fa5743fe6d3c35 /public | |
| parent | 2b4eebf2f2711a962f417fceeb54d681ef41a4ce (diff) | |
upd: hide TOS/PRIVACY section if there is no corresponding files
Diffstat (limited to 'public')
| -rw-r--r-- | public/index.php | 22 | ||||
| -rw-r--r-- | public/static/PRIVACY.txt | 2 | ||||
| -rw-r--r-- | public/static/TOS.txt | 2 |
3 files changed, 17 insertions, 9 deletions
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'); ?> <html> @@ -210,11 +213,20 @@ if (FILE_CATALOG_FANCY_VIEW && $file_id) { Users do not need an account to start uploading. <br><br> Click the button below and share the files with your friends today! - <br> - But, read <a href="/static/TOS.txt">TOS</a> and <a href="/static/PRIVACY.txt">Privacy Policy</a> - before - interacting with the - website. + <?php if ($tos_exists || $privacy_exists): ?> + <br> + But, read + <?php if ($tos_exists): ?> + <a href="/static/TOS.txt">TOS</a> + <?php endif; ?> + <?php if ($tos_exists && $privacy_exists): ?> and <?php endif; ?> + <?php if ($privacy_exists): ?> + <a href="/static/PRIVACY.txt">Privacy Policy</a> + <?php endif; ?> + before + interacting with the + website. + <?php endif; ?> </p> </div> </section> 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 |
