diff --git a/Web/Models/Entities/User.php b/Web/Models/Entities/User.php index c93b1820..7c432561 100644 --- a/Web/Models/Entities/User.php +++ b/Web/Models/Entities/User.php @@ -85,6 +85,11 @@ class User extends RowModel { return (bool) $this->getRecord()->microblog; } + + function getMainPage(): int + { + return $this->getRecord()->main_page; + } function getChandlerGUID(): string { diff --git a/Web/Presenters/AboutPresenter.php b/Web/Presenters/AboutPresenter.php index 9ec6c770..3caa007d 100644 --- a/Web/Presenters/AboutPresenter.php +++ b/Web/Presenters/AboutPresenter.php @@ -14,7 +14,12 @@ final class AboutPresenter extends OpenVKPresenter { if(!is_null($this->user)) { header("HTTP/1.1 302 Found"); - header("Location: /id" . $this->user->id); + + if($this->user->identity->getMainPage()) + header("Location: /feed"); + else + header("Location: /id" . $this->user->id); + exit; } diff --git a/Web/Presenters/UserPresenter.php b/Web/Presenters/UserPresenter.php index 7cdfe397..c6a41616 100644 --- a/Web/Presenters/UserPresenter.php +++ b/Web/Presenters/UserPresenter.php @@ -419,6 +419,9 @@ final class UserPresenter extends OpenVKPresenter if(in_array($this->postParam("nsfw"), [0, 1, 2])) $user->setNsfwTolerance((int) $this->postParam("nsfw")); + + if(in_array($this->postParam("main_page"), [0, 1])) + $user->setMain_Page((int) $this->postParam("main_page")); } else if($_GET['act'] === "lMenu") { $settings = [ "menu_bildoj" => "photos", diff --git a/Web/Presenters/templates/User/Settings.xml b/Web/Presenters/templates/User/Settings.xml index 12f6a71c..1437d1a3 100644 --- a/Web/Presenters/templates/User/Settings.xml +++ b/Web/Presenters/templates/User/Settings.xml @@ -500,6 +500,17 @@ + + + {_ui_settings_main_page} + + + + + diff --git a/install/sqls/00024-main-page-setting.sql b/install/sqls/00024-main-page-setting.sql new file mode 100644 index 00000000..4e36e6d3 --- /dev/null +++ b/install/sqls/00024-main-page-setting.sql @@ -0,0 +1 @@ +ALTER TABLE `profiles` ADD COLUMN `main_page` tinyint(3) unsigned NOT NULL DEFAULT 0 AFTER `microblog`; diff --git a/locales/en.strings b/locales/en.strings index e56fb6cd..f3d11ee6 100644 --- a/locales/en.strings +++ b/locales/en.strings @@ -463,6 +463,7 @@ "ui_settings_view_of_posts" = "View of posts"; "ui_settings_view_of_posts_old" = "Old"; "ui_settings_view_of_posts_microblog" = "Microblog"; +"ui_settings_main_page" = "Main page"; "additional_links" = "Additional links"; "ad_poster" = "Ad poster"; diff --git a/locales/ru.strings b/locales/ru.strings index e9c999e9..38b75486 100644 --- a/locales/ru.strings +++ b/locales/ru.strings @@ -491,6 +491,7 @@ "ui_settings_view_of_posts" = "Вид постов"; "ui_settings_view_of_posts_old" = "Старый"; "ui_settings_view_of_posts_microblog" = "Микроблог"; +"ui_settings_main_page" = "Главная страница"; "additional_links" = "Дополнительные ссылки"; "ad_poster" = "Рекламный плакат";