Browse Source

Cleaning up

pull/189/head
Danang Probo Sayekti 10 years ago
parent
commit
dcbf9f0700
26 changed files with 488 additions and 488 deletions
  1. +162
    -162
      system/admin/admin.php
  2. +7
    -7
      system/admin/views/add-audio.html.php
  3. +7
    -7
      system/admin/views/add-image.html.php
  4. +7
    -7
      system/admin/views/add-link.html.php
  5. +7
    -7
      system/admin/views/add-page.html.php
  6. +7
    -7
      system/admin/views/add-post.html.php
  7. +7
    -7
      system/admin/views/add-quote.html.php
  8. +7
    -7
      system/admin/views/add-video.html.php
  9. +9
    -9
      system/admin/views/edit-audio.html.php
  10. +9
    -9
      system/admin/views/edit-image.html.php
  11. +9
    -9
      system/admin/views/edit-link.html.php
  12. +13
    -13
      system/admin/views/edit-page.html.php
  13. +8
    -8
      system/admin/views/edit-post.html.php
  14. +7
    -7
      system/admin/views/edit-profile.html.php
  15. +9
    -9
      system/admin/views/edit-quote.html.php
  16. +9
    -9
      system/admin/views/edit-video.html.php
  17. +1
    -1
      system/admin/views/update.html.php
  18. +77
    -77
      system/htmly.php
  19. +35
    -35
      system/includes/functions.php
  20. +6
    -6
      themes/clean/main.html.php
  21. +25
    -25
      themes/clean/post.html.php
  22. +6
    -6
      themes/default/main.html.php
  23. +25
    -25
      themes/default/post.html.php
  24. +1
    -1
      themes/logs/layout.html.php
  25. +1
    -1
      themes/logs/main.html.php
  26. +27
    -27
      themes/logs/post.html.php

+ 162
- 162
system/admin/admin.php View File

