From 8d142b7f37f3aa627fc446ec45278140a1d9dac5 Mon Sep 17 00:00:00 2001 From: danpros Date: Fri, 26 Jan 2024 08:06:12 +0700 Subject: [PATCH] Improve pages/subpages Allow to reorder the pages and subpages position. Added doks theme --- system/admin/admin.php | 100 +- system/admin/views/add-content.html.php | 2 +- system/admin/views/categories.html.php | 14 +- system/admin/views/category-list.html.php | 8 +- system/admin/views/edit-content.html.php | 2 +- system/admin/views/edit-page.html.php | 12 +- system/admin/views/layout.html.php | 1 + system/admin/views/menu.html.php | 1 + system/admin/views/popular-posts.html.php | 4 + system/admin/views/posts-list.html.php | 4 + system/admin/views/scheduled.html.php | 4 + system/admin/views/static-pages.html.php | 84 +- system/admin/views/static-subpages.html.php | 57 + system/admin/views/user-draft.html.php | 12 +- system/admin/views/user-posts.html.php | 4 + system/htmly.php | 89 +- system/includes/dispatch.php | 2 +- system/includes/functions.php | 99 +- system/resources/js/jquery-ui.min.js | 13 +- themes/doks/404-search.html.php | 10 + themes/doks/404.html.php | 10 + themes/doks/LICENSE.txt | 21 + themes/doks/README.md | 16 + themes/doks/css/style.css | 3535 ++++++++++++++++++++ themes/doks/fonts/jost/jost-v4-latin-500.woff | Bin 0 -> 12888 bytes themes/doks/fonts/jost/jost-v4-latin-500.woff2 | Bin 0 -> 9828 bytes .../doks/fonts/jost/jost-v4-latin-500italic.woff | Bin 0 -> 14504 bytes .../doks/fonts/jost/jost-v4-latin-500italic.woff2 | Bin 0 -> 11108 bytes themes/doks/fonts/jost/jost-v4-latin-700.woff | Bin 0 -> 12928 bytes themes/doks/fonts/jost/jost-v4-latin-700.woff2 | Bin 0 -> 9820 bytes .../doks/fonts/jost/jost-v4-latin-700italic.woff | Bin 0 -> 14616 bytes .../doks/fonts/jost/jost-v4-latin-700italic.woff2 | Bin 0 -> 11112 bytes themes/doks/fonts/jost/jost-v4-latin-italic.woff | Bin 0 -> 13580 bytes themes/doks/fonts/jost/jost-v4-latin-italic.woff2 | Bin 0 -> 10352 bytes themes/doks/fonts/jost/jost-v4-latin-regular.woff | Bin 0 -> 11820 bytes themes/doks/fonts/jost/jost-v4-latin-regular.woff2 | Bin 0 -> 8864 bytes themes/doks/img/soundcloud.jpg | Bin 0 -> 29258 bytes themes/doks/js/main.js | 11 + themes/doks/js/toc.js | 72 + themes/doks/layout--static.html.php | 103 + themes/doks/layout.html.php | 135 + themes/doks/main.html.php | 147 + themes/doks/no-posts.html.php | 9 + themes/doks/post.html.php | 110 + themes/doks/profile.html.php | 95 + themes/doks/static.html.php | 168 + 46 files changed, 4860 insertions(+), 94 deletions(-) create mode 100644 system/admin/views/static-subpages.html.php create mode 100644 themes/doks/404-search.html.php create mode 100644 themes/doks/404.html.php create mode 100644 themes/doks/LICENSE.txt create mode 100644 themes/doks/README.md create mode 100644 themes/doks/css/style.css create mode 100644 themes/doks/fonts/jost/jost-v4-latin-500.woff create mode 100644 themes/doks/fonts/jost/jost-v4-latin-500.woff2 create mode 100644 themes/doks/fonts/jost/jost-v4-latin-500italic.woff create mode 100644 themes/doks/fonts/jost/jost-v4-latin-500italic.woff2 create mode 100644 themes/doks/fonts/jost/jost-v4-latin-700.woff create mode 100644 themes/doks/fonts/jost/jost-v4-latin-700.woff2 create mode 100644 themes/doks/fonts/jost/jost-v4-latin-700italic.woff create mode 100644 themes/doks/fonts/jost/jost-v4-latin-700italic.woff2 create mode 100644 themes/doks/fonts/jost/jost-v4-latin-italic.woff create mode 100644 themes/doks/fonts/jost/jost-v4-latin-italic.woff2 create mode 100644 themes/doks/fonts/jost/jost-v4-latin-regular.woff create mode 100644 themes/doks/fonts/jost/jost-v4-latin-regular.woff2 create mode 100644 themes/doks/img/soundcloud.jpg create mode 100644 themes/doks/js/main.js create mode 100644 themes/doks/js/toc.js create mode 100644 themes/doks/layout--static.html.php create mode 100644 themes/doks/layout.html.php create mode 100644 themes/doks/main.html.php create mode 100644 themes/doks/no-posts.html.php create mode 100644 themes/doks/post.html.php create mode 100644 themes/doks/profile.html.php create mode 100644 themes/doks/static.html.php diff --git a/system/admin/admin.php b/system/admin/admin.php index bb2e1a3..20eae6a 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -550,6 +550,8 @@ function add_page($title, $url, $content, $draft, $description = null) function add_sub_page($title, $url, $content, $static, $draft, $description = null) { + $post = find_page($static); + $static = pathinfo($post['current']->md, PATHINFO_FILENAME); $post_title = safe_html($title); $post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url))); $description = safe_html($description); @@ -604,10 +606,17 @@ function add_sub_page($title, $url, $content, $static, $draft, $description = nu function edit_page($title, $url, $content, $oldfile, $revertPage, $publishDraft, $destination = null, $description = null, $static = null) { $dir = pathinfo($oldfile, PATHINFO_DIRNAME); + $fn = explode('.', pathinfo($oldfile, PATHINFO_FILENAME)); + if (isset($fn[1])) { + $num = $fn[0] . '.'; + } else { + $num = null; + } $views = array(); $viewsFile = "content/data/views.json"; $post_title = safe_html($title); - $post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url))); + $pUrl = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url))); + $post_url = $num . $pUrl; $description = safe_html($description); if ($description !== null) { if (!empty($description)) { @@ -663,10 +672,16 @@ function edit_page($title, $url, $content, $oldfile, $revertPage, $publishDraft, } } + $cl = explode('.', $post_url); + if (isset($cl[1])) { + $pu = $cl[1]; + } else { + $pu = $post_url; + } if (!empty($static)) { - $posturl = site_url() . $static .'/'. $post_url; + $posturl = site_url() . $static .'/'. $pu; } else { - $posturl = site_url() . $post_url; + $posturl = site_url() . $pu; } rebuilt_cache('all'); @@ -957,14 +972,20 @@ function find_draft_page($static = null) $post = new stdClass; // The static page URL - $url= $v['filename']; + $fn = explode('.', $v['filename']); + + if (isset($fn[1])) { + $url = $fn[1]; + } else { + $url= $v['filename']; + } $post->url = site_url() . $url; $post->file = $v['dirname'] . '/' . $v['basename']; $post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($post->file))); - $post->md = $url; + $post->md = $v['basename']; $post->slug = $url; $post->parent = null; @@ -1010,8 +1031,14 @@ function find_draft_subpage($static = null, $sub_static = null) $post = new stdClass; - // The static file - $url= $v['filename']; + // The static page URL + $fn = explode('.', $v['filename']); + + if (isset($fn[1])) { + $url = $fn[1]; + } else { + $url= $v['filename']; + } if (is_null($static)) { $parent = str_replace('content/static/', '', dirname($v['dirname'])); @@ -1025,7 +1052,7 @@ function find_draft_subpage($static = null, $sub_static = null) $post->file = $v['dirname'] . '/' . $v['basename']; $post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($post->file))); - $post->md = $url; + $post->md = $v['basename']; $post->slug = $url; // Get the contents and convert it to HTML @@ -1463,3 +1490,60 @@ function rename_category_folder($new_name, $old_file) } } + +// reorder the static page +function reorder_pages($pages = null) +{ + + $i = 1; + $arr = array(); + $dir = 'content/static/'; + foreach ($pages as $p) { + $fn = pathinfo($p, PATHINFO_FILENAME); + $num = str_pad($i, 2, 0, STR_PAD_LEFT); + $arr = explode('.' , $fn); + if (isset($arr[1])) { + rename ($dir . $p, $dir . $num . '.' . $arr[1] . '.md'); + + if (is_dir($dir . $fn)) { + rename($dir . $fn, $dir . $num . '.' . $arr[1]); + } + + } else { + rename($dir . $p, $dir . $num . '.' . $fn . '.md'); + + if (is_dir($dir . $fn)) { + rename($dir . $fn, $dir . $num . '.' . $fn); + } + + } + $i++; + } + + rebuilt_cache(); + +} + +// reorder the subpage +function reorder_subpages($subpages = null) +{ + $i = 1; + $arr = array(); + $dir = 'content/static/'; + foreach ($subpages as $sp) { + $dn = $dir . pathinfo($sp, PATHINFO_DIRNAME) . '/'; + $fn = pathinfo($sp, PATHINFO_FILENAME); + $num = str_pad($i, 2, 0, STR_PAD_LEFT); + $arr = explode('.' , $fn); + if (isset($arr[1])) { + rename ($dir . $sp, $dn . $num . '.' . $arr[1] . '.md'); + } else { + rename($dir . $sp, $dn . $num . '.' . $fn . '.md'); + } + + $i++; + + } + + rebuilt_cache(); +} diff --git a/system/admin/views/add-content.html.php b/system/admin/views/add-content.html.php index b8530bc..036b7cf 100644 --- a/system/admin/views/add-content.html.php +++ b/system/admin/views/add-content.html.php @@ -98,7 +98,7 @@ $( function() {
diff --git a/system/admin/views/categories.html.php b/system/admin/views/categories.html.php index 2e67526..cfe1700 100644 --- a/system/admin/views/categories.html.php +++ b/system/admin/views/categories.html.php @@ -7,20 +7,24 @@ $desc = get_category_info(null);

+ + + - + - - md !== 'uncategorized'):?> - - + + slug !== 'uncategorized'):?> + + +
title;?>title;?> body;?>md) + $d->count + get_scheduledcount($d->md); echo $total?> count == 0 && get_draftcount($d->md) == 0 && get_scheduledcount($d->md) == 0){echo '' . i18n('Delete') . '';}?>slug) + $d->count + get_scheduledcount($d->slug); echo $total?> count == 0 && get_draftcount($d->slug) == 0 && get_scheduledcount($d->slug) == 0){echo '' . i18n('Delete') . '';}?>
diff --git a/system/admin/views/category-list.html.php b/system/admin/views/category-list.html.php index b3548db..c7d1d23 100644 --- a/system/admin/views/category-list.html.php +++ b/system/admin/views/category-list.html.php @@ -6,18 +6,21 @@

