fix
This commit is contained in:
1 parent
0cb150b0e4
commit
4e517a4076
4 files changed
+99
-12
No files matched your search
@@ -3,9 +3,10 @@
|
||||
use Core\CoreException;
|
||||
use Core\ExternalServices\Telegram;
|
||||
use Core\Models\{User, DB};
|
||||
use Core\Helpers\{SystemFunctions, Cache, Log, Mail, Zip};
|
||||
use Core\Helpers\{SystemFunctions, Cache, Log, Mail, Zip, Pagination};
|
||||
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/core/bootstrap.php';
|
||||
echo '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css">';
|
||||
|
||||
echo '<a href="/admin/">{{ADMIN_PANEL_LINK_NAME}}</a> | <a href="/?clear_cache=Y">{{CLEAR_CACHE_LINK_NAME}}</a> | <a href="/">{{REFRESH_PAGE_LINK_NAME}}</a> <br>';
|
||||
|
||||
@@ -25,13 +26,21 @@
|
||||
echo SystemFunctions::arrayToTable($user->getAllUserData(), 'Информация о пользователе');
|
||||
}
|
||||
|
||||
//echo SystemFunctions::arrayToTable(Cache::getCacheInfo(), 'Информация о кэше');
|
||||
|
||||
echo SystemFunctions::arrayToTable(Cache::getCacheInfo(), 'Информация о кэше');
|
||||
|
||||
$arPosts = (DB::getInstance())->query('select * from d_posts where post_type="post" and post_status="publish" order by id desc limit 10');
|
||||
|
||||
|
||||
|
||||
$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[] = [
|
||||
$arResult[$post['ID']] = [
|
||||
'title' => $post['post_title'],
|
||||
'postname' => $post['post_name'],
|
||||
'date' => $post['post_date'],
|
||||
@@ -40,5 +49,8 @@ foreach($arPosts as $post) {
|
||||
|
||||
];
|
||||
}
|
||||
echo '<nav aria-label="Page navigation example">';
|
||||
Pagination::show('page');
|
||||
echo '</nav>';
|
||||
|
||||
echo SystemFunctions::arrayToTable($arResult, 'Статьи');
|
||||
Reference in new issue
Block a user