diff --git a/README.md b/README.md
index 853421b..104191c 100644
--- a/README.md
+++ b/README.md
@@ -140,17 +140,25 @@ Here's the explanation (separated by an underscore):
- `2014-01-31-12-56-40` is the published date. The date format is `yyyy-mm-dd-hh-mm-ss`
- `tag1,tag2,tag3` is the tag, separated by comma
- `databaseless-blogging-platform-flat-file-blog` is the URL
-
+
For static pages, we use the following format:
````
-about.md
+content/static/about.md
````
-That is means if `about` is the URL.
+That means the URL is `about`.
So if you write it offline then you must naming the .md file as above.
+For static sub pages, we use the following format:
+
+````
+content/static/about/me.md
+````
+
+That means the URL is `about/me`.
+
Content Title
-------------
If you write it offline, for the title of the post you need to add a title in the following format:
diff --git a/system/admin/admin.php b/system/admin/admin.php
index 6293791..47d469d 100644
--- a/system/admin/admin.php
+++ b/system/admin/admin.php
@@ -1,550 +1,563 @@
0 && $user_enc !== 'clear' && $user_enc !== 'none')?hash($user_enc,$pass):$pass;
-
- if(file_exists($user_file)) {
- if($pass === $user_pass) {
- $_SESSION[config("site.url")]['user'] = $user;
- header('location: admin');
- }
- else {
- return $str = '
';
- echo '| Title | Published | ';
- if(config("views.counter") == "true") echo 'Views | ';
- echo 'Tag | Operations |
';
- $i = 0; $len = count($posts);
- foreach($posts as $p) {
- if ($i == 0) {
- $class = 'item first';
- }
- elseif ($i == $len - 1) {
- $class = 'item last';
- }
- else {
- $class = 'item';
- }
- $i++;
- echo '';
- echo '| ' . $p->title . ' | ';
- echo '' . date('d F Y', $p->date) . ' | ';
- if(config("views.counter") == "true") echo '' . $p->views . ' | ';
- echo '' . $p->tag . ' | ';
- echo 'Edit Delete | ';
- echo '
';
- }
- echo '
';
- }
- }
+ if (isset($_SESSION[config("site.url")]['user'])) {
+ $posts = get_profile($_SESSION[config("site.url")]['user'], 1, 5);
+ if (!empty($posts)) {
+ echo '';
+ echo '| Title | Published | ';
+ if (config("views.counter") == "true")
+ echo 'Views | ';
+ echo 'Tag | Operations |
';
+ $i = 0;
+ $len = count($posts);
+ foreach ($posts as $p) {
+ if ($i == 0) {
+ $class = 'item first';
+ } elseif ($i == $len - 1) {
+ $class = 'item last';
+ } else {
+ $class = 'item';
+ }
+ $i++;
+ echo '';
+ echo '| ' . $p->title . ' | ';
+ echo '' . date('d F Y', $p->date) . ' | ';
+ if (config("views.counter") == "true")
+ echo '' . $p->views . ' | ';
+ echo '' . $p->tag . ' | ';
+ echo 'Edit Delete | ';
+ echo '
';
+ }
+ echo '
';
+ }
+ }
}
// Get all static pages
function get_recent_pages() {
- if (isset($_SESSION[config("site.url")]['user'])) {
- $posts = get_static_post(null);
- if(!empty($posts)) {
- krsort($posts);
- echo '