+ + + url !== site_url() . 'category/uncategorized') {?> - + @@ -25,6 +28,7 @@ +
title ?> date) ?>

diff --git a/system/admin/views/edit-content.html.php b/system/admin/views/edit-content.html.php index 7fda7b2..7af29fd 100644 --- a/system/admin/views/edit-content.html.php +++ b/system/admin/views/edit-content.html.php @@ -143,7 +143,7 @@ $( function() {
diff --git a/system/admin/views/edit-page.html.php b/system/admin/views/edit-page.html.php index 9ac3455..7eca1ad 100644 --- a/system/admin/views/edit-page.html.php +++ b/system/admin/views/edit-page.html.php @@ -34,8 +34,8 @@ if ($type == 'is_frontpage') { $oldtitle = $p->title; $olddescription = $p->description; $oldcontent = $p->body; - $oldmd = $p->md; - $url = 'content/data/category/'. $p->md . '.md'; + $oldmd = $p->slug; + $url = 'content/data/category/'. $p->slug . '.md'; } else { if (isset($p->file)) { @@ -55,7 +55,13 @@ if ($type == 'is_frontpage') { } $dir = pathinfo($url, PATHINFO_DIRNAME); $oldurl = pathinfo($url, PATHINFO_BASENAME); - $oldmd = pathinfo($url, PATHINFO_FILENAME); + + $fn = explode('.', pathinfo($url, PATHINFO_FILENAME)); + if (isset($fn[1])) { + $oldmd = $fn[1]; + } else { + $oldmd = pathinfo($url, PATHINFO_FILENAME); + } if (isset($p->url)) { $delete = $p->url . '/delete?destination=' . $destination; diff --git a/system/admin/views/layout.html.php b/system/admin/views/layout.html.php index 691fa18..ba3eb73 100644 --- a/system/admin/views/layout.html.php +++ b/system/admin/views/layout.html.php @@ -10,6 +10,7 @@ + diff --git a/system/admin/views/menu.html.php b/system/admin/views/menu.html.php index a0304b5..966094c 100644 --- a/system/admin/views/menu.html.php +++ b/system/admin/views/menu.html.php @@ -107,6 +107,7 @@ function parseMenu($menu) { data: {'json': js}, success: function (response) { alert(response.message); + location.reload(); }, }); }); diff --git a/system/admin/views/popular-posts.html.php b/system/admin/views/popular-posts.html.php index 5bce88c..177a93b 100644 --- a/system/admin/views/popular-posts.html.php +++ b/system/admin/views/popular-posts.html.php @@ -5,6 +5,7 @@

+ @@ -14,6 +15,8 @@ + + file, '/scheduled/') == false && strpos($p->file, '/draft/') == false) { ?> @@ -29,6 +32,7 @@ +

+ @@ -14,6 +15,8 @@ + + @@ -27,6 +30,7 @@ class="btn btn-danger btn-xs" href="url ?>/delete?destination=admin/posts"> +
title ?>

diff --git a/system/admin/views/scheduled.html.php b/system/admin/views/scheduled.html.php index b321daa..1ee6a41 100644 --- a/system/admin/views/scheduled.html.php +++ b/system/admin/views/scheduled.html.php @@ -5,6 +5,7 @@

+ @@ -12,6 +13,8 @@ + + @@ -21,6 +24,7 @@ +
title ?>

diff --git a/system/admin/views/static-pages.html.php b/system/admin/views/static-pages.html.php index 64cc9a7..ed75b21 100644 --- a/system/admin/views/static-pages.html.php +++ b/system/admin/views/static-pages.html.php @@ -3,52 +3,68 @@


+ - - +
+ + - - - + + + - md); ?> - md);?> - - - - - - + slug); ?> + slug);?> + + + + - +
title;?> views;?>
title;?>description, '50');?>... - - md); - foreach ($subPages as $sp):?> - -
-
- title;?> -
-
- - views;?> -
-
- -
-
- - - -
+
+ +
+
+ title;?> +
+
+ +
+
+
+
+ \ No newline at end of file diff --git a/system/admin/views/static-subpages.html.php b/system/admin/views/static-subpages.html.php new file mode 100644 index 0000000..eb20bd9 --- /dev/null +++ b/system/admin/views/static-subpages.html.php @@ -0,0 +1,57 @@ + + +