@ -89,9 +89,9 @@ function remove_accent($str)
function edit_post($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $revertPost, $publishDraft) function edit_post($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $revertPost, $publishDraft)
{ {
$oldurl = explode('_', $oldfile); $oldurl = explode('_', $oldfile);
$dir = explode('/', $oldurl[0]);
$dir = explode('/', $oldurl[0]);
$olddate = date('Y-m-d-h-i-s', strtotime($date)); $olddate = date('Y-m-d-h-i-s', strtotime($date));
if ($date !== null) { if ($date !== null) {
$oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate; $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<!--d " . $description . " d-->"; $post_description = "\n<!--d " . $description . " d-->";
} else { } else {
$post_description = ""; $post_description = "";
}
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description ."\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description ."\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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); $post_content = stripslashes($post_content);
} }
if(!empty($revertPost) || !empty($publishDraft)) { if(!empty($revertPost) || !empty($publishDraft)) {
$dirBlog = $dir[0] . '/' . $dir[1] . '/blog/'; $dirBlog = $dir[0] . '/' . $dir[1] . '/blog/';
$dirDraft = $dir[0] . '/' . $dir[1] . '/draft/'; $dirDraft = $dir[0] . '/' . $dir[1] . '/draft/';
if($dir[2] == 'draft') { if($dir[2] == 'draft') {
$filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else { } else {
$filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
}
}
if (is_dir($dirBlog)) { if (is_dir($dirBlog)) {
} else { } else {
mkdir($dirBlog, 0775, true); mkdir($dirBlog, 0775, true);
} }
if (is_dir($dirDraft)) {
if (is_dir($dirDraft)) {
} else { } else {
mkdir($dirDraft, 0775, true); mkdir($dirDraft, 0775, true);
} }
file_put_contents($filename, print_r($post_content, true)); file_put_contents($filename, print_r($post_content, true));
unlink($oldfile); unlink($oldfile);
$newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else {
} else {
$newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; $newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md';
if ($oldfile === $newfile) { if ($oldfile === $newfile) {
file_put_contents($oldfile, print_r($post_content, true)); file_put_contents($oldfile, print_r($post_content, true));
} else { } else {
rename($oldfile, $newfile); rename($oldfile, $newfile);
file_put_contents($newfile, print_r($post_content, true)); file_put_contents($newfile, print_r($post_content, true));
} }
}
}
if(!empty($publishDraft)) { if(!empty($publishDraft)) {
$dt = $olddate; $dt = $olddate;
@ -162,14 +162,14 @@ function edit_post($title, $tag, $url, $content, $oldfile, $destination = null,
$t = str_replace('-', '', $dt); $t = str_replace('-', '', $dt);
$time = new DateTime($t); $time = new DateTime($t);
$timestamp = $time->format("Y-m-d"); $timestamp = $time->format("Y-m-d");
}
}
// The post date // The post date
$postdate = strtotime($timestamp); $postdate = strtotime($timestamp);
// The post URL // The post URL
$posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url; $posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url;
rebuilt_cache('all'); rebuilt_cache('all');
clear_post_cache($dt, $post_tag, $post_url, $newfile); clear_post_cache($dt, $post_tag, $post_url, $newfile);
if ($destination == 'post') { 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) function edit_image($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $image, $revertPost, $publishDraft)
{ {
$oldurl = explode('_', $oldfile); $oldurl = explode('_', $oldfile);
$dir = explode('/', $oldurl[0]);
$dir = explode('/', $oldurl[0]);
$olddate = date('Y-m-d-h-i-s', strtotime($date)); $olddate = date('Y-m-d-h-i-s', strtotime($date));
if ($date !== null) { if ($date !== null) {
$oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate; $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<!--image " . $post_image. " image-->"; $post_image = "\n<!--image " . $post_image. " image-->";
} else { } else {
$post_image = ""; $post_image = "";
}
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_image ."\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_image ."\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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); $post_content = stripslashes($post_content);
} }
if(!empty($revertPost) || !empty($publishDraft)) { if(!empty($revertPost) || !empty($publishDraft)) {
$dirBlog = $dir[0] . '/' . $dir[1] . '/blog/'; $dirBlog = $dir[0] . '/' . $dir[1] . '/blog/';
$dirDraft = $dir[0] . '/' . $dir[1] . '/draft/'; $dirDraft = $dir[0] . '/' . $dir[1] . '/draft/';
if($dir[2] == 'draft') { if($dir[2] == 'draft') {
$filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else { } else {
$filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
}
}
if (is_dir($dirBlog)) { if (is_dir($dirBlog)) {
} else { } else {
mkdir($dirBlog, 0775, true); mkdir($dirBlog, 0775, true);
} }
if (is_dir($dirDraft)) {
if (is_dir($dirDraft)) {
} else { } else {
mkdir($dirDraft, 0775, true); mkdir($dirDraft, 0775, true);
} }
file_put_contents($filename, print_r($post_content, true)); file_put_contents($filename, print_r($post_content, true));
unlink($oldfile); unlink($oldfile);
$newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else {
} else {
$newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; $newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md';
if ($oldfile === $newfile) { if ($oldfile === $newfile) {
file_put_contents($oldfile, print_r($post_content, true)); file_put_contents($oldfile, print_r($post_content, true));
} else { } else {
rename($oldfile, $newfile); rename($oldfile, $newfile);
file_put_contents($newfile, print_r($post_content, true)); file_put_contents($newfile, print_r($post_content, true));
} }
}
}
if(!empty($publishDraft)) { if(!empty($publishDraft)) {
$dt = $olddate; $dt = $olddate;
@ -276,14 +276,14 @@ function edit_image($title, $tag, $url, $content, $oldfile, $destination = null,
$t = str_replace('-', '', $dt); $t = str_replace('-', '', $dt);
$time = new DateTime($t); $time = new DateTime($t);
$timestamp = $time->format("Y-m-d"); $timestamp = $time->format("Y-m-d");
}
}
// The post date // The post date
$postdate = strtotime($timestamp); $postdate = strtotime($timestamp);
// The post URL // The post URL
$posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url; $posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url;
rebuilt_cache('all'); rebuilt_cache('all');
clear_post_cache($dt, $post_tag, $post_url, $newfile); clear_post_cache($dt, $post_tag, $post_url, $newfile);
if ($destination == 'post') { 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) function edit_video($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $video, $revertPost, $publishDraft)
{ {
$oldurl = explode('_', $oldfile); $oldurl = explode('_', $oldfile);
$dir = explode('/', $oldurl[0]);
$dir = explode('/', $oldurl[0]);
$olddate = date('Y-m-d-h-i-s', strtotime($date)); $olddate = date('Y-m-d-h-i-s', strtotime($date));
if ($date !== null) { if ($date !== null) {
$oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate; $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<!--video " . $post_video . " video-->"; $post_video = "\n<!--video " . $post_video . " video-->";
} else { } else {
$post_video = ""; $post_video = "";
}
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_video ."\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_video ."\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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); $post_content = stripslashes($post_content);
} }
if(!empty($revertPost) || !empty($publishDraft)) { if(!empty($revertPost) || !empty($publishDraft)) {
$dirBlog = $dir[0] . '/' . $dir[1] . '/blog/'; $dirBlog = $dir[0] . '/' . $dir[1] . '/blog/';
$dirDraft = $dir[0] . '/' . $dir[1] . '/draft/'; $dirDraft = $dir[0] . '/' . $dir[1] . '/draft/';
if($dir[2] == 'draft') { if($dir[2] == 'draft') {
$filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else { } else {
$filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
}
}
if (is_dir($dirBlog)) { if (is_dir($dirBlog)) {
} else { } else {
mkdir($dirBlog, 0775, true); mkdir($dirBlog, 0775, true);
} }
if (is_dir($dirDraft)) {
if (is_dir($dirDraft)) {
} else { } else {
mkdir($dirDraft, 0775, true); mkdir($dirDraft, 0775, true);
} }
file_put_contents($filename, print_r($post_content, true)); file_put_contents($filename, print_r($post_content, true));
unlink($oldfile); unlink($oldfile);
$newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else {
} else {
$newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; $newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md';
if ($oldfile === $newfile) { if ($oldfile === $newfile) {
file_put_contents($oldfile, print_r($post_content, true)); file_put_contents($oldfile, print_r($post_content, true));
} else { } else {
rename($oldfile, $newfile); rename($oldfile, $newfile);
file_put_contents($newfile, print_r($post_content, true)); file_put_contents($newfile, print_r($post_content, true));
} }
}
}
if(!empty($publishDraft)) { if(!empty($publishDraft)) {
$dt = $olddate; $dt = $olddate;
@ -390,14 +390,14 @@ function edit_video($title, $tag, $url, $content, $oldfile, $destination = null,
$t = str_replace('-', '', $dt); $t = str_replace('-', '', $dt);
$time = new DateTime($t); $time = new DateTime($t);
$timestamp = $time->format("Y-m-d"); $timestamp = $time->format("Y-m-d");
}
}
// The post date // The post date
$postdate = strtotime($timestamp); $postdate = strtotime($timestamp);
// The post URL // The post URL
$posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url; $posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url;
rebuilt_cache('all'); rebuilt_cache('all');
clear_post_cache($dt, $post_tag, $post_url, $newfile); clear_post_cache($dt, $post_tag, $post_url, $newfile);
if ($destination == 'post') { 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) function edit_link($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $link, $revertPost, $publishDraft)
{ {
$oldurl = explode('_', $oldfile); $oldurl = explode('_', $oldfile);
$dir = explode('/', $oldurl[0]);
$dir = explode('/', $oldurl[0]);
$olddate = date('Y-m-d-h-i-s', strtotime($date)); $olddate = date('Y-m-d-h-i-s', strtotime($date));
if ($date !== null) { if ($date !== null) {
$oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate; $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<!--link" . $post_link. " link-->"; $post_link = "\n<!--link" . $post_link. " link-->";
} else { } else {
$post_link = ""; $post_link = "";
}
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_link ."\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_link ."\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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); $post_content = stripslashes($post_content);
} }
if(!empty($revertPost) || !empty($publishDraft)) { if(!empty($revertPost) || !empty($publishDraft)) {
$dirBlog = $dir[0] . '/' . $dir[1] . '/blog/'; $dirBlog = $dir[0] . '/' . $dir[1] . '/blog/';
$dirDraft = $dir[0] . '/' . $dir[1] . '/draft/'; $dirDraft = $dir[0] . '/' . $dir[1] . '/draft/';
if($dir[2] == 'draft') { if($dir[2] == 'draft') {
$filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else { } else {
$filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
}
}
if (is_dir($dirBlog)) { if (is_dir($dirBlog)) {
} else { } else {
mkdir($dirBlog, 0775, true); mkdir($dirBlog, 0775, true);
} }
if (is_dir($dirDraft)) {
if (is_dir($dirDraft)) {
} else { } else {
mkdir($dirDraft, 0775, true); mkdir($dirDraft, 0775, true);
} }
file_put_contents($filename, print_r($post_content, true)); file_put_contents($filename, print_r($post_content, true));
unlink($oldfile); unlink($oldfile);
$newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else {
} else {
$newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; $newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md';
if ($oldfile === $newfile) { if ($oldfile === $newfile) {
file_put_contents($oldfile, print_r($post_content, true)); file_put_contents($oldfile, print_r($post_content, true));
} else { } else {
rename($oldfile, $newfile); rename($oldfile, $newfile);
file_put_contents($newfile, print_r($post_content, true)); file_put_contents($newfile, print_r($post_content, true));
} }
}
}
if(!empty($publishDraft)) { if(!empty($publishDraft)) {
$dt = $olddate; $dt = $olddate;
@ -504,14 +504,14 @@ function edit_link($title, $tag, $url, $content, $oldfile, $destination = null,
$t = str_replace('-', '', $dt); $t = str_replace('-', '', $dt);
$time = new DateTime($t); $time = new DateTime($t);
$timestamp = $time->format("Y-m-d"); $timestamp = $time->format("Y-m-d");
}
}
// The post date // The post date
$postdate = strtotime($timestamp); $postdate = strtotime($timestamp);
// The post URL // The post URL
$posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url; $posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url;
rebuilt_cache('all'); rebuilt_cache('all');
clear_post_cache($dt, $post_tag, $post_url, $newfile); clear_post_cache($dt, $post_tag, $post_url, $newfile);
if ($destination == 'post') { 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) function edit_quote($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $quote, $revertPost, $publishDraft)
{ {
$oldurl = explode('_', $oldfile); $oldurl = explode('_', $oldfile);
$dir = explode('/', $oldurl[0]);
$dir = explode('/', $oldurl[0]);
$olddate = date('Y-m-d-h-i-s', strtotime($date)); $olddate = date('Y-m-d-h-i-s', strtotime($date));
if ($date !== null) { if ($date !== null) {
$oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate; $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<!--quote" . $post_quote . " quote-->"; $post_quote = "\n<!--quote" . $post_quote . " quote-->";
} else { } else {
$post_quote = ""; $post_quote = "";
}
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_quote ."\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_quote ."\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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); $post_content = stripslashes($post_content);
} }
if(!empty($revertPost) || !empty($publishDraft)) { if(!empty($revertPost) || !empty($publishDraft)) {
$dirBlog = $dir[0] . '/' . $dir[1] . '/blog/'; $dirBlog = $dir[0] . '/' . $dir[1] . '/blog/';
$dirDraft = $dir[0] . '/' . $dir[1] . '/draft/'; $dirDraft = $dir[0] . '/' . $dir[1] . '/draft/';
if($dir[2] == 'draft') { if($dir[2] == 'draft') {
$filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else { } else {
$filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
}
}
if (is_dir($dirBlog)) { if (is_dir($dirBlog)) {
} else { } else {
mkdir($dirBlog, 0775, true); mkdir($dirBlog, 0775, true);
} }
if (is_dir($dirDraft)) {
if (is_dir($dirDraft)) {
} else { } else {
mkdir($dirDraft, 0775, true); mkdir($dirDraft, 0775, true);
} }
file_put_contents($filename, print_r($post_content, true)); file_put_contents($filename, print_r($post_content, true));
unlink($oldfile); unlink($oldfile);
$newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else {
} else {
$newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; $newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md';
if ($oldfile === $newfile) { if ($oldfile === $newfile) {
file_put_contents($oldfile, print_r($post_content, true)); file_put_contents($oldfile, print_r($post_content, true));
} else { } else {
rename($oldfile, $newfile); rename($oldfile, $newfile);
file_put_contents($newfile, print_r($post_content, true)); file_put_contents($newfile, print_r($post_content, true));
} }
}
}
if(!empty($publishDraft)) { if(!empty($publishDraft)) {
$dt = $olddate; $dt = $olddate;
@ -618,14 +618,14 @@ function edit_quote($title, $tag, $url, $content, $oldfile, $destination = null,
$t = str_replace('-', '', $dt); $t = str_replace('-', '', $dt);
$time = new DateTime($t); $time = new DateTime($t);
$timestamp = $time->format("Y-m-d"); $timestamp = $time->format("Y-m-d");
}
}
// The post date // The post date
$postdate = strtotime($timestamp); $postdate = strtotime($timestamp);
// The post URL // The post URL
$posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url; $posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url;
rebuilt_cache('all'); rebuilt_cache('all');
clear_post_cache($dt, $post_tag, $post_url, $newfile); clear_post_cache($dt, $post_tag, $post_url, $newfile);
if ($destination == 'post') { 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) function edit_audio($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $audio, $revertPost, $publishDraft)
{ {
$oldurl = explode('_', $oldfile); $oldurl = explode('_', $oldfile);
$dir = explode('/', $oldurl[0]);
$dir = explode('/', $oldurl[0]);
$olddate = date('Y-m-d-h-i-s', strtotime($date)); $olddate = date('Y-m-d-h-i-s', strtotime($date));
if ($date !== null) { if ($date !== null) {
$oldurl[0] = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/' . $olddate; $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<!--audio" . $post_audio . " audio-->"; $post_audio = "\n<!--audio" . $post_audio . " audio-->";
} else { } else {
$post_audio = ""; $post_audio = "";
}
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_audio ."\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_audio ."\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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); $post_content = stripslashes($post_content);
} }
if(!empty($revertPost) || !empty($publishDraft)) { if(!empty($revertPost) || !empty($publishDraft)) {
$dirBlog = $dir[0] . '/' . $dir[1] . '/blog/'; $dirBlog = $dir[0] . '/' . $dir[1] . '/blog/';
$dirDraft = $dir[0] . '/' . $dir[1] . '/draft/'; $dirDraft = $dir[0] . '/' . $dir[1] . '/draft/';
if($dir[2] == 'draft') { if($dir[2] == 'draft') {
$filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $dirBlog . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else { } else {
$filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $dirDraft . $olddate . '_' . $post_tag . '_' . $post_url . '.md';
}
}
if (is_dir($dirBlog)) { if (is_dir($dirBlog)) {
} else { } else {
mkdir($dirBlog, 0775, true); mkdir($dirBlog, 0775, true);
} }
if (is_dir($dirDraft)) {
if (is_dir($dirDraft)) {
} else { } else {
mkdir($dirDraft, 0775, true); mkdir($dirDraft, 0775, true);
} }
file_put_contents($filename, print_r($post_content, true)); file_put_contents($filename, print_r($post_content, true));
unlink($oldfile); unlink($oldfile);
$newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md'; $newfile = $olddate . '_' . $post_tag . '_' . $post_url . '.md';
} else {
} else {
$newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; $newfile = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md';
if ($oldfile === $newfile) { if ($oldfile === $newfile) {
file_put_contents($oldfile, print_r($post_content, true)); file_put_contents($oldfile, print_r($post_content, true));
} else { } else {
rename($oldfile, $newfile); rename($oldfile, $newfile);
file_put_contents($newfile, print_r($post_content, true)); file_put_contents($newfile, print_r($post_content, true));
} }
}
}
if(!empty($publishDraft)) { if(!empty($publishDraft)) {
$dt = $olddate; $dt = $olddate;
@ -732,14 +732,14 @@ function edit_audio($title, $tag, $url, $content, $oldfile, $destination = null,
$t = str_replace('-', '', $dt); $t = str_replace('-', '', $dt);
$time = new DateTime($t); $time = new DateTime($t);
$timestamp = $time->format("Y-m-d"); $timestamp = $time->format("Y-m-d");
}
}
// The post date // The post date
$postdate = strtotime($timestamp); $postdate = strtotime($timestamp);
// The post URL // The post URL
$posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url; $posturl = site_url() . date('Y/m', $postdate) . '/' . $post_url;
rebuilt_cache('all'); rebuilt_cache('all');
clear_post_cache($dt, $post_tag, $post_url, $newfile); clear_post_cache($dt, $post_tag, $post_url, $newfile);
if ($destination == 'post') { if ($destination == 'post') {
@ -815,15 +815,15 @@ function add_post($title, $tag, $url, $content, $user, $description = null, $dra
$post_description = "\n<!--d " . $description . " d-->"; $post_description = "\n<!--d " . $description . " d-->";
} else { } else {
$post_description = ""; $post_description = "";
}
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description ."\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description ."\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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); $post_content = stripslashes($post_content);
} }
$filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md';
if (empty($draft)) { if (empty($draft)) {
@ -831,7 +831,7 @@ function add_post($title, $tag, $url, $content, $user, $description = null, $dra
} else { } else {
$dir = 'content/' . $user . '/draft/'; $dir = 'content/' . $user . '/draft/';
} }
if (is_dir($dir)) { if (is_dir($dir)) {
file_put_contents($dir . $filename, print_r($post_content, true)); file_put_contents($dir . $filename, print_r($post_content, true));
} else { } else {
@ -841,13 +841,13 @@ function add_post($title, $tag, $url, $content, $user, $description = null, $dra
rebuilt_cache('all'); rebuilt_cache('all');
clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename); clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename);
if (empty($draft)) { if (empty($draft)) {
$redirect = site_url() . 'admin/mine'; $redirect = site_url() . 'admin/mine';
} else { } else {
$redirect = site_url() . 'admin/draft'; $redirect = site_url() . 'admin/draft';
} }
header("Location: $redirect"); header("Location: $redirect");
} }
} }
@ -871,15 +871,15 @@ function add_image($title, $tag, $url, $content, $user, $description = null, $im
$post_image = "\n<!--image " . $post_image. " image-->"; $post_image = "\n<!--image " . $post_image. " image-->";
} else { } else {
$post_image = ""; $post_image = "";
}
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_image ."\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_image ."\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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); $post_content = stripslashes($post_content);
} }
$filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md';
if (empty($draft)) { if (empty($draft)) {
@ -887,7 +887,7 @@ function add_image($title, $tag, $url, $content, $user, $description = null, $im
} else { } else {
$dir = 'content/' . $user . '/draft/'; $dir = 'content/' . $user . '/draft/';
} }
if (is_dir($dir)) { if (is_dir($dir)) {
file_put_contents($dir . $filename, print_r($post_content, true)); file_put_contents($dir . $filename, print_r($post_content, true));
} else { } else {
@ -897,13 +897,13 @@ function add_image($title, $tag, $url, $content, $user, $description = null, $im
rebuilt_cache('all'); rebuilt_cache('all');
clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename); clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename);
if (empty($draft)) { if (empty($draft)) {
$redirect = site_url() . 'admin/mine'; $redirect = site_url() . 'admin/mine';
} else { } else {
$redirect = site_url() . 'admin/draft'; $redirect = site_url() . 'admin/draft';
} }
header("Location: $redirect"); header("Location: $redirect");
} }
} }
@ -927,15 +927,15 @@ function add_video($title, $tag, $url, $content, $user, $description = null, $vi
$post_video = "\n<!--video " . $post_video . " video-->"; $post_video = "\n<!--video " . $post_video . " video-->";
} else { } else {
$post_video = ""; $post_video = "";
}
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_video ."\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_video ."\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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); $post_content = stripslashes($post_content);
} }
$filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md';
if (empty($draft)) { if (empty($draft)) {
@ -943,7 +943,7 @@ function add_video($title, $tag, $url, $content, $user, $description = null, $vi
} else { } else {
$dir = 'content/' . $user . '/draft/'; $dir = 'content/' . $user . '/draft/';
} }
if (is_dir($dir)) { if (is_dir($dir)) {
file_put_contents($dir . $filename, print_r($post_content, true)); file_put_contents($dir . $filename, print_r($post_content, true));
} else { } else {
@ -953,13 +953,13 @@ function add_video($title, $tag, $url, $content, $user, $description = null, $vi
rebuilt_cache('all'); rebuilt_cache('all');
clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename); clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename);
if (empty($draft)) { if (empty($draft)) {
$redirect = site_url() . 'admin/mine'; $redirect = site_url() . 'admin/mine';
} else { } else {
$redirect = site_url() . 'admin/draft'; $redirect = site_url() . 'admin/draft';
} }
header("Location: $redirect"); header("Location: $redirect");
} }
} }
@ -983,15 +983,15 @@ function add_audio($title, $tag, $url, $content, $user, $description = null, $au
$post_audio = "\n<!--audio " . $post_audio . " audio-->"; $post_audio = "\n<!--audio " . $post_audio . " audio-->";
} else { } else {
$post_audio = ""; $post_audio = "";
}
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_audio ."\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_audio ."\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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); $post_content = stripslashes($post_content);
} }
$filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md';
if (empty($draft)) { if (empty($draft)) {
@ -999,7 +999,7 @@ function add_audio($title, $tag, $url, $content, $user, $description = null, $au
} else { } else {
$dir = 'content/' . $user . '/draft/'; $dir = 'content/' . $user . '/draft/';
} }
if (is_dir($dir)) { if (is_dir($dir)) {
file_put_contents($dir . $filename, print_r($post_content, true)); file_put_contents($dir . $filename, print_r($post_content, true));
} else { } else {
@ -1009,13 +1009,13 @@ function add_audio($title, $tag, $url, $content, $user, $description = null, $au
rebuilt_cache('all'); rebuilt_cache('all');
clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename); clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename);
if (empty($draft)) { if (empty($draft)) {
$redirect = site_url() . 'admin/mine'; $redirect = site_url() . 'admin/mine';
} else { } else {
$redirect = site_url() . 'admin/draft'; $redirect = site_url() . 'admin/draft';
} }
header("Location: $redirect"); header("Location: $redirect");
} }
} }
@ -1039,15 +1039,15 @@ function add_link($title, $tag, $url, $content, $user, $description = null, $lin
$post_link = "\n<!--link " . $post_link . " link-->"; $post_link = "\n<!--link " . $post_link . " link-->";
} else { } else {
$post_link = ""; $post_link = "";
}
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_link ."\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_link ."\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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); $post_content = stripslashes($post_content);
} }
$filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md';
if (empty($draft)) { if (empty($draft)) {
@ -1055,7 +1055,7 @@ function add_link($title, $tag, $url, $content, $user, $description = null, $lin
} else { } else {
$dir = 'content/' . $user . '/draft/'; $dir = 'content/' . $user . '/draft/';
} }
if (is_dir($dir)) { if (is_dir($dir)) {
file_put_contents($dir . $filename, print_r($post_content, true)); file_put_contents($dir . $filename, print_r($post_content, true));
} else { } else {
@ -1065,13 +1065,13 @@ function add_link($title, $tag, $url, $content, $user, $description = null, $lin
rebuilt_cache('all'); rebuilt_cache('all');
clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename); clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename);
if (empty($draft)) { if (empty($draft)) {
$redirect = site_url() . 'admin/mine'; $redirect = site_url() . 'admin/mine';
} else { } else {
$redirect = site_url() . 'admin/draft'; $redirect = site_url() . 'admin/draft';
} }
header("Location: $redirect"); header("Location: $redirect");
} }
} }
@ -1095,15 +1095,15 @@ function add_quote($title, $tag, $url, $content, $user, $description = null, $qu
$post_quote = "\n<!--quote " . $post_quote . " quote-->"; $post_quote = "\n<!--quote " . $post_quote . " quote-->";
} else { } else {
$post_quote = ""; $post_quote = "";
}
}
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_quote ."\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . $post_quote ."\n\n" . $content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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); $post_content = stripslashes($post_content);
} }
$filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md';
if (empty($draft)) { if (empty($draft)) {
@ -1111,7 +1111,7 @@ function add_quote($title, $tag, $url, $content, $user, $description = null, $qu
} else { } else {
$dir = 'content/' . $user . '/draft/'; $dir = 'content/' . $user . '/draft/';
} }
if (is_dir($dir)) { if (is_dir($dir)) {
file_put_contents($dir . $filename, print_r($post_content, true)); file_put_contents($dir . $filename, print_r($post_content, true));
} else { } else {
@ -1121,13 +1121,13 @@ function add_quote($title, $tag, $url, $content, $user, $description = null, $qu
rebuilt_cache('all'); rebuilt_cache('all');
clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename); clear_post_cache($post_date, $post_tag, $post_url, $dir . $filename);
if (empty($draft)) { if (empty($draft)) {
$redirect = site_url() . 'admin/mine'; $redirect = site_url() . 'admin/mine';
} else { } else {
$redirect = site_url() . 'admin/draft'; $redirect = site_url() . 'admin/draft';
} }
header("Location: $redirect"); header("Location: $redirect");
} }
} }


