diff --git a/app/Controllers/ExploreController.php b/app/Controllers/ExploreController.php new file mode 100644 index 00000000..45c90d15 --- /dev/null +++ b/app/Controllers/ExploreController.php @@ -0,0 +1,27 @@ +addStyles('/assets/css/explore.css'); + + $uid = Base::getUid(); + $data = [ + 'h1' => lang('Explore'), + 'meta_title' => lang('explore-title') .' | '. Config::get(Config::PARAM_NAME), + 'meta_desc' => lang('explore-desc') .' '. Config::get(Config::PARAM_HOME_TITLE), + 'sheet' => 'explore', + 'canonical' => Config::get(Config::PARAM_URL) . '/explore', + ]; + + return view(PR_VIEW_DIR . '/explore/index', ['data' => $data, 'uid' => $uid]); + } + +} diff --git a/app/Controllers/InfoController.php b/app/Controllers/InfoController.php index 3524df82..18f15a4b 100644 --- a/app/Controllers/InfoController.php +++ b/app/Controllers/InfoController.php @@ -13,9 +13,12 @@ class InfoController extends \MainController { Request::getResources()->addBottomStyles('/assets/css/info.css'); + $text = file_get_contents(TEMPLATE_DIR. '/info/md/index.md'); + $uid = Base::getUid(); $data = [ 'h1' => lang('Info'), + 'content' => Base::text($text, 'md'), 'canonical' => Config::get(Config::PARAM_URL) . '/info', 'sheet' => 'info', 'meta_title' => lang('Info') .' | '. Config::get(Config::PARAM_NAME), @@ -27,27 +30,15 @@ class InfoController extends \MainController public function stats() { - // Количество: участников, постов, комментариев и голосов по ним - $user_num = InfoModel::getUsersNumAll(); - $post_num = InfoModel::getPostsNumAll(); - $comm_num = InfoModel::getCommentsNumAll(); - $vote_comm_num = InfoModel::getCommentsVoteNumAll(); - $vote_post_num = InfoModel::getPostVoteNumAll(); - $flow_num = InfoModel::GrafAnsw(); - Request::getResources()->addBottomStyles('/assets/css/info.css'); Request::getHead()->addScript('/assets/js/Chart.js'); - + $uid = Base::getUid(); $data = [ 'h1' => lang('Statistics'), 'canonical' => Config::get(Config::PARAM_URL) . '/info/stats', - 'user_num' => $user_num, - 'post_num' => $post_num, - 'comm_num' => $comm_num, - 'vote_comm_num' => $vote_comm_num, - 'vote_post_num' => $vote_post_num, - 'flow_num' => $flow_num, + 'flow_num' => InfoModel::GrafAnsw(), + 'stats' => InfoModel::getStatsAll(), 'sheet' => 'stats', 'meta_title' => lang('Statistics') .' | '. Config::get(Config::PARAM_NAME), 'meta_desc' => lang('stats-desc') .' '. Config::get(Config::PARAM_HOME_TITLE), @@ -60,9 +51,12 @@ class InfoController extends \MainController { Request::getResources()->addBottomStyles('/assets/css/info.css'); + $text = file_get_contents(TEMPLATE_DIR. '/info/md/privacy.md'); + $uid = Base::getUid(); $data = [ 'h1' => lang('Privacy Policy'), + 'content' => Base::text($text, 'md'), 'canonical' => Config::get(Config::PARAM_URL) . '/info/privacy', 'sheet' => 'privacy', 'meta_title' => lang('Privacy Policy') .' | '. Config::get(Config::PARAM_NAME), @@ -74,7 +68,6 @@ class InfoController extends \MainController public function restriction() { - Request::getResources()->addBottomStyles('/assets/css/info.css'); $uid = Base::getUid(); diff --git a/app/Language/ru/lang.php b/app/Language/ru/lang.php index 07b6d900..75bd3f8a 100644 --- a/app/Language/ru/lang.php +++ b/app/Language/ru/lang.php @@ -294,6 +294,9 @@ return [ 'Empty request' => 'Пустой поисковый запрос', 'Enter' => 'Введите', 'Enter your password' => 'Введите пароль', + 'Explore' => 'Открытие', + 'explore-title' => 'Исследовать', + 'explore-desc' => 'Эта сводная страница последней сводки на сайте', 'No account available' => 'Нет учетной записи', 'Description is formed' => 'Описание формируется', diff --git a/app/Models/ExploreModel.php b/app/Models/ExploreModel.php new file mode 100644 index 00000000..054258e2 --- /dev/null +++ b/app/Models/ExploreModel.php @@ -0,0 +1,14 @@ +from(['users']); + // $sql = "show table status"; + $sql = "SELECT + (SELECT COUNT(*) FROM answers) AS answer, + (SELECT COUNT(*) FROM posts) AS post, + (SELECT COUNT(*) FROM comments) AS comment, + (SELECT COUNT(*) FROM users) AS user"; - return count($query->getSelect()); + return DB::run($sql)->fetchAll(PDO::FETCH_ASSOC); } - - // Количество постов - public static function getPostsNumAll() - { - $query = XD::select('*')->from(['posts']); - - return count($query->getSelect()); - } - - // Количество комментариев - public static function getCommentsNumAll() - { - $query = XD::select('*')->from(['comments']); - - return count($query->getSelect()); - } - - // Голосование за комментарии - public static function getCommentsVoteNumAll() - { - $query = XD::select('*')->from(['votes_comm']); - - return count($query->getSelect()); - } - - // Голосование за посты - public static function getPostVoteNumAll() - { - $query = XD::select('*')->from(['votes_post']); - - return count($query->getSelect()); - } - - // Для статистики по ответам + public static function GrafAnsw() { $sql = "SELECT COUNT(votes_answ_id), DATE(votes_answ_date) as date FROM votes_answ GROUP BY date limit 10"; diff --git a/app/Optional/MainConnector.php b/app/Optional/MainConnector.php index ad3c4fd2..592b8215 100644 --- a/app/Optional/MainConnector.php +++ b/app/Optional/MainConnector.php @@ -24,7 +24,7 @@ class MainConnector implements Connector // ... or, if a specific class is added, "DB" => "database/DB.php", "XdORM\XD" => "vendor/phphleb/xdorm/XD.php", - //"Phphleb\Debugpan\DPanel" => "vendor/phphleb/debugpan/DPanel.php", + // "Phphleb\Debugpan\DPanel" => "vendor/phphleb/debugpan/DPanel.php", "Lori\Base" => "app/Libraries/Base.php", "Lori\Config" => "app/Config/Config.php", diff --git a/public/assets/css/explore.css b/public/assets/css/explore.css new file mode 100644 index 00000000..fd28dd4b --- /dev/null +++ b/public/assets/css/explore.css @@ -0,0 +1,3 @@ +.explore { + +} \ No newline at end of file diff --git a/public/assets/css/style.css b/public/assets/css/style.css index 91dca849..ab8e9eaf 100644 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -110,6 +110,10 @@ body > main { padding: 0.4rem 0.4rem; } +.w-33 { + width: 33%; +} + main.w-100 { width: 100%; max-width: 100%; @@ -166,6 +170,10 @@ h3.lo { float: right; } +.left { + float: left; +} + code { color: #b63e56; background: #f5f2f0; @@ -239,6 +247,8 @@ a.link:hover { color: rgba(33, 32, 31, 0.5); font-size: 15px; border-radius: 2px; + text-align: center; + overflow: hidden; } .banner h1 { diff --git a/public/assets/images/discord-bot.png b/public/assets/images/discord-bot.png new file mode 100644 index 00000000..6ac0d259 Binary files /dev/null and b/public/assets/images/discord-bot.png differ diff --git a/public/assets/images/explore/Card01.png b/public/assets/images/explore/Card01.png new file mode 100644 index 00000000..79d6d07a Binary files /dev/null and b/public/assets/images/explore/Card01.png differ diff --git a/public/assets/images/explore/Card02.png b/public/assets/images/explore/Card02.png new file mode 100644 index 00000000..de389418 Binary files /dev/null and b/public/assets/images/explore/Card02.png differ diff --git a/public/assets/images/explore/Card03.png b/public/assets/images/explore/Card03.png new file mode 100644 index 00000000..c5d46f75 Binary files /dev/null and b/public/assets/images/explore/Card03.png differ diff --git a/public/assets/images/explore/Card04.png b/public/assets/images/explore/Card04.png new file mode 100644 index 00000000..a5e119e1 Binary files /dev/null and b/public/assets/images/explore/Card04.png differ diff --git a/public/assets/images/explore/Card05.png b/public/assets/images/explore/Card05.png new file mode 100644 index 00000000..3da7144e Binary files /dev/null and b/public/assets/images/explore/Card05.png differ diff --git a/public/assets/images/explore/Card06.png b/public/assets/images/explore/Card06.png new file mode 100644 index 00000000..631ad7c5 Binary files /dev/null and b/public/assets/images/explore/Card06.png differ diff --git a/public/assets/images/explore/Card07.png b/public/assets/images/explore/Card07.png new file mode 100644 index 00000000..623a9460 Binary files /dev/null and b/public/assets/images/explore/Card07.png differ diff --git a/public/assets/images/explore/Card08.png b/public/assets/images/explore/Card08.png new file mode 100644 index 00000000..d0552fae Binary files /dev/null and b/public/assets/images/explore/Card08.png differ diff --git a/resources/views/default/explore/index.php b/resources/views/default/explore/index.php new file mode 100644 index 00000000..f7cd6d8c --- /dev/null +++ b/resources/views/default/explore/index.php @@ -0,0 +1,33 @@ + + +
+ + +Это Интернет, у вас нет конфиденциальности.
+ = $data['content']; ?> -Если вам - не исполнилось 13 лет, то в этом случае вам сюда не разрешено. -
- -Пожалуйста, относитесь к этому сайту с таким же уважением, как относитесь к собственному дому.
-