From dcbf9f0700ab22cc534531c39572169414874015 Mon Sep 17 00:00:00 2001 From: Danang Probo Sayekti Date: Tue, 21 Jul 2015 19:05:08 +0700 Subject: [PATCH] Cleaning up --- system/admin/admin.php | 324 +++++++++++++++---------------- system/admin/views/add-audio.html.php | 14 +- system/admin/views/add-image.html.php | 14 +- system/admin/views/add-link.html.php | 14 +- system/admin/views/add-page.html.php | 14 +- system/admin/views/add-post.html.php | 14 +- system/admin/views/add-quote.html.php | 14 +- system/admin/views/add-video.html.php | 14 +- system/admin/views/edit-audio.html.php | 18 +- system/admin/views/edit-image.html.php | 18 +- system/admin/views/edit-link.html.php | 18 +- system/admin/views/edit-page.html.php | 26 +-- system/admin/views/edit-post.html.php | 16 +- system/admin/views/edit-profile.html.php | 14 +- system/admin/views/edit-quote.html.php | 18 +- system/admin/views/edit-video.html.php | 18 +- system/admin/views/update.html.php | 2 +- system/htmly.php | 154 +++++++-------- system/includes/functions.php | 70 +++---- themes/clean/main.html.php | 12 +- themes/clean/post.html.php | 50 ++--- themes/default/main.html.php | 12 +- themes/default/post.html.php | 50 ++--- themes/logs/layout.html.php | 2 +- themes/logs/main.html.php | 2 +- themes/logs/post.html.php | 54 +++--- 26 files changed, 488 insertions(+), 488 deletions(-) diff --git a/system/admin/admin.php b/system/admin/admin.php index e0c8c6c..52682b5 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -89,9 +89,9 @@ function remove_accent($str) function edit_post($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $revertPost, $publishDraft) { $oldurl = explode('_', $oldfile); - $dir = explode('/', $oldurl[0]); + $dir = explode('/', $oldurl[0]); $olddate = date('Y-m-d-h-i-s', strtotime($date)); - + if ($date !== null) { $oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate; } @@ -104,52 +104,52 @@ function edit_post($title, $tag, $url, $content, $oldfile, $destination = null, $post_description = "\n"; } else { $post_description = ""; - } + } $post_content = '' . $post_description ."\n\n" . $content; if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - + if (get_magic_quotes_gpc()) { $post_content = stripslashes($post_content); } - + if(!empty($revertPost) || !empty($publishDraft)) { - + $dirBlog = $dir[0] . '/' . $dir[1] . '/blog/'; $dirDraft = $dir[0] . '/' . $dir[1] . '/draft/'; - + if($dir[2] == 'draft') { $filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; } else { $filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; - } - + } + if (is_dir($dirBlog)) { } else { mkdir($dirBlog, 0775, true); } - - if (is_dir($dirDraft)) { + + if (is_dir($dirDraft)) { } else { mkdir($dirDraft, 0775, true); } - + file_put_contents($filename, print_r($post_content, true)); unlink($oldfile); $newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md'; - - } else { - + + } else { + $newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; - + if ($oldfile === $newfile) { file_put_contents($oldfile, print_r($post_content, true)); } else { rename($oldfile, $newfile); file_put_contents($newfile, print_r($post_content, true)); } - - } + + } if(!empty($publishDraft)) { $dt = $olddate; @@ -162,14 +162,14 @@ function edit_post($title, $tag, $url, $content, $oldfile, $destination = null, $t = str_replace('-', '', $dt); $time = new DateTime($t); $timestamp = $time->format("Y-m-d"); - } - + } + // The post date $postdate = strtotime($timestamp); // The post URL $posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url; - + rebuilt_cache('all'); clear_post_cache($dt, $post_tag, $post_url, $newfile); if ($destination == 'post') { @@ -197,9 +197,9 @@ function edit_post($title, $tag, $url, $content, $oldfile, $destination = null, function edit_image($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $image, $revertPost, $publishDraft) { $oldurl = explode('_', $oldfile); - $dir = explode('/', $oldurl[0]); + $dir = explode('/', $oldurl[0]); $olddate = date('Y-m-d-h-i-s', strtotime($date)); - + if ($date !== null) { $oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate; } @@ -218,52 +218,52 @@ function edit_image($title, $tag, $url, $content, $oldfile, $destination = null, $post_image = "\n"; } else { $post_image = ""; - } + } $post_content = '' . $post_description . $post_image ."\n\n" . $content; if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - + if (get_magic_quotes_gpc()) { $post_content = stripslashes($post_content); } - + if(!empty($revertPost) || !empty($publishDraft)) { - + $dirBlog = $dir[0] . '/' . $dir[1] . '/blog/'; $dirDraft = $dir[0] . '/' . $dir[1] . '/draft/'; - + if($dir[2] == 'draft') { $filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; } else { $filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; - } - + } + if (is_dir($dirBlog)) { } else { mkdir($dirBlog, 0775, true); } - - if (is_dir($dirDraft)) { + + if (is_dir($dirDraft)) { } else { mkdir($dirDraft, 0775, true); } - + file_put_contents($filename, print_r($post_content, true)); unlink($oldfile); $newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md'; - - } else { - + + } else { + $newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; - + if ($oldfile === $newfile) { file_put_contents($oldfile, print_r($post_content, true)); } else { rename($oldfile, $newfile); file_put_contents($newfile, print_r($post_content, true)); } - - } + + } if(!empty($publishDraft)) { $dt = $olddate; @@ -276,14 +276,14 @@ function edit_image($title, $tag, $url, $content, $oldfile, $destination = null, $t = str_replace('-', '', $dt); $time = new DateTime($t); $timestamp = $time->format("Y-m-d"); - } - + } + // The post date $postdate = strtotime($timestamp); // The post URL $posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url; - + rebuilt_cache('all'); clear_post_cache($dt, $post_tag, $post_url, $newfile); if ($destination == 'post') { @@ -311,9 +311,9 @@ function edit_image($title, $tag, $url, $content, $oldfile, $destination = null, function edit_video($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $video, $revertPost, $publishDraft) { $oldurl = explode('_', $oldfile); - $dir = explode('/', $oldurl[0]); + $dir = explode('/', $oldurl[0]); $olddate = date('Y-m-d-h-i-s', strtotime($date)); - + if ($date !== null) { $oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate; } @@ -332,52 +332,52 @@ function edit_video($title, $tag, $url, $content, $oldfile, $destination = null, $post_video = "\n"; } else { $post_video = ""; - } + } $post_content = '' . $post_description . $post_video ."\n\n" . $content; if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - + if (get_magic_quotes_gpc()) { $post_content = stripslashes($post_content); } - + if(!empty($revertPost) || !empty($publishDraft)) { - + $dirBlog = $dir[0] . '/' . $dir[1] . '/blog/'; $dirDraft = $dir[0] . '/' . $dir[1] . '/draft/'; - + if($dir[2] == 'draft') { $filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; } else { $filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; - } - + } + if (is_dir($dirBlog)) { } else { mkdir($dirBlog, 0775, true); } - - if (is_dir($dirDraft)) { + + if (is_dir($dirDraft)) { } else { mkdir($dirDraft, 0775, true); } - + file_put_contents($filename, print_r($post_content, true)); unlink($oldfile); $newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md'; - - } else { - + + } else { + $newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; - + if ($oldfile === $newfile) { file_put_contents($oldfile, print_r($post_content, true)); } else { rename($oldfile, $newfile); file_put_contents($newfile, print_r($post_content, true)); } - - } + + } if(!empty($publishDraft)) { $dt = $olddate; @@ -390,14 +390,14 @@ function edit_video($title, $tag, $url, $content, $oldfile, $destination = null, $t = str_replace('-', '', $dt); $time = new DateTime($t); $timestamp = $time->format("Y-m-d"); - } - + } + // The post date $postdate = strtotime($timestamp); // The post URL $posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url; - + rebuilt_cache('all'); clear_post_cache($dt, $post_tag, $post_url, $newfile); if ($destination == 'post') { @@ -425,9 +425,9 @@ function edit_video($title, $tag, $url, $content, $oldfile, $destination = null, function edit_link($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $link, $revertPost, $publishDraft) { $oldurl = explode('_', $oldfile); - $dir = explode('/', $oldurl[0]); + $dir = explode('/', $oldurl[0]); $olddate = date('Y-m-d-h-i-s', strtotime($date)); - + if ($date !== null) { $oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate; } @@ -446,52 +446,52 @@ function edit_link($title, $tag, $url, $content, $oldfile, $destination = null, $post_link = "\n"; } else { $post_link = ""; - } + } $post_content = '' . $post_description . $post_link ."\n\n" . $content; if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - + if (get_magic_quotes_gpc()) { $post_content = stripslashes($post_content); } - + if(!empty($revertPost) || !empty($publishDraft)) { - + $dirBlog = $dir[0] . '/' . $dir[1] . '/blog/'; $dirDraft = $dir[0] . '/' . $dir[1] . '/draft/'; - + if($dir[2] == 'draft') { $filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; } else { $filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; - } - + } + if (is_dir($dirBlog)) { } else { mkdir($dirBlog, 0775, true); } - - if (is_dir($dirDraft)) { + + if (is_dir($dirDraft)) { } else { mkdir($dirDraft, 0775, true); } - + file_put_contents($filename, print_r($post_content, true)); unlink($oldfile); $newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md'; - - } else { - + + } else { + $newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; - + if ($oldfile === $newfile) { file_put_contents($oldfile, print_r($post_content, true)); } else { rename($oldfile, $newfile); file_put_contents($newfile, print_r($post_content, true)); } - - } + + } if(!empty($publishDraft)) { $dt = $olddate; @@ -504,14 +504,14 @@ function edit_link($title, $tag, $url, $content, $oldfile, $destination = null, $t = str_replace('-', '', $dt); $time = new DateTime($t); $timestamp = $time->format("Y-m-d"); - } - + } + // The post date $postdate = strtotime($timestamp); // The post URL $posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url; - + rebuilt_cache('all'); clear_post_cache($dt, $post_tag, $post_url, $newfile); if ($destination == 'post') { @@ -539,9 +539,9 @@ function edit_link($title, $tag, $url, $content, $oldfile, $destination = null, function edit_quote($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $quote, $revertPost, $publishDraft) { $oldurl = explode('_', $oldfile); - $dir = explode('/', $oldurl[0]); + $dir = explode('/', $oldurl[0]); $olddate = date('Y-m-d-h-i-s', strtotime($date)); - + if ($date !== null) { $oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate; } @@ -560,52 +560,52 @@ function edit_quote($title, $tag, $url, $content, $oldfile, $destination = null, $post_quote = "\n"; } else { $post_quote = ""; - } + } $post_content = '' . $post_description . $post_quote ."\n\n" . $content; if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - + if (get_magic_quotes_gpc()) { $post_content = stripslashes($post_content); } - + if(!empty($revertPost) || !empty($publishDraft)) { - + $dirBlog = $dir[0] . '/' . $dir[1] . '/blog/'; $dirDraft = $dir[0] . '/' . $dir[1] . '/draft/'; - + if($dir[2] == 'draft') { $filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; } else { $filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; - } - + } + if (is_dir($dirBlog)) { } else { mkdir($dirBlog, 0775, true); } - - if (is_dir($dirDraft)) { + + if (is_dir($dirDraft)) { } else { mkdir($dirDraft, 0775, true); } - + file_put_contents($filename, print_r($post_content, true)); unlink($oldfile); $newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md'; - - } else { - + + } else { + $newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; - + if ($oldfile === $newfile) { file_put_contents($oldfile, print_r($post_content, true)); } else { rename($oldfile, $newfile); file_put_contents($newfile, print_r($post_content, true)); } - - } + + } if(!empty($publishDraft)) { $dt = $olddate; @@ -618,14 +618,14 @@ function edit_quote($title, $tag, $url, $content, $oldfile, $destination = null, $t = str_replace('-', '', $dt); $time = new DateTime($t); $timestamp = $time->format("Y-m-d"); - } - + } + // The post date $postdate = strtotime($timestamp); // The post URL $posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url; - + rebuilt_cache('all'); clear_post_cache($dt, $post_tag, $post_url, $newfile); if ($destination == 'post') { @@ -653,9 +653,9 @@ function edit_quote($title, $tag, $url, $content, $oldfile, $destination = null, function edit_audio($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $audio, $revertPost, $publishDraft) { $oldurl = explode('_', $oldfile); - $dir = explode('/', $oldurl[0]); + $dir = explode('/', $oldurl[0]); $olddate = date('Y-m-d-h-i-s', strtotime($date)); - + if ($date !== null) { $oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate; } @@ -674,52 +674,52 @@ function edit_audio($title, $tag, $url, $content, $oldfile, $destination = null, $post_audio = "\n"; } else { $post_audio = ""; - } + } $post_content = '' . $post_description . $post_audio ."\n\n" . $content; if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - + if (get_magic_quotes_gpc()) { $post_content = stripslashes($post_content); } - + if(!empty($revertPost) || !empty($publishDraft)) { - + $dirBlog = $dir[0] . '/' . $dir[1] . '/blog/'; $dirDraft = $dir[0] . '/' . $dir[1] . '/draft/'; - + if($dir[2] == 'draft') { $filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; } else { $filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; - } - + } + if (is_dir($dirBlog)) { } else { mkdir($dirBlog, 0775, true); } - - if (is_dir($dirDraft)) { + + if (is_dir($dirDraft)) { } else { mkdir($dirDraft, 0775, true); } - + file_put_contents($filename, print_r($post_content, true)); unlink($oldfile); $newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md'; - - } else { - + + } else { + $newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; - + if ($oldfile === $newfile) { file_put_contents($oldfile, print_r($post_content, true)); } else { rename($oldfile, $newfile); file_put_contents($newfile, print_r($post_content, true)); } - - } + + } if(!empty($publishDraft)) { $dt = $olddate; @@ -732,14 +732,14 @@ function edit_audio($title, $tag, $url, $content, $oldfile, $destination = null, $t = str_replace('-', '', $dt); $time = new DateTime($t); $timestamp = $time->format("Y-m-d"); - } - + } + // The post date $postdate = strtotime($timestamp); // The post URL $posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url; - + rebuilt_cache('all'); clear_post_cache($dt, $post_tag, $post_url, $newfile); if ($destination == 'post') { @@ -815,15 +815,15 @@ function add_post($title, $tag, $url, $content, $user, $description = null, $dra $post_description = "\n"; } else { $post_description = ""; - } + } $post_content = '' . $post_description ."\n\n" . $content; if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { + if (get_magic_quotes_gpc()) { $post_content = stripslashes($post_content); } - + $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; if (empty($draft)) { @@ -831,7 +831,7 @@ function add_post($title, $tag, $url, $content, $user, $description = null, $dra } else { $dir = 'content/' . $user . '/draft/'; } - + if (is_dir($dir)) { file_put_contents($dir . $filename, print_r($post_content, true)); } else { @@ -841,13 +841,13 @@ function add_post($title, $tag, $url, $content, $user, $description = null, $dra rebuilt_cache('all'); clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename); - + if (empty($draft)) { $redirect = site_url() . 'admin/mine'; } else { $redirect = site_url() . 'admin/draft'; } - + header("Location: $redirect"); } } @@ -871,15 +871,15 @@ function add_image($title, $tag, $url, $content, $user, $description = null, $im $post_image = "\n"; } else { $post_image = ""; - } + } $post_content = '' . $post_description . $post_image ."\n\n" . $content; if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { + if (get_magic_quotes_gpc()) { $post_content = stripslashes($post_content); } - + $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; if (empty($draft)) { @@ -887,7 +887,7 @@ function add_image($title, $tag, $url, $content, $user, $description = null, $im } else { $dir = 'content/' . $user . '/draft/'; } - + if (is_dir($dir)) { file_put_contents($dir . $filename, print_r($post_content, true)); } else { @@ -897,13 +897,13 @@ function add_image($title, $tag, $url, $content, $user, $description = null, $im rebuilt_cache('all'); clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename); - + if (empty($draft)) { $redirect = site_url() . 'admin/mine'; } else { $redirect = site_url() . 'admin/draft'; } - + header("Location: $redirect"); } } @@ -927,15 +927,15 @@ function add_video($title, $tag, $url, $content, $user, $description = null, $vi $post_video = "\n"; } else { $post_video = ""; - } + } $post_content = '' . $post_description . $post_video ."\n\n" . $content; if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { + if (get_magic_quotes_gpc()) { $post_content = stripslashes($post_content); } - + $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; if (empty($draft)) { @@ -943,7 +943,7 @@ function add_video($title, $tag, $url, $content, $user, $description = null, $vi } else { $dir = 'content/' . $user . '/draft/'; } - + if (is_dir($dir)) { file_put_contents($dir . $filename, print_r($post_content, true)); } else { @@ -953,13 +953,13 @@ function add_video($title, $tag, $url, $content, $user, $description = null, $vi rebuilt_cache('all'); clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename); - + if (empty($draft)) { $redirect = site_url() . 'admin/mine'; } else { $redirect = site_url() . 'admin/draft'; } - + header("Location: $redirect"); } } @@ -983,15 +983,15 @@ function add_audio($title, $tag, $url, $content, $user, $description = null, $au $post_audio = "\n"; } else { $post_audio = ""; - } + } $post_content = '' . $post_description . $post_audio ."\n\n" . $content; if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { + if (get_magic_quotes_gpc()) { $post_content = stripslashes($post_content); } - + $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; if (empty($draft)) { @@ -999,7 +999,7 @@ function add_audio($title, $tag, $url, $content, $user, $description = null, $au } else { $dir = 'content/' . $user . '/draft/'; } - + if (is_dir($dir)) { file_put_contents($dir . $filename, print_r($post_content, true)); } else { @@ -1009,13 +1009,13 @@ function add_audio($title, $tag, $url, $content, $user, $description = null, $au rebuilt_cache('all'); clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename); - + if (empty($draft)) { $redirect = site_url() . 'admin/mine'; } else { $redirect = site_url() . 'admin/draft'; } - + header("Location: $redirect"); } } @@ -1039,15 +1039,15 @@ function add_link($title, $tag, $url, $content, $user, $description = null, $lin $post_link = "\n"; } else { $post_link = ""; - } + } $post_content = '' . $post_description . $post_link ."\n\n" . $content; if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { + if (get_magic_quotes_gpc()) { $post_content = stripslashes($post_content); } - + $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; if (empty($draft)) { @@ -1055,7 +1055,7 @@ function add_link($title, $tag, $url, $content, $user, $description = null, $lin } else { $dir = 'content/' . $user . '/draft/'; } - + if (is_dir($dir)) { file_put_contents($dir . $filename, print_r($post_content, true)); } else { @@ -1065,13 +1065,13 @@ function add_link($title, $tag, $url, $content, $user, $description = null, $lin rebuilt_cache('all'); clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename); - + if (empty($draft)) { $redirect = site_url() . 'admin/mine'; } else { $redirect = site_url() . 'admin/draft'; } - + header("Location: $redirect"); } } @@ -1095,15 +1095,15 @@ function add_quote($title, $tag, $url, $content, $user, $description = null, $qu $post_quote = "\n"; } else { $post_quote = ""; - } + } $post_content = '' . $post_description . $post_quote ."\n\n" . $content; if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { + if (get_magic_quotes_gpc()) { $post_content = stripslashes($post_content); } - + $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; if (empty($draft)) { @@ -1111,7 +1111,7 @@ function add_quote($title, $tag, $url, $content, $user, $description = null, $qu } else { $dir = 'content/' . $user . '/draft/'; } - + if (is_dir($dir)) { file_put_contents($dir . $filename, print_r($post_content, true)); } else { @@ -1121,13 +1121,13 @@ function add_quote($title, $tag, $url, $content, $user, $description = null, $qu rebuilt_cache('all'); clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename); - + if (empty($draft)) { $redirect = site_url() . 'admin/mine'; } else { $redirect = site_url() . 'admin/draft'; } - + header("Location: $redirect"); } } diff --git a/system/admin/views/add-audio.html.php b/system/admin/views/add-audio.html.php index e2f944e..ea4d13f 100644 --- a/system/admin/views/add-audio.html.php +++ b/system/admin/views/add-audio.html.php @@ -71,19 +71,19 @@ (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -113,18 +113,18 @@ $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/add-image.html.php b/system/admin/views/add-image.html.php index ea64f78..9dcd72c 100644 --- a/system/admin/views/add-image.html.php +++ b/system/admin/views/add-image.html.php @@ -71,19 +71,19 @@ (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -113,18 +113,18 @@ $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/add-link.html.php b/system/admin/views/add-link.html.php index 4f278bf..aacd647 100644 --- a/system/admin/views/add-link.html.php +++ b/system/admin/views/add-link.html.php @@ -71,19 +71,19 @@ (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -113,18 +113,18 @@ $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/add-page.html.php b/system/admin/views/add-page.html.php index 2e4f14e..6b95455 100644 --- a/system/admin/views/add-page.html.php +++ b/system/admin/views/add-page.html.php @@ -58,19 +58,19 @@ (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -100,18 +100,18 @@ $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/add-post.html.php b/system/admin/views/add-post.html.php index 801bc22..1eb2eea 100644 --- a/system/admin/views/add-post.html.php +++ b/system/admin/views/add-post.html.php @@ -64,19 +64,19 @@ (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -106,18 +106,18 @@ $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/add-quote.html.php b/system/admin/views/add-quote.html.php index 4fb3ff9..8471f31 100644 --- a/system/admin/views/add-quote.html.php +++ b/system/admin/views/add-quote.html.php @@ -71,19 +71,19 @@ (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -113,18 +113,18 @@ $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/add-video.html.php b/system/admin/views/add-video.html.php index 7ad36ff..bafcc9e 100644 --- a/system/admin/views/add-video.html.php +++ b/system/admin/views/add-video.html.php @@ -71,19 +71,19 @@ (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -113,18 +113,18 @@ $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/edit-audio.html.php b/system/admin/views/edit-audio.html.php index 9d8eebf..7c69cd7 100644 --- a/system/admin/views/edit-audio.html.php +++ b/system/admin/views/edit-audio.html.php @@ -65,7 +65,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat Url (optional)