+ 7
- 7
system/admin/views/add-audio.html.php View File

@ -71,19 +71,19 @@
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -113,18 +113,18 @@
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 7
- 7
system/admin/views/add-image.html.php View File

@ -71,19 +71,19 @@
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -113,18 +113,18 @@
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 7
- 7
system/admin/views/add-link.html.php View File

@ -71,19 +71,19 @@
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -113,18 +113,18 @@
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 7
- 7
system/admin/views/add-page.html.php View File

@ -58,19 +58,19 @@
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -100,18 +100,18 @@
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 7
- 7
system/admin/views/add-post.html.php View File

@ -64,19 +64,19 @@
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -106,18 +106,18 @@
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 7
- 7
system/admin/views/add-quote.html.php View File

@ -71,19 +71,19 @@
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -113,18 +113,18 @@
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 7
- 7
system/admin/views/add-video.html.php View File

@ -71,19 +71,19 @@
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -113,18 +113,18 @@
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 9
- 9
system/admin/views/edit-audio.html.php View File

@ -65,7 +65,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br> Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br>
<span class="help">If the url leave empty we will use the post title.</span><br><br> <span class="help">If the url leave empty we will use the post title.</span><br><br>
Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br> Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br>
Hour, Minute, Second<br><input
Hour, Minute, Second<br><input
type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br> type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) {
echo $p->description; echo $p->description;
@ -82,7 +82,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
echo 'error'; echo 'error';
} }
} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br> } ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
<input type="hidden" name="is_audio" class="text" value="is_audio"/>
<input type="hidden" name="is_audio" class="text" value="is_audio"/>
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<?php if ($isdraft[2] == 'draft') { ?> <?php if ($isdraft[2] == 'draft') { ?>
@ -109,19 +109,19 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -151,18 +151,18 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 9
- 9
system/admin/views/edit-image.html.php View File

@ -65,7 +65,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br> Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br>
<span class="help">If the url leave empty we will use the post title.</span><br><br> <span class="help">If the url leave empty we will use the post title.</span><br><br>
Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br> Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br>
Hour, Minute, Second<br><input
Hour, Minute, Second<br><input
type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br> type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) {
echo $p->description; echo $p->description;
@ -82,7 +82,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
echo 'error'; echo 'error';
} }
} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br> } ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
<input type="hidden" name="is_image" class="text" value="is_image"/>
<input type="hidden" name="is_image" class="text" value="is_image"/>
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<?php if ($isdraft[2] == 'draft') { ?> <?php if ($isdraft[2] == 'draft') { ?>
@ -109,19 +109,19 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -151,18 +151,18 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 9
- 9
system/admin/views/edit-link.html.php View File

@ -65,7 +65,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br> Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br>
<span class="help">If the url leave empty we will use the post title.</span><br><br> <span class="help">If the url leave empty we will use the post title.</span><br><br>
Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br> Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br>
Hour, Minute, Second<br><input
Hour, Minute, Second<br><input
type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br> type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) {
echo $p->description; echo $p->description;
@ -82,7 +82,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
echo 'error'; echo 'error';
} }
} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br> } ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
<input type="hidden" name="is_link" class="text" value="is_link"/>
<input type="hidden" name="is_link" class="text" value="is_link"/>
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<?php if ($isdraft[2] == 'draft') { ?> <?php if ($isdraft[2] == 'draft') { ?>
@ -109,19 +109,19 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -151,18 +151,18 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 13
- 13
system/admin/views/edit-page.html.php View File

@ -23,12 +23,12 @@ if (isset($p->url)) {
$delete = $p->url . '/delete?destination=' . $destination; $delete = $p->url . '/delete?destination=' . $destination;
} }
else { 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 () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -129,18 +129,18 @@ else {
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 8
- 8
system/admin/views/edit-post.html.php View File

@ -64,7 +64,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br> Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br>
<span class="help">If the url leave empty we will use the post title.</span><br><br> <span class="help">If the url leave empty we will use the post title.</span><br><br>
Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br> Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br>
Hour, Minute, Second<br><input
Hour, Minute, Second<br><input
type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br> type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) {
echo $p->description; echo $p->description;
@ -103,19 +103,19 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -145,18 +145,18 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 7
- 7
system/admin/views/edit-profile.html.php View File

@ -66,19 +66,19 @@ if (file_exists($filename)) {
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -108,18 +108,18 @@ if (file_exists($filename)) {
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 9
- 9
system/admin/views/edit-quote.html.php View File

@ -65,7 +65,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br> Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br>
<span class="help">If the url leave empty we will use the post title.</span><br><br> <span class="help">If the url leave empty we will use the post title.</span><br><br>
Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br> Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br>
Hour, Minute, Second<br><input
Hour, Minute, Second<br><input
type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br> type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) {
echo $p->description; echo $p->description;
@ -82,7 +82,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
echo 'error'; echo 'error';
} }
} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br> } ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
<input type="hidden" name="is_quote" class="text" value="is_quote"/>
<input type="hidden" name="is_quote" class="text" value="is_quote"/>
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<?php if ($isdraft[2] == 'draft') { ?> <?php if ($isdraft[2] == 'draft') { ?>
@ -109,19 +109,19 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -151,18 +151,18 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 9
- 9
system/admin/views/edit-video.html.php View File

@ -65,7 +65,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br> Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br>
<span class="help">If the url leave empty we will use the post title.</span><br><br> <span class="help">If the url leave empty we will use the post title.</span><br><br>
Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br> Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br>
Hour, Minute, Second<br><input
Hour, Minute, Second<br><input
type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br> type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br>
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) {
echo $p->description; echo $p->description;
@ -82,7 +82,7 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
echo 'error'; echo 'error';
} }
} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br> } ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
<input type="hidden" name="is_video" class="text" value="is_video"/>
<input type="hidden" name="is_video" class="text" value="is_video"/>
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
<?php if ($isdraft[2] == 'draft') { ?> <?php if ($isdraft[2] == 'draft') { ?>
@ -109,19 +109,19 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
(function () { (function () {
var converter = new Markdown.Converter(); var converter = new Markdown.Converter();
var editor = new Markdown.Editor(converter); var editor = new Markdown.Editor(converter);
var $dialog = $('#insertImageDialog').dialog({ var $dialog = $('#insertImageDialog').dialog({
autoOpen: false, autoOpen: false,
closeOnEscape: false, closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); } open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}); });
var $url = $('input[type=text]', $dialog); var $url = $('input[type=text]', $dialog);
var $file = $('input[type=file]', $dialog); var $file = $('input[type=file]', $dialog);
var base = '<?php echo site_url() ?>'; var base = '<?php echo site_url() ?>';
editor.hooks.set('insertImageDialog', function(callback) { editor.hooks.set('insertImageDialog', function(callback) {
var dialogInsertClick = function() { var dialogInsertClick = function() {
callback($url.val().length > 0 ? $url.val(): null); callback($url.val().length > 0 ? $url.val(): null);
dialogClose(); dialogClose();
@ -151,18 +151,18 @@ $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destinat
$file.val(''); $file.val('');
} }
}; };
$file.ajaxfileupload({ $file.ajaxfileupload({
'action': '<?php echo site_url() ?>upload.php', 'action': '<?php echo site_url() ?>upload.php',
'onComplete': uploadComplete, 'onComplete': uploadComplete,
}); });
$dialog.dialog('open'); $dialog.dialog('open');
return true; // tell the editor that we'll take care of getting the image url return true; // tell the editor that we'll take care of getting the image url
}); });
editor.run(); editor.run();
})(); })();
</script> </script>

