'; echo '{{ADMIN_PANEL_LINK_NAME}} | {{CLEAR_CACHE_LINK_NAME}} | {{REFRESH_PAGE_LINK_NAME}}
'; Telegram::init('5232660453:AAGfMWu6EcRfBGSSURJsEEvGPmAqhCyzYHU', './'); $userId = User::getCurrentUserId(); try { $user = new User($userId); User::authorize((int)$userId); echo 'Current user id: ' . $userId . '
'; } catch (CoreException $e) { echo $e->showTrace(); } echo '

'; if (User::isAuthorized()) { echo SystemFunctions::arrayToTable($user->getAllUserData(), 'Информация о пользователе'); } //echo SystemFunctions::arrayToTable(Cache::getCacheInfo(), 'Информация о кэше'); $count = (int)(DB::getInstance())->query('select count(*) as count from d_posts where post_type="post" and post_status="publish"')[0]['count']; Pagination::execute($_REQUEST['page'], $count, 3); $limit = Pagination::getLimit(); $arPosts = (DB::getInstance())->query('select * from d_posts where post_type="post" and post_status="publish" order by id desc limit ' . $limit); $arResult = []; foreach($arPosts as $post) { $arResult[$post['ID']] = [ 'title' => $post['post_title'], 'postname' => $post['post_name'], 'date' => $post['post_date'], 'userId' => $post['post_author'], 'userName' => (new User((int)$post['post_author']))->getName() ]; } echo ''; echo SystemFunctions::arrayToTable($arResult, 'Статьи');