If the url leave empty we will use the post title.

Year, Month, Day

- Hour, Minute, Second


Meta Description (optional)

- + @@ -109,19 +109,19 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -151,18 +151,18 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/edit-image.html.php b/system/admin/views/edit-image.html.php index 104b6e1..fcd09b7 100644 --- a/system/admin/views/edit-image.html.php +++ b/system/admin/views/edit-image.html.php @@ -65,7 +65,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat Url (optional)

If the url leave empty we will use the post title.

Year, Month, Day

- Hour, Minute, Second


Meta Description (optional)

- + @@ -109,19 +109,19 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -151,18 +151,18 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/edit-link.html.php b/system/admin/views/edit-link.html.php index e590b5f..e0fd117 100644 --- a/system/admin/views/edit-link.html.php +++ b/system/admin/views/edit-link.html.php @@ -65,7 +65,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat Url (optional)

If the url leave empty we will use the post title.

Year, Month, Day

- Hour, Minute, Second


Meta Description (optional)

- + @@ -109,19 +109,19 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -151,18 +151,18 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/edit-page.html.php b/system/admin/views/edit-page.html.php index 42f56e0..65b5ac5 100644 --- a/system/admin/views/edit-page.html.php +++ b/system/admin/views/edit-page.html.php @@ -23,12 +23,12 @@ if (isset($p->url)) { $delete = $p->url . '/delete?destination=' . $destination; } else { - if(empty($sub)) { - $delete = site_url() . $oldmd . '/delete?destination=' . $destination; - } - else { - $delete = site_url() . $static .'/'. $sub . '/delete?destination=' . $destination; - } + if(empty($sub)) { + $delete = site_url() . $oldmd . '/delete?destination=' . $destination; + } + else { + $delete = site_url() . $static .'/'. $sub . '/delete?destination=' . $destination; + } } ?> @@ -87,19 +87,19 @@ else { (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -129,18 +129,18 @@ else { $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/edit-post.html.php b/system/admin/views/edit-post.html.php index 6046cc8..c464446 100644 --- a/system/admin/views/edit-post.html.php +++ b/system/admin/views/edit-post.html.php @@ -64,7 +64,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat Url (optional)

If the url leave empty we will use the post title.

Year, Month, Day

- Hour, Minute, Second


Meta Description (optional)

- + @@ -109,19 +109,19 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -151,18 +151,18 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/edit-video.html.php b/system/admin/views/edit-video.html.php index 10ce0c1..437981f 100644 --- a/system/admin/views/edit-video.html.php +++ b/system/admin/views/edit-video.html.php @@ -65,7 +65,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat Url (optional)

If the url leave empty we will use the post title.

Year, Month, Day

- Hour, Minute, Second


Meta Description (optional)

- + @@ -109,19 +109,19 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat (function () { var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); - + var $dialog = $('#insertImageDialog').dialog({ autoOpen: false, closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); - + var $url = $('input[type=text]', $dialog); var $file = $('input[type=file]', $dialog); var base = ''; - + editor.hooks.set('insertImageDialog', function(callback) { - + var dialogInsertClick = function() { callback($url.val().length > 0 ? $url.val(): null); dialogClose(); @@ -151,18 +151,18 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat $file.val(''); } }; - + $file.ajaxfileupload({ 'action': 'upload.php', 'onComplete': uploadComplete, }); - + $dialog.dialog('open'); return true; // tell the editor that we'll take care of getting the image url }); editor.run(); - + })(); \ No newline at end of file diff --git a/system/admin/views/update.html.php b/system/admin/views/update.html.php index ab9d0ee..194f750 100644 --- a/system/admin/views/update.html.php +++ b/system/admin/views/update.html.php @@ -15,5 +15,5 @@ if ($updater->able()) { echo '

Update to ' . $info['tag_name'] . '

'; } else { echo '

No Available Update

'; - echo '

You are using the latest HTMLy version.

'; + echo '

You are using the latest HTMLy version.

'; } \ No newline at end of file diff --git a/system/htmly.php b/system/htmly.php index 5ab8d01..6fa1f79 100644 --- a/system/htmly.php +++ b/system/htmly.php @@ -1693,8 +1693,8 @@ post('/:static/:sub/edit', function ($static, $sub) { 'postTitle' => $title, 'postUrl' => $url, 'postContent' => $content, - 'static' => $static, - 'sub' => $sub, + 'static' => $static, + 'sub' => $sub, 'bodyclass' => 'editpage', 'breadcrumb' => '' . config('breadcrumb.home') . ' » Edit page' )); @@ -1793,20 +1793,20 @@ get('/:year/:month/:name', function ($year, $month, $name) { } else { $next = array(); } - - if (isset($current->image)) { - $var = 'imagePost'; - } elseif (isset($current->link)) { - $var = 'linkPost'; - } elseif (isset($current->quote)) { - $var = 'quotePost'; - } elseif (isset($current->audio)) { - $var = 'audioPost'; - } elseif (isset($current->video)) { - $var = 'videoPost'; } - else { - $var = 'blogPost'; - } + + if (isset($current->image)) { + $var = 'imagePost'; + } elseif (isset($current->link)) { + $var = 'linkPost'; + } elseif (isset($current->quote)) { + $var = 'quotePost'; + } elseif (isset($current->audio)) { + $var = 'audioPost'; + } elseif (isset($current->video)) { + $var = 'videoPost'; } + else { + $var = 'blogPost'; + } render('post', array( 'title' => $current->title . ' - ' . blog_title(), @@ -1843,21 +1843,21 @@ get('/:year/:month/:name/edit', function ($year, $month, $name) { } $current = $post['current']; - - if (isset($current->image)) { - $var = 'edit-image'; - } elseif (isset($current->link)) { - $var = 'edit-link'; - } elseif (isset($current->quote)) { - $var = 'edit-quote'; - } elseif (isset($current->audio)) { - $var = 'edit-audio'; - } elseif (isset($current->video)) { - $var = 'edit-video'; - } else { - $var = 'edit-post'; - } - + + if (isset($current->image)) { + $var = 'edit-image'; + } elseif (isset($current->link)) { + $var = 'edit-link'; + } elseif (isset($current->quote)) { + $var = 'edit-quote'; + } elseif (isset($current->audio)) { + $var = 'edit-audio'; + } elseif (isset($current->video)) { + $var = 'edit-video'; + } else { + $var = 'edit-post'; + } + if ($user === $current->author || $role === 'admin') { render($var, array( 'title' => $var .' '. blog_title(), @@ -1889,9 +1889,9 @@ post('/:year/:month/:name/edit', function () { $proper = is_csrf_proper(from($_REQUEST, 'csrf_token')); $title = from($_REQUEST, 'title'); - $is_post = from($_REQUEST, 'is_post'); + $is_post = from($_REQUEST, 'is_post'); $image = from($_REQUEST, 'image'); - $is_image = from($_REQUEST, 'is_image'); + $is_image = from($_REQUEST, 'is_image'); $video = from($_REQUEST, 'video'); $is_video = from($_REQUEST, 'is_video'); $link = from($_REQUEST, 'link'); @@ -1914,57 +1914,57 @@ post('/:year/:month/:name/edit', function () { if ($date !== null && $time !== null) { $dateTime = $date . ' ' . $time; } - - if (!empty($is_image)) { - $var = 'edit-image'; - } elseif (!empty($is_video)) { - $var = 'edit-video'; - } elseif (!empty($is_link)) { - $var = 'edit-link'; - } elseif (!empty($is_quote)) { - $var = 'edit-quote'; - } elseif (!empty($is_audio)) { - $var = 'edit-audio'; - } elseif (!empty($is_post)) { - $var = 'edit-post'; - } + + if (!empty($is_image)) { + $var = 'edit-image'; + } elseif (!empty($is_video)) { + $var = 'edit-video'; + } elseif (!empty($is_link)) { + $var = 'edit-link'; + } elseif (!empty($is_quote)) { + $var = 'edit-quote'; + } elseif (!empty($is_audio)) { + $var = 'edit-audio'; + } elseif (!empty($is_post)) { + $var = 'edit-post'; + } if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($image)) { if (empty($url)) { $url = $title; } edit_image($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $image, $revertPost, $publishDraft); - + } else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($video)) { if (empty($url)) { $url = $title; } edit_video($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $video, $revertPost, $publishDraft); - + } else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($link)) { if (empty($url)) { $url = $title; } edit_link($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $link, $revertPost, $publishDraft); - + } else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($quote)) { if (empty($url)) { $url = $title; } edit_quote($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $quote, $revertPost, $publishDraft); - + } else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($audio)) { if (empty($url)) { $url = $title; } edit_audio($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $audio, $revertPost, $publishDraft); - + } else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($is_post)) { if (empty($url)) { $url = $title; } - edit_post($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $revertPost, $publishDraft); - + edit_post($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $revertPost, $publishDraft); + } else { $message['error'] = ''; if (empty($title)) { @@ -1980,28 +1980,28 @@ post('/:year/:month/:name/edit', function () { $message['error'] .= '
  • CSRF Token not correct.
  • '; } - if (!empty($is_image)) { - if (empty($image)) { - $message['error'] .= '
  • Image field is required.
  • '; - } - } elseif (!empty($is_video)) { - if (empty($video)) { - $message['error'] .= '
  • Video field is required.
  • '; - } - } elseif (!empty($is_link)) { - if (empty($link)) { - $message['error'] .= '
  • Link field is required.
  • '; - } - } elseif (!empty($is_quote)) { - if (empty($quote)) { - $message['error'] .= '
  • Quote field is required.
  • '; - } - } elseif (!empty($is_audio)) { - if (empty($audio)) { - $message['error'] .= '
  • Audio field is required.
  • '; - } - } - + if (!empty($is_image)) { + if (empty($image)) { + $message['error'] .= '
  • Image field is required.
  • '; + } + } elseif (!empty($is_video)) { + if (empty($video)) { + $message['error'] .= '
  • Video field is required.
  • '; + } + } elseif (!empty($is_link)) { + if (empty($link)) { + $message['error'] .= '
  • Link field is required.
  • '; + } + } elseif (!empty($is_quote)) { + if (empty($quote)) { + $message['error'] .= '
  • Quote field is required.
  • '; + } + } elseif (!empty($is_audio)) { + if (empty($audio)) { + $message['error'] .= '
  • Audio field is required.
  • '; + } + } + config('views.root', 'system/admin/views'); render($var, array( @@ -2039,7 +2039,7 @@ get('/:year/:month/:name/delete', function ($year, $month, $name) { if (!$post) { $post = find_draft($year, $month, $name); if (!$post) { - not_found(); + not_found(); } } diff --git a/system/includes/functions.php b/system/includes/functions.php index a01ad2e..4c85d43 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -268,9 +268,9 @@ function get_posts($posts, $page = 1, $perpage = 0) $post->title = get_content_tag('t', $content, 'Untitled: ' . date('l jS \of F Y', $post->date)); $post->image = get_content_tag('image', $content); $post->video = get_youtube_id(get_content_tag('video', $content)); - $post->link = get_content_tag('link', $content); - $post->quote = get_content_tag('quote', $content); - $post->audio = get_content_tag('audio', $content); + $post->link = get_content_tag('link', $content); + $post->quote = get_content_tag('quote', $content); + $post->audio = get_content_tag('audio', $content); // Get the contents and convert it to HTML $post->body = MarkdownExtra::defaultTransform(remove_html_comments($content)); @@ -404,7 +404,7 @@ function get_tag($tag, $page, $perpage, $random) if (empty($tmp)) { not_found(); } - + $tmp = array_unique($tmp, SORT_REGULAR); return $tmp = get_posts($tmp, $page, $perpage); @@ -490,7 +490,7 @@ function get_author($name) if (!empty($names)) { foreach ($names as $index => $v) { - + $author = new stdClass; // Replaced string @@ -666,7 +666,7 @@ function get_related($tag, $custom = null) $tmp[] = $post; } } - + if (empty($custom)) { $total = count($tmp); @@ -681,15 +681,15 @@ function get_related($tag, $custom = null) break; } echo ''; - + } else { - echo ''; + echo ''; } - - } else { - return $tmp; - } - + + } else { + return $tmp; + } + } // Return post count. Matching $var and $str provided. @@ -755,20 +755,20 @@ function keyword_count($keyword) // Return recent posts lists function recent_posts($custom = null, $count = null) { - + if (empty($count)) { $count = config('recent.count'); if (empty($count)) { $count = 5; } } - + $posts = get_posts(null, 1, $count); - - if (!empty($custom)) { - return $posts; + + if (!empty($custom)) { + return $posts; } else { - + $str = ''; return $str; - + } } @@ -826,11 +826,11 @@ function archive_list($custom = null) $arrow = '►'; } $i++; - + $by_month = array_count_values($months); # Sort the months krsort($by_month); - + $script = << -1){this.parentNode.className = 'collapsed';this.innerHTML = '►';} else {this.parentNode.className = 'expanded';this.innerHTML = '▼';} EOF; @@ -878,7 +878,7 @@ function tag_cloud($custom = null) $tag_collection = array_count_values($tags); ksort($tag_collection); - + if(empty($custom)) { echo ''; } else { - return $tag_collection; + return $tag_collection; } } } @@ -945,7 +945,7 @@ function get_description($string, $char = null) function get_teaser($text, $char = null) { $teaserType = config('teaser.type'); - + if(empty($char)) { $char = config('teaser.char'); } @@ -1296,11 +1296,11 @@ function get_menu($custom) } else { $active = ''; } - - $subPages = get_static_sub_pages(str_replace('.md', '', $base)); + + $subPages = get_static_sub_pages(str_replace('.md', '', $base)); if (!empty($subPages)) { - echo '
  • '; - echo '' . ucwords($title) . ''; - } + echo '
  • '; + echo '' . ucwords($title) . ''; + } echo '
  • '; } echo ''; @@ -1345,7 +1345,7 @@ function get_menu($custom) // Search form function search($text = null) { - if(!empty($text)) { + if(!empty($text)) { echo << @@ -1359,7 +1359,7 @@ EOF; EOF; - } + } if (isset($_GET['search'])) { $url = site_url() . 'search/' . $_GET['search']; header("Location: $url"); @@ -1874,7 +1874,7 @@ function toolbar() $base = site_url(); echo << + EOF; echo '
      '; echo '
    • Admin
    • '; diff --git a/themes/clean/main.html.php b/themes/clean/main.html.php index 924c6de..5306e6c 100644 --- a/themes/clean/main.html.php +++ b/themes/clean/main.html.php @@ -24,7 +24,7 @@ url ?>> Comments
    - image)) { ?> + image)) { ?> @@ -34,11 +34,11 @@ - audio)) { ?> - - + audio)) { ?> + + quote)) { ?> - image)) { ?> - - - video)) { ?> - - - audio)) { ?> - - - quote)) { ?> - - - link)) { ?> - - + image)) { ?> + + + video)) { ?> + + + audio)) { ?> + + + quote)) { ?> + + + link)) { ?> + +
    body; ?>
    diff --git a/themes/default/main.html.php b/themes/default/main.html.php index 924c6de..5306e6c 100644 --- a/themes/default/main.html.php +++ b/themes/default/main.html.php @@ -24,7 +24,7 @@ url ?>> Comments - image)) { ?> + image)) { ?> @@ -34,11 +34,11 @@ - audio)) { ?> - - + audio)) { ?> + + quote)) { ?> - image)) { ?> - - - video)) { ?> - - - audio)) { ?> - - - quote)) { ?> - - - link)) { ?> - - + image)) { ?> + + + video)) { ?> + + + audio)) { ?> + + + quote)) { ?> + + + link)) { ?> + +
    body; ?>
    diff --git a/themes/logs/layout.html.php b/themes/logs/layout.html.php index 36c20b1..dab8b1c 100644 --- a/themes/logs/layout.html.php +++ b/themes/logs/layout.html.php @@ -63,7 +63,7 @@
    -

    Comments

    +

    Comments

    diff --git a/themes/logs/main.html.php b/themes/logs/main.html.php index a27816c..0d34311 100644 --- a/themes/logs/main.html.php +++ b/themes/logs/main.html.php @@ -24,7 +24,7 @@ url ?>> Comments - image)) { ?> + image)) { ?> diff --git a/themes/logs/post.html.php b/themes/logs/post.html.php index 28a5371..d93907a 100644 --- a/themes/logs/post.html.php +++ b/themes/logs/post.html.php @@ -13,31 +13,31 @@ - Permalink - image)) { ?> - - - video)) { ?> - - - audio)) { ?> - - - quote)) { ?> - - - link)) { ?> - - + image)) { ?> + + + video)) { ?> + + + audio)) { ?> + + + quote)) { ?> + + + link)) { ?> + +
    body; ?>
    @@ -47,8 +47,8 @@

    By name ?>

    about ?> -
    - +