+ 1
- 1
system/admin/views/update.html.php View File

@ -15,5 +15,5 @@ if ($updater->able()) {
echo '<p><a href="' . site_url() . 'admin/update/now/' . $CSRF . '" alt="' . $info['name'] . '">Update to ' . $info['tag_name'] . '</a></p>'; echo '<p><a href="' . site_url() . 'admin/update/now/' . $CSRF . '" alt="' . $info['name'] . '">Update to ' . $info['tag_name'] . '</a></p>';
} else { } else {
echo '<h3>No Available Update</h3>'; echo '<h3>No Available Update</h3>';
echo '<p>You are using the latest HTMLy version.</p>';
echo '<p>You are using the latest HTMLy version.</p>';
} }

+ 77
- 77
system/htmly.php View File

@ -1693,8 +1693,8 @@ post('/:static/:sub/edit', function ($static, $sub) {
'postTitle' => $title, 'postTitle' => $title,
'postUrl' => $url, 'postUrl' => $url,
'postContent' => $content, 'postContent' => $content,
'static' => $static,
'sub' => $sub,
'static' => $static,
'sub' => $sub,
'bodyclass' => 'editpage', 'bodyclass' => 'editpage',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Edit page' 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Edit page'
)); ));
@ -1793,20 +1793,20 @@ get('/:year/:month/:name', function ($year, $month, $name) {
} else { } else {
$next = array(); $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( render('post', array(
'title' => $current->title . ' - ' . blog_title(), 'title' => $current->title . ' - ' . blog_title(),
@ -1843,21 +1843,21 @@ get('/:year/:month/:name/edit', function ($year, $month, $name) {
} }
$current = $post['current']; $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') { if ($user === $current->author || $role === 'admin') {
render($var, array( render($var, array(
'title' => $var .' '. blog_title(), 'title' => $var .' '. blog_title(),
@ -1889,9 +1889,9 @@ post('/:year/:month/:name/edit', function () {
$proper = is_csrf_proper(from($_REQUEST, 'csrf_token')); $proper = is_csrf_proper(from($_REQUEST, 'csrf_token'));
$title = from($_REQUEST, 'title'); $title = from($_REQUEST, 'title');
$is_post = from($_REQUEST, 'is_post');
$is_post = from($_REQUEST, 'is_post');
$image = from($_REQUEST, 'image'); $image = from($_REQUEST, 'image');
$is_image = from($_REQUEST, 'is_image');
$is_image = from($_REQUEST, 'is_image');
$video = from($_REQUEST, 'video'); $video = from($_REQUEST, 'video');
$is_video = from($_REQUEST, 'is_video'); $is_video = from($_REQUEST, 'is_video');
$link = from($_REQUEST, 'link'); $link = from($_REQUEST, 'link');
@ -1914,57 +1914,57 @@ post('/:year/:month/:name/edit', function () {
if ($date !== null && $time !== null) { if ($date !== null && $time !== null) {
$dateTime = $date . ' ' . $time; $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 ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($image)) {
if (empty($url)) { if (empty($url)) {
$url = $title; $url = $title;
} }
edit_image($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $image, $revertPost, $publishDraft); edit_image($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $image, $revertPost, $publishDraft);
} else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($video)) { } else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($video)) {
if (empty($url)) { if (empty($url)) {
$url = $title; $url = $title;
} }
edit_video($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $video, $revertPost, $publishDraft); edit_video($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $video, $revertPost, $publishDraft);
} else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($link)) { } else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($link)) {
if (empty($url)) { if (empty($url)) {
$url = $title; $url = $title;
} }
edit_link($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $link, $revertPost, $publishDraft); edit_link($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $link, $revertPost, $publishDraft);
} else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($quote)) { } else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($quote)) {
if (empty($url)) { if (empty($url)) {
$url = $title; $url = $title;
} }
edit_quote($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $quote, $revertPost, $publishDraft); edit_quote($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $quote, $revertPost, $publishDraft);
} else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($audio)) { } else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($audio)) {
if (empty($url)) { if (empty($url)) {
$url = $title; $url = $title;
} }
edit_audio($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $audio, $revertPost, $publishDraft); 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)) { } else if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($is_post)) {
if (empty($url)) { if (empty($url)) {
$url = $title; $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 { } else {
$message['error'] = ''; $message['error'] = '';
if (empty($title)) { if (empty($title)) {
@ -1980,28 +1980,28 @@ post('/:year/:month/:name/edit', function () {
$message['error'] .= '<li>CSRF Token not correct.</li>'; $message['error'] .= '<li>CSRF Token not correct.</li>';
} }
if (!empty($is_image)) {
if (empty($image)) {
$message['error'] .= '<li>Image field is required.</li>';
}
} elseif (!empty($is_video)) {
if (empty($video)) {
$message['error'] .= '<li>Video field is required.</li>';
}
} elseif (!empty($is_link)) {
if (empty($link)) {
$message['error'] .= '<li>Link field is required.</li>';
}
} elseif (!empty($is_quote)) {
if (empty($quote)) {
$message['error'] .= '<li>Quote field is required.</li>';
}
} elseif (!empty($is_audio)) {
if (empty($audio)) {
$message['error'] .= '<li>Audio field is required.</li>';
}
}
if (!empty($is_image)) {
if (empty($image)) {
$message['error'] .= '<li>Image field is required.</li>';
}
} elseif (!empty($is_video)) {
if (empty($video)) {
$message['error'] .= '<li>Video field is required.</li>';
}
} elseif (!empty($is_link)) {
if (empty($link)) {
$message['error'] .= '<li>Link field is required.</li>';
}
} elseif (!empty($is_quote)) {
if (empty($quote)) {
$message['error'] .= '<li>Quote field is required.</li>';
}
} elseif (!empty($is_audio)) {
if (empty($audio)) {
$message['error'] .= '<li>Audio field is required.</li>';
}
}
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render($var, array( render($var, array(
@ -2039,7 +2039,7 @@ get('/:year/:month/:name/delete', function ($year, $month, $name) {
if (!$post) { if (!$post) {
$post = find_draft($year, $month, $name); $post = find_draft($year, $month, $name);
if (!$post) { if (!$post) {
not_found();
not_found();
} }
} }


+ 35
- 35
system/includes/functions.php View File

@ -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->title = get_content_tag('t', $content, 'Untitled: ' . date('l jS \of F Y', $post->date));
$post->image = get_content_tag('image', $content); $post->image = get_content_tag('image', $content);
$post->video = get_youtube_id(get_content_tag('video', $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 // Get the contents and convert it to HTML
$post->body = MarkdownExtra::defaultTransform(remove_html_comments($content)); $post->body = MarkdownExtra::defaultTransform(remove_html_comments($content));
@ -404,7 +404,7 @@ function get_tag($tag, $page, $perpage, $random)
if (empty($tmp)) { if (empty($tmp)) {
not_found(); not_found();
} }
$tmp = array_unique($tmp, SORT_REGULAR); $tmp = array_unique($tmp, SORT_REGULAR);
return $tmp = get_posts($tmp, $page, $perpage); return $tmp = get_posts($tmp, $page, $perpage);
@ -490,7 +490,7 @@ function get_author($name)
if (!empty($names)) { if (!empty($names)) {
foreach ($names as $index => $v) { foreach ($names as $index => $v) {
$author = new stdClass; $author = new stdClass;
// Replaced string // Replaced string
@ -666,7 +666,7 @@ function get_related($tag, $custom = null)
$tmp[] = $post; $tmp[] = $post;
} }
} }
if (empty($custom)) { if (empty($custom)) {
$total = count($tmp); $total = count($tmp);
@ -681,15 +681,15 @@ function get_related($tag, $custom = null)
break; break;
} }
echo '</ul>'; echo '</ul>';
} else { } else {
echo '<ul><li>No related post found</li></ul>';
echo '<ul><li>No related post found</li></ul>';
} }
} else {
return $tmp;
}
} else {
return $tmp;
}
} }
// Return post count. Matching $var and $str provided. // Return post count. Matching $var and $str provided.
@ -755,20 +755,20 @@ function keyword_count($keyword)
// Return recent posts lists // Return recent posts lists
function recent_posts($custom = null, $count = null) function recent_posts($custom = null, $count = null)
{ {
if (empty($count)) { if (empty($count)) {
$count = config('recent.count'); $count = config('recent.count');
if (empty($count)) { if (empty($count)) {
$count = 5; $count = 5;
} }
} }
$posts = get_posts(null, 1, $count); $posts = get_posts(null, 1, $count);
if (!empty($custom)) {
return $posts;
if (!empty($custom)) {
return $posts;
} else { } else {
$str = '<ul>'; $str = '<ul>';
foreach ($posts as $post) { foreach ($posts as $post) {
$str .= '<li><a href="' . $post->url . '">' . $post->title . '</a></li>'; $str .= '<li><a href="' . $post->url . '">' . $post->title . '</a></li>';
@ -778,7 +778,7 @@ function recent_posts($custom = null, $count = null)
} }
$str .= '</ul>'; $str .= '</ul>';
return $str; return $str;
} }
} }
@ -826,11 +826,11 @@ function archive_list($custom = null)
$arrow = '&#9658;'; $arrow = '&#9658;';
} }
$i++; $i++;
$by_month = array_count_values($months); $by_month = array_count_values($months);
# Sort the months # Sort the months
krsort($by_month); krsort($by_month);
$script = <<<EOF $script = <<<EOF
if (this.parentNode.className.indexOf('expanded') > -1){this.parentNode.className = 'collapsed';this.innerHTML = '&#9658;';} else {this.parentNode.className = 'expanded';this.innerHTML = '&#9660;';} if (this.parentNode.className.indexOf('expanded') > -1){this.parentNode.className = 'collapsed';this.innerHTML = '&#9658;';} else {this.parentNode.className = 'expanded';this.innerHTML = '&#9660;';}
EOF; EOF;
@ -878,7 +878,7 @@ function tag_cloud($custom = null)
$tag_collection = array_count_values($tags); $tag_collection = array_count_values($tags);
ksort($tag_collection); ksort($tag_collection);
if(empty($custom)) { if(empty($custom)) {
echo '<ul class="taglist">'; echo '<ul class="taglist">';
foreach ($tag_collection as $tag => $count) { foreach ($tag_collection as $tag => $count) {
@ -886,7 +886,7 @@ function tag_cloud($custom = null)
} }
echo '</ul>'; echo '</ul>';
} else { } else {
return $tag_collection;
return $tag_collection;
} }
} }
} }
@ -945,7 +945,7 @@ function get_description($string, $char = null)
function get_teaser($text, $char = null) function get_teaser($text, $char = null)
{ {
$teaserType = config('teaser.type'); $teaserType = config('teaser.type');
if(empty($char)) { if(empty($char)) {
$char = config('teaser.char'); $char = config('teaser.char');
} }
@ -1296,11 +1296,11 @@ function get_menu($custom)
} else { } else {
$active = ''; $active = '';
} }
$subPages = get_static_sub_pages(str_replace('.md', '', $base));
$subPages = get_static_sub_pages(str_replace('.md', '', $base));
if (!empty($subPages)) { if (!empty($subPages)) {
echo '<li class="' . $class . $active .' dropdown">';
echo '<a class="dropdown-toggle" data-toggle="dropdown" href="' . $url . '">' . ucwords($title) . '<b class="caret"></b></a>';
echo '<li class="' . $class . $active .' dropdown">';
echo '<a class="dropdown-toggle" data-toggle="dropdown" href="' . $url . '">' . ucwords($title) . '<b class="caret"></b></a>';
echo '<ul class="subnav dropdown-menu" role="menu">'; echo '<ul class="subnav dropdown-menu" role="menu">';
$iSub = 0; $iSub = 0;
$countSub = count($subPages); $countSub = count($subPages);
@ -1324,9 +1324,9 @@ function get_menu($custom)
} }
echo '</ul>'; echo '</ul>';
} else { } else {
echo '<li class="' . $class . $active .'">';
echo '<a href="' . $url . '">' . ucwords($title) . '</a>';
}
echo '<li class="' . $class . $active .'">';
echo '<a href="' . $url . '">' . ucwords($title) . '</a>';
}
echo '</li>'; echo '</li>';
} }
echo '</ul>'; echo '</ul>';
@ -1345,7 +1345,7 @@ function get_menu($custom)
// Search form // Search form
function search($text = null) function search($text = null)
{ {
if(!empty($text)) {
if(!empty($text)) {
echo <<<EOF echo <<<EOF
<form id="search-form" method="get"> <form id="search-form" method="get">
<input type="text" class="search-input" name="search" value="{$text}" onfocus="if (this.value == '{$text}') {this.value = '';}" onblur="if (this.value == '') {this.value = '{$text}';}"> <input type="text" class="search-input" name="search" value="{$text}" onfocus="if (this.value == '{$text}') {this.value = '';}" onblur="if (this.value == '') {this.value = '{$text}';}">
@ -1359,7 +1359,7 @@ EOF;
<input type="submit" value="Search" class="search-button"> <input type="submit" value="Search" class="search-button">
</form> </form>
EOF; EOF;
}
}
if (isset($_GET['search'])) { if (isset($_GET['search'])) {
$url = site_url() . 'search/' . $_GET['search']; $url = site_url() . 'search/' . $_GET['search'];
header("Location: $url"); header("Location: $url");
@ -1874,7 +1874,7 @@ function toolbar()
$base = site_url(); $base = site_url();
echo <<<EOF echo <<<EOF
<link href="{$base}themes/default/css/toolbar.css" rel="stylesheet" />
<link href="{$base}themes/default/css/toolbar.css" rel="stylesheet" />
EOF; EOF;
echo '<div id="toolbar"><ul>'; echo '<div id="toolbar"><ul>';
echo '<li><a href="' . $base . 'admin">Admin</a></li>'; echo '<li><a href="' . $base . 'admin">Admin</a></li>';


+ 6
- 6
themes/clean/main.html.php View File

@ -24,7 +24,7 @@
<a href="<?php echo $p->url ?>#comments"><span><fb:comments-count href=<?php echo $p->url ?>></fb:comments-count> Comments</span></a> <a href="<?php echo $p->url ?>#comments"><span><fb:comments-count href=<?php echo $p->url ?>></fb:comments-count> Comments</span></a>
<?php } ?> <?php } ?>
</div> </div>
<?php if (!empty($p->image)) { ?>
<?php if (!empty($p->image)) { ?>
<div class="featured-image"> <div class="featured-image">
<a href="<?php echo $p->url ?>"><img src="<?php echo $p->image; ?>" alt="<?php echo $p->title ?>"/></a> <a href="<?php echo $p->url ?>"><img src="<?php echo $p->image; ?>" alt="<?php echo $p->title ?>"/></a>
</div> </div>
@ -34,11 +34,11 @@
<iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" frameborder="0" allowfullscreen></iframe> <iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div> </div>
<?php } ?> <?php } ?>
<?php if (!empty($p->audio)) { ?>
<div class="featured-audio">
<iframe width="560" height="315" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $p->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
</div>
<?php } ?>
<?php if (!empty($p->audio)) { ?>
<div class="featured-audio">
<iframe width="560" height="315" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $p->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
</div>
<?php } ?>
<?php if (!empty($p->quote)) { ?> <?php if (!empty($p->quote)) { ?>
<div class="featured-quote"> <div class="featured-quote">
<blockquote><?php echo $p->quote ?></blockquote> <blockquote><?php echo $p->quote ?></blockquote>


+ 25
- 25
themes/clean/post.html.php View File

@ -13,31 +13,31 @@
<span itemprop="author"><a href="<?php echo $p->authorUrl ?>"><?php echo $p->author ?></a></span> - <span itemprop="author"><a href="<?php echo $p->authorUrl ?>"><?php echo $p->author ?></a></span> -
<span><a href="<?php echo $p->url ?>" rel="permalink">Permalink</a></span> <span><a href="<?php echo $p->url ?>" rel="permalink">Permalink</a></span>
</div> </div>
<?php if (!empty($p->image)) { ?>
<div class="featured-image">
<a href="<?php echo $p->url ?>"><img src="<?php echo $p->image; ?>" alt="<?php echo $p->title ?>"/></a>
</div>
<?php } ?>
<?php if (!empty($p->video)) { ?>
<div class="featured-video">
<iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div>
<?php } ?>
<?php if (!empty($p->audio)) { ?>
<div class="featured-audio">
<iframe width="560" height="315" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $p->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
</div>
<?php } ?>
<?php if (!empty($p->quote)) { ?>
<div class="featured-quote">
<blockquote><?php echo $p->quote ?></blockquote>
</div>
<?php } ?>
<?php if (!empty($p->link)) { ?>
<div class="featured-quote">
<a href="<?php echo $p->link ?>"><?php echo $p->link ?></a>
</div>
<?php } ?>
<?php if (!empty($p->image)) { ?>
<div class="featured-image">
<a href="<?php echo $p->url ?>"><img src="<?php echo $p->image; ?>" alt="<?php echo $p->title ?>"/></a>
</div>
<?php } ?>
<?php if (!empty($p->video)) { ?>
<div class="featured-video">
<iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div>
<?php } ?>
<?php if (!empty($p->audio)) { ?>
<div class="featured-audio">
<iframe width="560" height="315" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $p->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
</div>
<?php } ?>
<?php if (!empty($p->quote)) { ?>
<div class="featured-quote">
<blockquote><?php echo $p->quote ?></blockquote>
</div>
<?php } ?>
<?php if (!empty($p->link)) { ?>
<div class="featured-quote">
<a href="<?php echo $p->link ?>"><?php echo $p->link ?></a>
</div>
<?php } ?>
<div class="post-body" itemprop="articleBody"> <div class="post-body" itemprop="articleBody">
<?php echo $p->body; ?> <?php echo $p->body; ?>
</div> </div>


+ 6
- 6
themes/default/main.html.php View File

@ -24,7 +24,7 @@
<a href="<?php echo $p->url ?>#comments"><span><fb:comments-count href=<?php echo $p->url ?>></fb:comments-count> Comments</span></a> <a href="<?php echo $p->url ?>#comments"><span><fb:comments-count href=<?php echo $p->url ?>></fb:comments-count> Comments</span></a>
<?php } ?> <?php } ?>
</div> </div>
<?php if (!empty($p->image)) { ?>
<?php if (!empty($p->image)) { ?>
<div class="featured-image"> <div class="featured-image">
<a href="<?php echo $p->url ?>"><img src="<?php echo $p->image; ?>" alt="<?php echo $p->title ?>"/></a> <a href="<?php echo $p->url ?>"><img src="<?php echo $p->image; ?>" alt="<?php echo $p->title ?>"/></a>
</div> </div>
@ -34,11 +34,11 @@
<iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" frameborder="0" allowfullscreen></iframe> <iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div> </div>
<?php } ?> <?php } ?>
<?php if (!empty($p->audio)) { ?>
<div class="featured-audio">
<iframe width="560" height="315" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $p->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
</div>
<?php } ?>
<?php if (!empty($p->audio)) { ?>
<div class="featured-audio">
<iframe width="560" height="315" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $p->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
</div>
<?php } ?>
<?php if (!empty($p->quote)) { ?> <?php if (!empty($p->quote)) { ?>
<div class="featured-quote"> <div class="featured-quote">
<blockquote><?php echo $p->quote ?></blockquote> <blockquote><?php echo $p->quote ?></blockquote>


+ 25
- 25
themes/default/post.html.php View File

@ -13,31 +13,31 @@
<span itemprop="author"><a href="<?php echo $p->authorUrl ?>"><?php echo $p->author ?></a></span> - <span itemprop="author"><a href="<?php echo $p->authorUrl ?>"><?php echo $p->author ?></a></span> -
<span><a href="<?php echo $p->url ?>" rel="permalink">Permalink</a></span> <span><a href="<?php echo $p->url ?>" rel="permalink">Permalink</a></span>
</div> </div>
<?php if (!empty($p->image)) { ?>
<div class="featured-image">
<a href="<?php echo $p->url ?>"><img src="<?php echo $p->image; ?>" alt="<?php echo $p->title ?>"/></a>
</div>
<?php } ?>
<?php if (!empty($p->video)) { ?>
<div class="featured-video">
<iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div>
<?php } ?>
<?php if (!empty($p->audio)) { ?>
<div class="featured-audio">
<iframe width="560" height="315" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $p->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
</div>
<?php } ?>
<?php if (!empty($p->quote)) { ?>
<div class="featured-quote">
<blockquote><?php echo $p->quote ?></blockquote>
</div>
<?php } ?>
<?php if (!empty($p->link)) { ?>
<div class="featured-quote">
<a href="<?php echo $p->link ?>"><?php echo $p->link ?></a>
</div>
<?php } ?>
<?php if (!empty($p->image)) { ?>
<div class="featured-image">
<a href="<?php echo $p->url ?>"><img src="<?php echo $p->image; ?>" alt="<?php echo $p->title ?>"/></a>
</div>
<?php } ?>
<?php if (!empty($p->video)) { ?>
<div class="featured-video">
<iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div>
<?php } ?>
<?php if (!empty($p->audio)) { ?>
<div class="featured-audio">
<iframe width="560" height="315" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $p->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
</div>
<?php } ?>
<?php if (!empty($p->quote)) { ?>
<div class="featured-quote">
<blockquote><?php echo $p->quote ?></blockquote>
</div>
<?php } ?>
<?php if (!empty($p->link)) { ?>
<div class="featured-quote">
<a href="<?php echo $p->link ?>"><?php echo $p->link ?></a>
</div>
<?php } ?>
<div class="post-body" itemprop="articleBody"> <div class="post-body" itemprop="articleBody">
<?php echo $p->body; ?> <?php echo $p->body; ?>
</div> </div>


+ 1
- 1
themes/logs/layout.html.php View File

@ -63,7 +63,7 @@
</div> </div>
<?php if (disqus()): ?> <?php if (disqus()): ?>
<div class="comments"> <div class="comments">
<h3>Comments</h3>
<h3>Comments</h3>
<?php echo recent_comments() ?> <?php echo recent_comments() ?>
<style>li.dsq-widget-item {border-bottom: 1px solid #ebebeb;margin:0;margin-bottom:10px;padding:0;padding-bottom:10px;}a.dsq-widget-user {font-weight:normal;}img.dsq-widget-avatar {margin-right:10px; }.dsq-widget-comment {display:block;padding-top:5px;}.dsq-widget-comment p {display:block;margin:0;}p.dsq-widget-meta {padding-top:5px;margin:0;}#dsq-combo-widget.grey #dsq-combo-content .dsq-combo-box {background: transparent;}#dsq-combo-widget.grey #dsq-combo-tabs li {background: none repeat scroll 0 0 #DDDDDD;}</style> <style>li.dsq-widget-item {border-bottom: 1px solid #ebebeb;margin:0;margin-bottom:10px;padding:0;padding-bottom:10px;}a.dsq-widget-user {font-weight:normal;}img.dsq-widget-avatar {margin-right:10px; }.dsq-widget-comment {display:block;padding-top:5px;}.dsq-widget-comment p {display:block;margin:0;}p.dsq-widget-meta {padding-top:5px;margin:0;}#dsq-combo-widget.grey #dsq-combo-content .dsq-combo-box {background: transparent;}#dsq-combo-widget.grey #dsq-combo-tabs li {background: none repeat scroll 0 0 #DDDDDD;}</style>
</div> </div>


+ 1
- 1
themes/logs/main.html.php View File

@ -24,7 +24,7 @@
<a href="<?php echo $p->url ?>#comments"><span><fb:comments-count href=<?php echo $p->url ?>></fb:comments-count> Comments</span></a> <a href="<?php echo $p->url ?>#comments"><span><fb:comments-count href=<?php echo $p->url ?>></fb:comments-count> Comments</span></a>
<?php } ?> <?php } ?>
</div> </div>
<?php if (!empty($p->image)) { ?>
<?php if (!empty($p->image)) { ?>
<div class="featured-image"> <div class="featured-image">
<a href="<?php echo $p->url ?>"><img src="<?php echo $p->image; ?>" alt="<?php echo $p->title ?>"/></a> <a href="<?php echo $p->url ?>"><img src="<?php echo $p->image; ?>" alt="<?php echo $p->title ?>"/></a>
</div> </div>


+ 27
- 27
themes/logs/post.html.php View File

@ -13,31 +13,31 @@
<span itemprop="author"><a href="<?php echo $p->authorUrl ?>"><?php echo $p->author ?></a></span> - <span itemprop="author"><a href="<?php echo $p->authorUrl ?>"><?php echo $p->author ?></a></span> -
<span><a href="<?php echo $p->url ?>" rel="permalink">Permalink</a></span> <span><a href="<?php echo $p->url ?>" rel="permalink">Permalink</a></span>
</div> </div>
<?php if (!empty($p->image)) { ?>
<div class="featured-image">
<a href="<?php echo $p->url ?>"><img src="<?php echo $p->image; ?>" alt="<?php echo $p->title ?>"/></a>
</div>
<?php } ?>
<?php if (!empty($p->video)) { ?>
<div class="featured-video">
<iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div>
<?php } ?>
<?php if (!empty($p->audio)) { ?>
<div class="featured-audio">
<iframe width="560" height="315" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $p->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
</div>
<?php } ?>
<?php if (!empty($p->quote)) { ?>
<div class="featured-quote">
<blockquote><?php echo $p->quote ?></blockquote>
</div>
<?php } ?>
<?php if (!empty($p->link)) { ?>
<div class="featured-quote">
<a href="<?php echo $p->link ?>"><?php echo $p->link ?></a>
</div>
<?php } ?>
<?php if (!empty($p->image)) { ?>
<div class="featured-image">
<a href="<?php echo $p->url ?>"><img src="<?php echo $p->image; ?>" alt="<?php echo $p->title ?>"/></a>
</div>
<?php } ?>
<?php if (!empty($p->video)) { ?>
<div class="featured-video">
<iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" frameborder="0" allowfullscreen></iframe>
</div>
<?php } ?>
<?php if (!empty($p->audio)) { ?>
<div class="featured-audio">
<iframe width="560" height="315" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $p->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
</div>
<?php } ?>
<?php if (!empty($p->quote)) { ?>
<div class="featured-quote">
<blockquote><?php echo $p->quote ?></blockquote>
</div>
<?php } ?>
<?php if (!empty($p->link)) { ?>
<div class="featured-quote">
<a href="<?php echo $p->link ?>"><?php echo $p->link ?></a>
</div>
<?php } ?>
<div class="post-body" itemprop="articleBody"> <div class="post-body" itemprop="articleBody">
<?php echo $p->body; ?> <?php echo $p->body; ?>
</div> </div>
@ -47,8 +47,8 @@
<div class="author-info"> <div class="author-info">
<h4>By <strong><?php echo $author->name ?></strong></h4> <h4>By <strong><?php echo $author->name ?></strong></h4>
<?php echo $author->about ?> <?php echo $author->about ?>
</div>
<div class="share">
</div>
<div class="share">
<h4>Share this post</h4> <h4>Share this post</h4>
<a class="twitter" target="_blank" <a class="twitter" target="_blank"
href="https://twitter.com/share?url=<?php echo $p->url ?>&text=<?php echo $p->title ?>">Twitter</a> href="https://twitter.com/share?url=<?php echo $p->url ?>&text=<?php echo $p->title ?>">Twitter</a>


Loading…
Cancel
Save