From e9786a3d8b2f5b80dae0d282613974628104f085 Mon Sep 17 00:00:00 2001 From: GeorgNation <55389952+GeorgNation@users.noreply.github.com> Date: Fri, 19 Jul 2024 14:11:06 +0600 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=81=D1=8F=D0=BA=D0=B0=D1=8F=20=D0=B2?= =?UTF-8?q?=D1=81=D1=8F=D1=87=D0=B8=D0=BD=D0=B0=20=D0=B8=20=D0=B4=D0=B0?= =?UTF-8?q?=D0=B6=D0=B5=20=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Правила сайта вынесены в отдельную папку, и теперь они все HTML - Теперь будет отображаться версия сайта на сервере (соответствует последнему коммиту в гит) --- app/Controllers/MainController.php | 21 ++++++++++++++++++++- app/Core/Routes.php | 3 +++ config/photoRules.html | 1 + config/publicationRules.html | 1 + config/rules.html | 1 + config/videoRules.html | 1 + rules.txt | 1 - views/components/Footer.php | 12 +++++++++++- views/pages/Rules.php | 6 +++--- 9 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 config/photoRules.html create mode 100644 config/publicationRules.html create mode 100644 config/rules.html create mode 100644 config/videoRules.html delete mode 100644 rules.txt diff --git a/app/Controllers/MainController.php b/app/Controllers/MainController.php index 3796fa0..e0192f4 100644 --- a/app/Controllers/MainController.php +++ b/app/Controllers/MainController.php @@ -24,8 +24,27 @@ class MainController } public static function rules() { + $_GLOBAL['rules'] = '/config/rules.html'; + $_GLOBAL['title'] = 'Правила сайта'; + Page::set('Rules'); + } + public static function publicationRules() + { + $_GLOBAL['rules'] = '/config/publicationRules.html'; + $_GLOBAL['title'] = 'Правила отбора фотографий'; + Page::set('Rules'); + } + public static function photoRules() + { + $_GLOBAL['rules'] = '/config/photoRules.html'; + $_GLOBAL['title'] = 'Правила подписи фотографий'; + Page::set('Rules'); + } + public static function videoRules() + { + $_GLOBAL['rules'] = '/config/videoRules.html'; + $_GLOBAL['title'] = 'Правила видеотеки'; Page::set('Rules'); - } public static function update() { diff --git a/app/Core/Routes.php b/app/Core/Routes.php index 5f662a3..4e662f0 100644 --- a/app/Core/Routes.php +++ b/app/Core/Routes.php @@ -20,6 +20,9 @@ class Routes Router::post('/api/register', 'ApiController@register'); Router::get('/about', 'MainController@about'); Router::get('/rules', 'MainController@rules'); + Router::get('/rules/pub', 'MainController@publicationRules'); + Router::get('/rules/photo', 'MainController@photoRules'); + Router::get('/rules/video', 'MainController@videoRules'); Router::get('/update', 'MainController@update'); Router::get('/top30', 'MainController@top30'); diff --git a/config/photoRules.html b/config/photoRules.html new file mode 100644 index 0000000..1ad44c6 --- /dev/null +++ b/config/photoRules.html @@ -0,0 +1 @@ +Правила подписи фотографий \ No newline at end of file diff --git a/config/publicationRules.html b/config/publicationRules.html new file mode 100644 index 0000000..4079089 --- /dev/null +++ b/config/publicationRules.html @@ -0,0 +1 @@ +Правила публикации фотографий \ No newline at end of file diff --git a/config/rules.html b/config/rules.html new file mode 100644 index 0000000..a7c0202 --- /dev/null +++ b/config/rules.html @@ -0,0 +1 @@ +Основные правила сайта. \ No newline at end of file diff --git a/config/videoRules.html b/config/videoRules.html new file mode 100644 index 0000000..23b02e6 --- /dev/null +++ b/config/videoRules.html @@ -0,0 +1 @@ +Правила видеокаталога \ No newline at end of file diff --git a/rules.txt b/rules.txt deleted file mode 100644 index 8071f28..0000000 --- a/rules.txt +++ /dev/null @@ -1 +0,0 @@ -Основные правила сайта. \ No newline at end of file diff --git a/views/components/Footer.php b/views/components/Footer.php index b4c28ea..42399ab 100644 --- a/views/components/Footer.php +++ b/views/components/Footer.php @@ -1,9 +1,19 @@ -

Aloha, Hawaii! | PHP | MySQL

+

Aloha, Hawaii! | PHP | MySQL | Версия

Главная     Личный кабинет     Правила     О сервере
diff --git a/views/pages/Rules.php b/views/pages/Rules.php index 9069d93..8b17762 100644 --- a/views/pages/Rules.php +++ b/views/pages/Rules.php @@ -19,13 +19,13 @@ use \App\Models\User;
-

Правила сайта

+