diff --git a/system/admin/admin.php b/system/admin/admin.php
index 5da0577..d74f5b6 100644
--- a/system/admin/admin.php
+++ b/system/admin/admin.php
@@ -33,7 +33,7 @@ function session($user, $pass) {
}
}
-function edit_post($title, $tag, $url, $content, $oldfile) {
+function edit_post($title, $tag, $url, $content, $oldfile, $destination = null) {
$oldurl = explode('_', $oldfile);
@@ -56,13 +56,36 @@ function edit_post($title, $tag, $url, $content, $oldfile) {
rename($oldfile, $newfile);
file_put_contents($newfile, print_r($post_content, true));
}
- $redirect = site_url() . 'admin/posts';
- header("Location: $redirect");
+
+ $replaced = substr($oldurl[0], 0,strrpos($oldurl[0], '/')) . '/';
+ $dt = str_replace($replaced,'',$oldurl[0]);
+ $time = new DateTime($dt);
+ $timestamp= $time->format("Y-m-d");
+ // The post date
+ $postdate = strtotime($timestamp);
+ // The post URL
+ $posturl = site_url().date('Y/m', $postdate).'/'.$url;
+
+ if($destination == 'admin/posts') {
+ $redirect = site_url() . 'admin/posts';
+ header("Location: $redirect");
+ }
+ elseif($destination == 'admin') {
+ $redirect = site_url() . 'admin';
+ header("Location: $redirect");
+ }
+ elseif ($destination == 'post') {
+ header("Location: $posturl");
+ }
+ else {
+ $redirect = site_url();
+ header("Location: $redirect");
+ }
}
}
-function edit_page($title, $url, $content, $oldfile) {
+function edit_page($title, $url, $content, $oldfile, $destination = null) {
$dir = substr($oldfile, 0, strrpos($oldfile, '/'));
@@ -83,8 +106,21 @@ function edit_page($title, $url, $content, $oldfile) {
rename($oldfile, $newfile);
file_put_contents($newfile, print_r($post_content, true));
}
- $redirect = site_url() . 'admin';
- header("Location: $redirect");
+
+ $posturl = site_url() . $url;
+
+ if($destination == 'admin') {
+ $redirect = site_url() . 'admin';
+ header("Location: $redirect");
+ }
+ elseif ($destination == 'post') {
+ header("Location: $posturl");
+ }
+ else {
+ $redirect = site_url();
+ header("Location: $redirect");
+ }
+
}
}
@@ -200,7 +236,7 @@ function get_recent_posts() {
echo '
diff --git a/system/admin/views/posts-list.html.php b/system/admin/views/posts-list.html.php
index e52cc37..a94f5a5 100644
--- a/system/admin/views/posts-list.html.php
+++ b/system/admin/views/posts-list.html.php
@@ -20,7 +20,7 @@
title ?> |
date) ?> |
tag ?> |
-
Edit Delete |
+
Edit Delete |
diff --git a/system/htmly.php b/system/htmly.php
index f36c382..4746249 100644
--- a/system/htmly.php
+++ b/system/htmly.php
@@ -124,7 +124,7 @@ get('/:year/:month/:name/edit', function($year, $month, $name){
'p' => $current,
'canonical' => $current->url,
'description' => $description = get_description($current->body),
- 'bodyclass' => 'inedit',
+ 'bodyclass' => 'editpost',
'breadcrumb' => '
' .config('breadcrumb.home'). ' » '. $current->tagb . ' » ' . $current->title
));
}
@@ -142,8 +142,9 @@ post('/:year/:month/:name/edit', function() {
$url = from($_REQUEST, 'url');
$content = from($_REQUEST, 'content');
$oldfile = from($_REQUEST, 'oldfile');
+ $destination = from($_GET, 'destination');
- edit_post($title, $tag, $url, $content, $oldfile);
+ edit_post($title, $tag, $url, $content, $oldfile, $destination);
});
@@ -166,7 +167,7 @@ get('/:year/:month/:name/delete', function($year, $month, $name){
'p' => $current,
'canonical' => $current->url,
'description' => $description = get_description($current->body),
- 'bodyclass' => 'inedit',
+ 'bodyclass' => 'deletepost',
'breadcrumb' => '
' .config('breadcrumb.home'). ' » '. $current->tagb . ' » ' . $current->title
));
}
@@ -244,7 +245,7 @@ get('/edit/profile', function(){
'title' => 'Edit profile - ' . config('blog.title'),
'canonical' => config('site.url') . '/profile',
'description' => 'Edit profile.',
- 'bodyclass' => 'inpage',
+ 'bodyclass' => 'editprofile',
'breadcrumb' => '
' .config('breadcrumb.home'). ' » Edit profile',
));
}
@@ -299,7 +300,7 @@ get('/admin/posts', function(){
'name' => $bio->title,
'canonical' => config('site.url') . '/author/' . $profile,
'description' => 'Profile page and all posts by ' . $bio->title . ' on ' . config('blog.title') . '.',
- 'bodyclass' => 'inprofile',
+ 'bodyclass' => 'userposts',
'breadcrumb' => '
' .config('breadcrumb.home'). ' » Profile for: ' . $bio->title,
'pagination' => has_pagination($total, $perpage, $page)
));
@@ -314,7 +315,7 @@ get('/admin/posts', function(){
'name' => $bio->title,
'canonical' => config('site.url') . '/author/' . $profile,
'description' => 'Profile page and all posts by ' . $bio->title . ' on ' . config('blog.title') . '.',
- 'bodyclass' => 'inprofile',
+ 'bodyclass' => 'userposts',
'breadcrumb' => '
' .config('breadcrumb.home'). ' » Profile for: ' . $bio->title,
'pagination' => has_pagination($total, $perpage, $page)
));
@@ -364,7 +365,7 @@ get('/:static', function($static){
'title' => 'Admin - ' . config('blog.title'),
'canonical' => config('site.url') . '/admin',
'description' => 'Admin page from ' . config('blog.title') . '.',
- 'bodyclass' => 'inadmin',
+ 'bodyclass' => 'adminfront',
'breadcrumb' => '
' .config('breadcrumb.home'). ' » Admin'
));
}
@@ -441,7 +442,7 @@ get('/:static/edit', function($static){
'title' => $post->title .' - ' . config('blog.title'),
'canonical' => $post->url,
'description' => $description = get_description($post->body),
- 'bodyclass' => 'inpage',
+ 'bodyclass' => 'editpage',
'breadcrumb' => '
' .config('breadcrumb.home'). ' » ' . $post->title,
'p' => $post,
'type' => 'staticpage',
@@ -460,8 +461,9 @@ post('/:static/edit', function() {
$url = from($_REQUEST, 'url');
$content = from($_REQUEST, 'content');
$oldfile = from($_REQUEST, 'oldfile');
+ $destination = from($_GET, 'destination');
- edit_page($title, $url, $content, $oldfile);
+ edit_page($title, $url, $content, $oldfile, $destination);
});
@@ -483,7 +485,7 @@ get('/:static/delete', function($static){
'title' => $post->title .' - ' . config('blog.title'),
'canonical' => $post->url,
'description' => $description = get_description($post->body),
- 'bodyclass' => 'inpage',
+ 'bodyclass' => 'deletepage',
'breadcrumb' => '
' .config('breadcrumb.home'). ' » ' . $post->title,
'p' => $post,
'type' => 'staticpage',
diff --git a/system/includes/.htaccess b/system/includes/.htaccess
new file mode 100644
index 0000000..3418e55
--- /dev/null
+++ b/system/includes/.htaccess
@@ -0,0 +1 @@
+deny from all
\ No newline at end of file
diff --git a/themes/clean/css/style.css b/themes/clean/css/style.css
index 990d5b6..e9c483f 100644
--- a/themes/clean/css/style.css
+++ b/themes/clean/css/style.css
@@ -163,6 +163,27 @@ h6{
padding: 0 10px;
}
+.tab {
+ width:100%;
+ margin: 0.5em 0 0.5em 0;
+ line-height:1;
+ border-bottom: 1px solid #E4E7EE;
+}
+
+.tab a {
+ background: #E4E7EE;
+ border-radius: 6px 6px 0px 0;
+ color: #555555;
+ text-align: center;
+ padding: 8px 14px;
+ display:inline-block;
+ margin: 0 5px;
+ font-size: 12px;
+ font-weight: bold;
+ font-family: 'Open Sans',sans-serif;
+}
+
+
/*----------------------------
Content & Posts
-----------------------------*/
diff --git a/themes/clean/post.html.php b/themes/clean/post.html.php
index cee8637..05c79c9 100644
--- a/themes/clean/post.html.php
+++ b/themes/clean/post.html.php
@@ -1,4 +1,5 @@
+ if(login()): ?>
diff --git a/themes/default/css/style.css b/themes/default/css/style.css
index 76ba26e..39ae226 100644
--- a/themes/default/css/style.css
+++ b/themes/default/css/style.css
@@ -136,11 +136,20 @@ h6 {
padding: 3em 0;
}
+.admin #content-wrapper {
+ background-color: #FAFAFA;
+}
+
#menu, #header, #content, #footer {
width: 700px;
margin: 0 auto;
}
+.admin #menu, .admin #header, .admin #content, .admin #footer {
+ width: 980px;
+ margin: 0 auto;
+}
+
#header {
text-align:center;
}
@@ -163,6 +172,26 @@ a:hover{
text-decoration:underline;
}
+.tab {
+ width:100%;
+ margin: 1.5em 0 0 0;
+ line-height:1;
+ border-bottom: 1px solid #E4E7EE;
+}
+
+.tab a {
+ background: #E4E7EE;
+ border-radius: 6px 6px 0px 0;
+ color: #555555;
+ text-align: center;
+ padding: 8px 14px;
+ display:inline-block;
+ margin: 0 5px;
+ font-size: 12px;
+ font-weight: bold;
+ font-family: 'Open Sans',sans-serif;
+}
+
/*-------------------------
Text element
--------------------------*/
@@ -758,6 +787,11 @@ h1.title-post a:hover, h2.title-index a:hover {
width: 100%;
}
+ .admin #menu, .admin #header, .admin #content, .admin #footer {
+ margin: 0 auto;
+ width: 100%;
+ }
+
#menu-wrapper {
text-align:center;
}
diff --git a/themes/default/post.html.php b/themes/default/post.html.php
index cee8637..05c79c9 100644
--- a/themes/default/post.html.php
+++ b/themes/default/post.html.php
@@ -1,4 +1,5 @@
+ if(login()): ?>