Add page navigation for static pages

This commit is contained in:
danpros 2023-12-31 09:11:14 +07:00
commit 4b70fab511
4 changed files with 299 additions and 49 deletions

View file

@ -1,16 +1,16 @@
<?php if (!defined('HTMLY')) die('HTMLy'); ?>
<?php
foreach (glob('cache/page/*.cache', GLOB_NOSORT) as $file) {
unlink($file);
}
foreach (glob('cache/index/*.txt', GLOB_NOSORT) as $file) {
unlink($file);
}
rebuilt_cache('all');
foreach (glob('cache/page/*.cache', GLOB_NOSORT) as $file) {
unlink($file);
}
echo i18n('All_cache_has_been_deleted');
?>

View file

@ -8,7 +8,6 @@
if (isset($_SESSION[config("site.url")]['user'])) {
$posts = get_static_post(null);
if (!empty($posts)) {
krsort($posts);
echo '<table class="table post-list">';
echo '<tr class="head"><th>' . i18n('Title') . '</th>';
if (config("views.counter") == "true")
@ -33,8 +32,7 @@ if (isset($_SESSION[config("site.url")]['user'])) {
echo '<td><a class="btn btn-primary btn-xs" href="' . $p->url . '/add?destination=admin/pages">' . i18n('Add_sub') . '</a> <a class="btn btn-primary btn-xs" href="' . $p->url . '/edit?destination=admin/pages">' . i18n('Edit') . '</a> <a class="btn btn-danger btn-xs" href="' . $p->url . '/delete?destination=admin/pages">' . i18n('Delete') . '</a></td>';
echo '</tr>';
$shortUrl = substr($p->url, strrpos($p->url, "/") + 1);
$subPages = get_static_sub_post($shortUrl, null);
$subPages = get_static_sub_post($p->md);
foreach ($subPages as $sp) {
echo '<tr class="' . $class . '">';