title ?>

+
description;?>
+
+ +

+ +slug);?> + + + + + + + + + + + + + + + + + + + +
title ?>description;?>
+
+ + \ No newline at end of file diff --git a/system/admin/views/user-draft.html.php b/system/admin/views/user-draft.html.php index 70a18fd..291355d 100644 --- a/system/admin/views/user-draft.html.php +++ b/system/admin/views/user-draft.html.php @@ -5,6 +5,7 @@

+ @@ -12,6 +13,8 @@ + + @@ -21,6 +24,7 @@ +
title ?>

@@ -55,7 +59,7 @@ - md)); ?> + md)); ?> title ?> lastMod) ?> @@ -74,15 +78,15 @@ - + - parent);?> + parent);?> title ?> lastMod) ?> - title;?> + title;?> diff --git a/system/admin/views/user-posts.html.php b/system/admin/views/user-posts.html.php index 4e2b70c..853966d 100644 --- a/system/admin/views/user-posts.html.php +++ b/system/admin/views/user-posts.html.php @@ -5,6 +5,7 @@

+ @@ -15,6 +16,8 @@ + + @@ -27,6 +30,7 @@ +
title ?>

diff --git a/system/htmly.php b/system/htmly.php index c9bf520..fd3f2f8 100644 --- a/system/htmly.php +++ b/system/htmly.php @@ -1122,6 +1122,87 @@ get('/admin/pages', function () { die; }); +post('/admin/pages', function () { + + if (login()) { + $json = from($_REQUEST, 'json'); + reorder_pages($json); + echo json_encode(array( + 'message' => 'Page order saved successfully!', + )); + } +}); + +// Show admin/pages +get('/admin/pages/:static', function ($static) +{ + $user = $_SESSION[site_url()]['user']; + $role = user('role', $user); + if (login()) { + + config('views.root', 'system/admin/views'); + if ($role === 'admin') { + + $post = find_page($static); + + if (!$post) { + not_found(); + } + + if (array_key_exists('prev', $post)) { + $prev = $post['prev']; + } else { + $prev = array(); + } + + if (array_key_exists('next', $post)) { + $next = $post['next']; + } else { + $next = array(); + } + + $post = $post['current']; + + render('static-subpages', array( + 'title' => $post->title . ' - ' . blog_title(), + 'description' => $post->description, + 'canonical' => $post->url, + 'bodyclass' => 'in-page ' . strtolower($static), + 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . 'Pages » ' . $post->title, + 'p' => $post, + 'static' => $post, + 'type' => 'staticSubpage', + 'prev' => static_prev($prev), + 'next' => static_next($next), + 'is_page' => true + )); + } else { + render('denied', array( + 'title' => 'Pages - ' . blog_title(), + 'description' => strip_tags(blog_description()), + 'canonical' => site_url(), + 'type' => 'is_admin-pages', + 'is_admin' => true, + 'bodyclass' => 'denied', + 'breadcrumb' => '', + )); + } + } else { + $login = site_url() . 'login'; + } +}); + +post('/admin/pages/:static', function ($static) { + + if (login()) { + $json = from($_REQUEST, 'json'); + reorder_subpages($json); + echo json_encode(array( + 'message' => 'Page order saved successfully!', + )); + } +}); + // Show import page get('/admin/import', function () { if (login()) { @@ -2969,7 +3050,7 @@ get('/:static', function ($static) { if (!$post) { not_found(); } - + if (array_key_exists('prev', $post)) { $prev = $post['prev']; } else { @@ -3048,7 +3129,7 @@ get('/:static/add', function ($static) { 'type' => 'is_page', 'is_admin' => true, 'bodyclass' => 'add-page', - 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . $post->title . ' » ' . i18n('Add_new_page') + 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . $post->title . ' » ' . i18n('Add_new_page') )); } else { $login = site_url() . 'login'; @@ -3355,7 +3436,7 @@ get('/:static/:sub/edit', function ($static, $sub) { 'canonical' => site_url(), 'bodyclass' => 'edit-page', 'is_admin' => true, - 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . $post->title . ' » ' . $page->title, + 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . $post->title . ' » ' . $page->title, 'p' => $page, 'static' => $page, 'type' => 'subPage', @@ -3457,7 +3538,7 @@ get('/:static/:sub/delete', function ($static, $sub) { 'canonical' => site_url(), 'bodyclass' => 'delete-page', 'is_admin' => true, - 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . $post->title . ' » ' . $page->title, + 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . $post->title . ' » ' . $page->title, 'p' => $page, 'static' => $page, 'type' => 'subPage', diff --git a/system/includes/dispatch.php b/system/includes/dispatch.php index dd989f1..d8509b0 100644 --- a/system/includes/dispatch.php +++ b/system/includes/dispatch.php @@ -380,7 +380,7 @@ function render($view, $locals = null, $layout = null) if (($view_root = config('views.root')) == null) error(500, "[views.root] is not set"); - + $fnc = "{$view_root}/functions.php"; ob_start(); diff --git a/system/includes/functions.php b/system/includes/functions.php index c511f81..e890143 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -52,7 +52,7 @@ function get_static_subpages($static = null) $stringLen = strlen($static); return array_filter($_sub_page, function ($sub_page) use ($static, $stringLen) { $x = explode("/", $sub_page['dirname']); - if ($x[2] == $static) { + if (strpos($x[2], $static) !== false) { return true; } return false; @@ -126,7 +126,7 @@ function get_draft_subpages($static = null) $stringLen = strlen($static); return array_filter($_draftSubpage, function ($sub_page) use ($static, $stringLen) { $x = explode("/", $sub_page['dirname']); - if ($x[2] == $static) { + if (strpos($x[2], $static) !== false) { return true; } return false; @@ -544,14 +544,20 @@ function get_pages($pages, $page = 1, $perpage = 0) $post = new stdClass; // The static page URL - $url= $v['filename']; + $fn = explode('.', $v['filename']); + + if (isset($fn[1])) { + $url = $fn[1]; + } else { + $url= $v['filename']; + } $post->url = site_url() . $url; $post->file = $v['dirname'] . '/' . $v['basename']; $post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($post->file))); - $post->md = $url; + $post->md = $v['basename']; $post->slug = $url; $post->parent = null; @@ -597,18 +603,32 @@ function get_subpages($sub_pages, $page = 1, $perpage = 0) $post = new stdClass; - $static = str_replace(dirname($v['dirname']) . '/', '', $v['dirname']); + $fd = str_replace(dirname($v['dirname']) . '/', '', $v['dirname']); + + $st = explode('.', $fd); + if (isset($st[1])) { + $static = $st[1]; + } else { + $static = $fd; + } // The static page URL - $url= $v['filename']; + $fn = explode('.', $v['filename']); + + if (isset($fn[1])) { + $url = $fn[1]; + } else { + $url= $v['filename']; + } + $post->url = site_url() . $static . "/" . $url; $post->file = $v['dirname'] . '/' . $v['basename']; $post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($post->file))); - $post->md = $url; + $post->md = $v['basename']; $post->slug = $url; - $post->parent = $static; + $post->parent = $fd; // Get the contents and convert it to HTML $content = file_get_contents($post->file); @@ -877,7 +897,7 @@ function read_category_info($category) $desc->url = site_url() . 'category/' . $url; - $desc->md = $url; + $desc->md = $v['basename']; $desc->slug = $url; @@ -914,16 +934,16 @@ function default_category($category = null) $desc->url = site_url() . 'category/uncategorized'; $desc->slug = 'uncategorized'; $desc->body = '

