diff --git a/app/Controllers/Facets/AllFacetController.php b/app/Controllers/Facets/AllFacetController.php index bee27667..2ad02a2b 100644 --- a/app/Controllers/Facets/AllFacetController.php +++ b/app/Controllers/Facets/AllFacetController.php @@ -34,7 +34,7 @@ class AllFacetController extends MainController $Flimit = (new \App\Controllers\Facets\AddFacetController())->limitFacer($type, 'no.redirect'); $m = [ - 'og' => false, + 'og' => true, 'url' => getUrlByName($sheet), ]; diff --git a/app/Controllers/HomeController.php b/app/Controllers/HomeController.php index 10cde5c3..b9db3da8 100644 --- a/app/Controllers/HomeController.php +++ b/app/Controllers/HomeController.php @@ -5,7 +5,7 @@ namespace App\Controllers; use Hleb\Scheme\App\Controllers\MainController; use Hleb\Constructor\Handlers\Request; use App\Models\HomeModel; -use Config, Tpl, UserData, Meta; +use Config, Tpl, UserData, Meta, Translate; class HomeController extends MainController { @@ -37,8 +37,8 @@ class HomeController extends MainController $topics = \App\Models\FacetModel::advice($this->user['id']); } - $meta_title = Config::get('meta.' . $sheet . '.title'); - $meta_desc = Config::get('meta.' . $sheet . '.desc'); + $meta_title = sprintf(Translate::get($sheet . '.title'), Config::get('meta.name')); + $meta_desc = sprintf(Translate::get($sheet . '.desc'), Config::get('meta.name')); $m = [ 'og' => true, @@ -49,7 +49,7 @@ class HomeController extends MainController return Tpl::agRender( '/home', [ - 'meta' => Meta::get($m, $meta_title ?? Config::get('meta.title'), $meta_desc ?? Config::get('meta.desc')), + 'meta' => Meta::get($m, $meta_title, $meta_desc, 'main'), 'data' => [ 'pagesCount' => ceil($pagesCount / $this->limit), 'pNum' => $page, diff --git a/app/Language/de.php b/app/Language/de.php index 98056b7d..ece738ec 100644 --- a/app/Language/de.php +++ b/app/Language/de.php @@ -314,6 +314,7 @@ $data = [ 'notif.add.website' => 'Seite hinzugefügt %1$s Schlag es nach %2$s', 'notif.edit.website' => 'Website geändert, %1$s Hör zu %2$s', 'notif.approved.website' => '(Moderator ) %1$s genehmigt Ihre Website %2$s', + 'notif.add.website.comment' =>'%1$s die Seite kommentiert, die Sie abonniert haben %2$s', /* MSG */ 'string.length' => 'Length %1$s should be from %2$s -> %3$s characters ', @@ -453,11 +454,6 @@ $data = [ 'profile.comments.desc' => '%1$s — Teilnehmerkommentare in chronologischer Reihenfolge. %2$s', 'page-number' => ' Page %1$s. ', - 'main.top.title' => 'Popular posts. ', - 'main.top.desc' => 'List of popular posts in the community feed (by the number of replies). Topics of interest. Conversations, questions and answers, comments. ', - 'main.all.title' => 'All posts. ', - 'main.all.desc' => 'List of all posts in the community feed (by number of replies). Conversations, questions and answers, comments. ', - 'main.deleted.title' => 'Gelöschte Beiträge ', 'users.all' => 'List of participants', 'users.all.info' => 'List of participants in the order of their activity on the site', @@ -490,7 +486,14 @@ $data = [ 'topics.my' => 'I read ', 'topics.my.info' => 'Topics I follow, I read', 'topics.my.desc' => 'Topics that I read or have created', - + + 'main.feed.title' => '%1$s — Community (Themen, Blogs von Interesse)', + 'main.top.title' => '%1$s — Beliebte Beiträge', + 'main.all.title' => '%1$s — alle Artikel ', + 'main.feed.desc' => 'Interessenthemen, Feed, Blogs. Gespräche, Fragen und Antworten, Wissenswertes. Skripte CMS und soziale Netzwerke, Frameworks. Skript %1$s.', + 'main.top.desc' => 'Liste beliebter Beiträge im Community-Feed (nach Anzahl der Antworten). Themen nach Interesse. Gespräche, Fragen und Antworten, Kommentare. Skript %1$s.', + 'main.all.desc' => 'Liste aller Beiträge im Community-Feed. Skript %1$s.', + 'main.feed.info' => 'Posts in chronological order...', 'main.all.info' => 'All posts in the community feed...', 'main.top.info' => 'Recent active posts...', diff --git a/app/Language/en.php b/app/Language/en.php index a3ff0cc1..f757bbec 100644 --- a/app/Language/en.php +++ b/app/Language/en.php @@ -311,6 +311,7 @@ $data = [ 'notif.add.website' => 'added site %1$s look it up %2$s', 'notif.edit.website' => 'changed site, %1$s check it out %2$s', 'notif.approved.website' => '(moderator) %1$s approved your site %2$s', + 'notif.add.website.comment' =>'%1$s commented on the site you subscribed to %2$s', /* MSG */ 'string.length' => 'Length %1$s should be from %2$s -> %3$s characters ', @@ -449,11 +450,6 @@ $data = [ 'profile.comments.desc' => '%1$s — participant comments in chronological order. %2$s', 'page-number' => ' Page %1$s. ', - 'main.top.title' => 'Popular posts. ', - 'main.top.desc' => 'List of popular posts in the community feed (by the number of replies). Topics of interest. Conversations, questions and answers, comments. ', - 'main.all.title' => 'All posts. ', - 'main.all.desc' => 'List of all posts in the community feed (by number of replies). Conversations, questions and answers, comments. ', - 'main.deleted.title' => 'Deleted posts ', 'users.all' => 'List of participants', 'users.all.info' => 'List of participants in the order of their activity on the site', @@ -487,6 +483,13 @@ $data = [ 'topics.my.info' => 'Topics I follow, I read', 'topics.my.desc' => 'Topics that I read or have created', + 'main.feed.title' => '%1$s — community (topics, blogs of interest)', + 'main.top.title' => '%1$s — popular posts', + 'main.all.title' => '%1$s — all posts', + 'main.feed.desc' => 'Interest topics, feed, blogs. Conversations, questions and answers, interesting facts. Scripts CMS and social networks, Frameworks. Script %1$s.', + 'main.top.desc' => 'List of popular posts in the community feed (by number of replies). Topics by interest. Conversations, questions and answers, comments. Script %1$s.', + 'main.all.desc' => 'List of all posts in the community feed. Script %1$s.', + 'main.feed.info' => 'Posts in chronological order...', 'main.all.info' => 'All posts in the community feed...', 'main.top.info' => 'Recent active posts...', diff --git a/app/Language/fr.php b/app/Language/fr.php index 07de6858..cf4ea770 100644 --- a/app/Language/fr.php +++ b/app/Language/fr.php @@ -314,6 +314,7 @@ $data = [ 'notif.add.website' => 'site ajouté %1$s Cherchez-le %2$s', 'notif.edit.website' => 'changé de site, %1$s Vérifiez-le %2$s', 'notif.approved.website' => '(modérateur ) %1$s approuvé votre site %2$s', + 'notif.add.website.comment' =>'%1$s commenté sur le site auquel vous êtes abonné %2$s', /* MSG */ 'string.length' => 'Length %1$s should be from %2$s -> %3$s characters ', @@ -453,11 +454,6 @@ $data = [ 'profile.comments.desc' => '%1$s — commentaires des participants par ordre chronologique. %2$s', 'page-number' => ' Page %1$s. ', - 'main.top.title' => 'Popular posts. ', - 'main.top.desc' => 'List of popular posts in the community feed (by the number of replies). Topics of interest. Conversations, questions and answers, comments. ', - 'main.all.title' => 'All posts. ', - 'main.all.desc' => 'List of all posts in the community feed (by number of replies). Conversations, questions and answers, comments. ', - 'main.deleted.title' => 'Posts supprimés ', 'users.all' => 'List of participants', 'users.all.info' => 'List of participants in the order of their activity on the site', @@ -490,7 +486,14 @@ $data = [ 'topics.my' => 'I read ', 'topics.my.info' => 'Topics I follow, I read', 'topics.my.desc' => 'Topics that I read or have created', - + + 'main.feed.title' => '%1$s — communauté (sujets, blogs intérêt)', + 'main.top.title' => '%1$s — Articles populaires', + 'main.all.title' => '%1$s — Tous les messages', + 'main.feed.desc' => 'Sujets intérêt, flux, blogs. Conversations, questions et réponses, faits intéressants. Scripts CMS et réseaux sociaux, Frameworks. Scénario %1$s.', + 'main.top.desc' => 'Liste des messages populaires dans le fil de la communauté (par nombre de réponses). Sujets par intérêt. Conversations, questions et réponses, commentaires. Scénario %1$s.', + 'main.all.desc' => 'Liste de tous les messages du flux de la communauté. Scénario %1$s.', + 'main.feed.info' => 'Posts in chronological order...', 'main.all.info' => 'All posts in the community feed...', 'main.top.info' => 'Recent active posts...', diff --git a/app/Language/ro.php b/app/Language/ro.php index 79facda1..e28e2f51 100644 --- a/app/Language/ro.php +++ b/app/Language/ro.php @@ -311,6 +311,7 @@ $data = [ 'notif.add.website' => 'site adăugat %1$s cauta-l caut-o %2$s', 'notif.edit.website' => 'site schimbat , %1$s verifică %2$s', 'notif.approved.website' => '(moderator) %1$s a aprobat site-ul dvs %2$s', + 'notif.add.website.comment' =>'%1$s a comentat pe site-ul la care te-ai abonat %2$s', /* MSG */ 'string.length' => 'Lungimea %1$s trebuie să aibă între %2$s și %3$s caractere', @@ -455,11 +456,6 @@ $data = [ 'profile.comments.desc' => '%1$s — comentariile participanților în ordine cronologică. %2$s', 'page-number' => ' — pagina %1$s ', - 'main.top.title' => 'Posturi populare. ', - 'main.top.desc' => 'O listă de postări populare din feedul comunității (după numărul de răspunsuri). Subiecte de interes. Conversații, întrebări și Răspunsuri, Comentarii. ', - 'main.all.title' => 'Toate mesajele. ', - 'main.all.desc' => 'O listă a tuturor postărilor din feedul comunității (după numărul de răspunsuri). Conversații, întrebări și Răspunsuri, Comentarii. ', - 'main.deleted.title' => 'Postări șterse ', 'users.all' => 'Lista participanților', 'users.all.info' => 'Lista participanților în ordinea activității lor pe site', @@ -492,7 +488,14 @@ $data = [ 'topics.my' => 'Citesc', 'topics.my.info' => 'Subiecte pe care le urmăresc, le citesc', 'topics.my.desc' => 'Subiecte pe care le-am citit sau pe care le-am creat', - + + 'main.feed.title' => '%1$s — comunitate (subiecte, bloguri de interes)', + 'main.top.title' => '%1$s — postari populare', + 'main.all.title' => '%1$s — toate postările', + 'main.feed.desc' => 'Subiecte de interes, feed, bloguri. Conversații, întrebări și răspunsuri, fapte interesante. Scripturi CMS și rețele sociale, Framework. Scenariul %1$s.', + 'main.top.desc' => 'Lista postărilor populare din feedul comunității (după numărul de răspunsuri). Subiecte după interes. Conversații, întrebări și răspunsuri, comentarii. Scenariul %1$s.', + 'main.all.desc' => 'Lista tuturor postărilor din feedul comunității. Scenariul %1$s.', + 'main.feed.info' => 'Postări în ordine cronologică...', 'main.all.info' => 'Toate postările din fluxul comunității...', 'main.top.info' => 'Postări active recente...', diff --git a/app/Language/ru.php b/app/Language/ru.php index d2710968..670d1203 100644 --- a/app/Language/ru.php +++ b/app/Language/ru.php @@ -312,6 +312,7 @@ $data = [ 'notif.add.website' => 'добавил сайт %1$s посмотрите его %2$s', 'notif.edit.website' => 'изменил сайт, %1$s проверьте его %2$s', 'notif.approved.website' => '(модератор) %1$s утвердил ваш сайт %2$s', + 'notif.add.website.comment' =>'%1$s прокомментировал сайт на который вы подписались %2$s', /* MSG */ 'string.length' => 'Длина %1$s должна быть от %2$s до %3$s символов', @@ -454,11 +455,6 @@ $data = [ 'profile.comments.desc' => '%1$s — комментарии участника в хронологическом порядке. %2$s', 'page-number' => ' Страница %1$s ', - 'main.top.title' => 'Популярные посты ', - 'main.top.desc' => 'Список популярных постов в ленте сообщества (по количеству ответов). Темы по интересам. Беседы, вопросы и ответы, комментарии. ', - 'main.all.title' => 'Все посты ', - 'main.all.desc' => 'Список всех постов в ленте сообщества (по количеству ответов). Беседы, вопросы и ответы, комментарии. ', - 'main.deleted.title' => 'Удаленные посты ', 'users.all' => 'Список участников', 'users.all.info' => 'Список участников в порядке их активности на сайте', @@ -491,7 +487,14 @@ $data = [ 'topics.my' => 'Читаю', 'topics.my.info' => 'Темы, на которые я подписан, читаю', 'topics.my.desc' => 'Темы, которые я читаю или создал', - + + 'main.feed.title' => '%1$s — сообщество (темы, блоги по интересам)', + 'main.top.title' => '%1$s — популярные посты', + 'main.all.title' => '%1$s — все посты ', + 'main.feed.desc' => 'Темы по интересам, лента, блоги. Беседы, вопросы и ответы, интересные факты. Скрипты CMS и социальных сетей, Фреймворки. Скрипт %1$s.', + 'main.top.desc' => 'Список популярных постов в ленте сообщества (по количеству ответов). Темы по интересам. Беседы, вопросы и ответы, комментарии. Скрипт %1$s.', + 'main.all.desc' => 'Список всех постов в ленте сообщества. Скрипт %1$s.', + 'main.feed.info' => 'Посты в хронологическом порядке...', 'main.all.info' => 'Все посты в ленте сообщества...', 'main.top.info' => 'Активные посты за последнее время...', diff --git a/app/Language/zh.php b/app/Language/zh.php index 21798767..5e6b8db2 100644 --- a/app/Language/zh.php +++ b/app/Language/zh.php @@ -313,6 +313,7 @@ $data = [ 'notif.add.website' => '添加網站, %1$s 看 %2$s', 'notif.edit.website' => '更改站點, %1$s 看 %2$s', 'notif.approved.website' => '(主持人) %1$s 批准您的網站 %2$s', + 'notif.add.website.comment' =>'%1$s 评论了您订阅的网站 %2$s', /* MSG */ 'string.length' => '長度 %1$s 應該來自 %2$s -> %3$s 人物 ', @@ -452,11 +453,6 @@ $data = [ 'profile.comments.desc' => '%1$s — 參與者評論按時間順序排列. %2$s', 'page-number' => ' 頁 %1$s. ', - 'main.top.title' => '熱門帖子。 ', - 'main.top.desc' => '社區提要中的熱門帖子列表(按回複數量)。 感興趣的話題。 對話、問答、評論。 ', - 'main.all.title' => '所有帖子。 ', - 'main.all.desc' => '社區提要中所有帖子的列表(按回複數量)。 對話、問答、評論。 ', - 'main.deleted.title' => '已删除的帖子 ', 'users.all' => '參賽者名單', 'users.all.info' => '參與者名單按他們在網站上的活動順序排列', @@ -490,6 +486,13 @@ $data = [ 'topics.my.info' => '我關注的話題,我閱讀', 'topics.my.desc' => '我閱讀或創建的主題', + 'main.feed.title' => '%1$s — 社區(主題、感興趣的博客)', + 'main.top.title' => '%1$s — 熱門帖子', + 'main.all.title' => '%1$s — 所有帖子 ', + 'main.feed.desc' => '興趣主題、提要、博客。 對話、問答、有趣的事實。 腳本 CMS 和社交網絡、框架。 腳本 %1$s.', + 'main.top.desc' => '社區提要中的熱門帖子列表(按回複數)。 興趣話題。 對話、問答、評論。 腳本 %1$s.', + 'main.all.desc' => '社區提要中所有帖子的列表。 腳本 %1$s.', + 'main.feed.info' => '按時間順序發帖...', 'main.all.info' => '社區提要中的所有帖子...', 'main.top.info' => '最近的活躍帖子...', diff --git a/app/Libraries/Meta.php b/app/Libraries/Meta.php index 704b30f4..b1156fbb 100644 --- a/app/Libraries/Meta.php +++ b/app/Libraries/Meta.php @@ -2,7 +2,7 @@ class Meta { - public static function get($m, $title = '', $desc = '', $date_article = '') + public static function get($m, $title = '', $desc = '', $date_article = '', $url_page = '') { $output = ''; if ($title == '') { @@ -12,8 +12,13 @@ class Meta $desc = Config::get('meta.name'); } - $output .= '' . $title . ' | ' . Config::get('meta.name') . '' - . ''; + if ($url_page = 'main') { + $output .= '' . $title . ''; + } else { + $output .= '' . $title . ' | ' . Config::get('meta.name') . ''; + } + + $output .= ''; if ($date_article != '') { $output .= '' @@ -25,12 +30,12 @@ class Meta $output .= ''; } - if ($m['og']) { + if (!empty($m['og'])) { $output .= '' . '' . ''; - if ($m['imgurl']) { + if (!empty($m['imgurl'])) { $output .= '' . '' . ''; diff --git a/app/Models/NotificationModel.php b/app/Models/NotificationModel.php index ba8eb7d8..7de99241 100644 --- a/app/Models/NotificationModel.php +++ b/app/Models/NotificationModel.php @@ -41,6 +41,7 @@ class NotificationModel extends \Hleb\Scheme\App\Models\MainModel const TYPE_ADD_WEBSITE = 30; // site added const TYPE_EDIT_WEBSITE = 31; // changed and status changed const WEBSITE_APPROVED = 32; // approved + const TYPE_ADD_REPLY_WEBSITE = 34; // replica added to the site // Лист уведомлений public static function listNotification($uid) diff --git a/config/meta.php b/config/meta.php index a38ae7f8..960fb36c 100644 --- a/config/meta.php +++ b/config/meta.php @@ -8,7 +8,6 @@ return [ 'url' => 'https://libarea.ru', 'name' => 'LibArea', 'title' => 'LibArea — сообщество (темы, блоги по интересам)', - 'desc' => 'Темы по интересам, лента, блоги. Беседы, вопросы и ответы, интересные факты. Скрипты CMS и социальных сетей, Фреймворки. Скрипт LibArea.', 'img_path' => '/assets/images/libarea.jpg', // For the main page - the banner title and text diff --git a/modules/admin/view/default/header.php b/modules/admin/view/default/header.php index 5edd2a36..de745ff1 100644 --- a/modules/admin/view/default/header.php +++ b/modules/admin/view/default/header.php @@ -1,5 +1,5 @@ addStyles('/assets/css/style.css?02'); +Request::getHead()->addStyles('/assets/css/style.css?08'); ?> $meta]); ?> diff --git a/modules/catalog/App/Catalog.php b/modules/catalog/App/Catalog.php index 37a93fe7..d657d941 100644 --- a/modules/catalog/App/Catalog.php +++ b/modules/catalog/App/Catalog.php @@ -67,7 +67,6 @@ class Catalog 'childrens' => $childrens, 'user_count_site' => $count_site, 'breadcrumb' => self::breadcrumb($parent, $category, $screening), - // 'low_topics' => FacetModel::getLowLevelList($category['facet_id']), 'low_matching' => FacetModel::getLowMatching($category['facet_id']), ] ] diff --git a/modules/catalog/App/Models/WebModel.php b/modules/catalog/App/Models/WebModel.php index 86c5f06f..c4b71b90 100644 --- a/modules/catalog/App/Models/WebModel.php +++ b/modules/catalog/App/Models/WebModel.php @@ -374,4 +374,17 @@ class WebModel extends \Hleb\Scheme\App\Models\MainModel return DB::run($sql, ['id' => $id]); } + + // Кто подписан на данный сайт + public static function getFocusUsersItem($item_id) + { + $sql = "SELECT + signed_item_id, + signed_user_id + FROM items_signed + WHERE signed_item_id = :item_id"; + + return DB::run($sql, ['item_id' => $item_id])->fetchAll(); + } + } diff --git a/modules/catalog/App/Reply.php b/modules/catalog/App/Reply.php index 0b86aa18..0c26de60 100644 --- a/modules/catalog/App/Reply.php +++ b/modules/catalog/App/Reply.php @@ -4,7 +4,7 @@ namespace Modules\Catalog\App; use Hleb\Constructor\Handlers\Request; use Modules\Catalog\App\Models\{WebModel, ReplyModel}; -use App\Models\ActionModel; +use App\Models\{ActionModel, NotificationModel}; use Translate, UserData, Html, Validation, Content; class Reply @@ -122,6 +122,22 @@ class Reply (new \App\Controllers\AuditController())->create('reply', $last_id, $url); } + // Кто подписан на данный вопрос / пост + if ($focus_all = WebModel::getFocusUsersItem($item['item_id'])) { + foreach ($focus_all as $focus_user) { + if ($focus_user['signed_user_id'] != $this->user['id']) { + NotificationModel::send( + [ + 'sender_id' => $this->user['id'], + 'recipient_id' => $focus_user['signed_user_id'], + 'action_type' => NotificationModel::TYPE_ADD_REPLY_WEBSITE, + 'url' => $url, + ] + ); + } + } + } + redirect($url); } diff --git a/modules/catalog/view/default/css/catalog.scss b/modules/catalog/view/default/css/catalog.scss index b8eeb012..5e633161 100644 --- a/modules/catalog/view/default/css/catalog.scss +++ b/modules/catalog/view/default/css/catalog.scss @@ -87,7 +87,7 @@ main { margin-left: 30px; } margin-bottom: 10px; } -@media (max-width: 980px) { +@media (max-width: 890px) { aside, .logo { display: none; diff --git a/modules/catalog/view/default/header.php b/modules/catalog/view/default/header.php index 633890d3..19d61bc3 100644 --- a/modules/catalog/view/default/header.php +++ b/modules/catalog/view/default/header.php @@ -1,6 +1,6 @@ addStyles('/assets/css/style.css?02'); -Request::getHead()->addStyles('/assets/css/catalog.css?02'); +Request::getHead()->addStyles('/assets/css/style.css?08'); +Request::getHead()->addStyles('/assets/css/catalog.css?08'); ?> $meta]); ?> diff --git a/modules/catalog/view/default/home.php b/modules/catalog/view/default/home.php index fe6bce47..c368afcc 100644 --- a/modules/catalog/view/default/home.php +++ b/modules/catalog/view/default/home.php @@ -29,7 +29,7 @@
-
+
$data, 'uid' => $user['id']]); ?> $data, 'user' => $user, 'screening' => $data['screening']]); ?> diff --git a/modules/catalog/view/default/website.php b/modules/catalog/view/default/website.php index 91ead751..ccc0069a 100644 --- a/modules/catalog/view/default/website.php +++ b/modules/catalog/view/default/website.php @@ -9,7 +9,7 @@ $item = $data['item'];
-
+