' . i18n('Uncategorized_comment') . '

'; - $desc->md = 'uncategorized'; + $desc->md = 'uncategorized.md'; $desc->description = i18n('Uncategorized_comment'); $desc->file = ''; - $desc->count = get_categorycount($desc->md); + $desc->count = get_categorycount($desc->slug); } else { $desc->title = $category; $desc->url = site_url() . 'category/' . $category; $desc->slug = $category; $desc->body = '

' . i18n('All_blog_posts') . ': ' . $category . '

'; - $desc->md = $category; + $desc->md = $category . '.md'; $desc->description = i18n('All_blog_posts') . ': ' . $category; $desc->file = ''; $desc->count = get_categorycount($category); @@ -950,7 +970,7 @@ function category_list($custom = null) { } else { $arr = get_category_info(null); foreach ($arr as $i => $a) { - $cat[] = array($a->md, $a->title, $a->count, $a->description); + $cat[] = array($a->slug, $a->title, $a->count, $a->description); } $tmp = serialize($cat); @@ -2447,7 +2467,7 @@ function get_title_from_file($v) } // Auto generate menu from static page -function get_menu($custom) +function get_menu($custom = null, $auto = null) { $posts = get_static_pages(); $req = $_SERVER['REQUEST_URI']; @@ -2457,17 +2477,20 @@ function get_menu($custom) asort($posts); echo '