diff --git a/system/admin/admin.php b/system/admin/admin.php
index e4af206..7646c69 100644
--- a/system/admin/admin.php
+++ b/system/admin/admin.php
@@ -818,9 +818,9 @@ function migrate($title, $time, $tags, $content, $url, $user, $source)
$post_tagmd = rtrim($post_tagmd, ',');
$post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url)));
if (!empty($source)) {
- $post_content = '' . "\n" . '' . "\n\n" . $content . "\n\n" . 'Source: ' . $title . '';
+ $post_content = '' . "\n" . '' . "\n\n" . $content . "\n\n" . 'Source: ' . $title . '';
} else {
- $post_content = '' . "\n" . '' . "\n\n" . $content;
+ $post_content = '' . "\n" . '' . "\n\n" . $content;
}
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) {
diff --git a/system/admin/views/edit-content.html.php b/system/admin/views/edit-content.html.php
index 2def7b2..4b2bab9 100644
--- a/system/admin/views/edit-content.html.php
+++ b/system/admin/views/edit-content.html.php
@@ -43,7 +43,7 @@ $cat = explode('/', $replaced);
if ($cat[count($cat) - 2] === 'scheduled') {
$category = $cat[count($cat) - 4];
} else {
-$category = $cat[count($cat) - 3];
+$category = $cat[count($cat) - 3];
}
$dt = str_replace($replaced, '', $oldurl[0]);
@@ -65,7 +65,11 @@ $tagslang = "content/data/tags.lang";
if (file_exists($tagslang)) {
$ptags = unserialize(file_get_contents($tagslang));
$tkey = array_keys($tags);
- $newlang = array_intersect_key($ptags, array_flip($tkey));
+ if (!empty($ptags)) {
+ $newlang = array_intersect_key($ptags, array_flip($tkey));
+ } else {
+ $newlang = array_combine($tkey, $tkey);
+ }
$tmp = serialize($newlang);
file_put_contents($tagslang, print_r($tmp, true));
}
@@ -132,143 +136,143 @@ $( function() {
diff --git a/system/includes/functions.php b/system/includes/functions.php
index 4b47b95..9dd6c4e 100644
--- a/system/includes/functions.php
+++ b/system/includes/functions.php
@@ -283,7 +283,7 @@ function get_posts($posts, $page = 1, $perpage = 0)
// Author string
$str = explode('/', $replaced);
$author = $str[1];
-
+
if($str[3] == 'uncategorized') {
$category = default_category();
$post->category = '' . $category->title . '';
@@ -303,7 +303,7 @@ function get_posts($posts, $page = 1, $perpage = 0)
}
}
-
+
$type = $str[4];
$post->ct = $str[3];
@@ -328,6 +328,7 @@ function get_posts($posts, $page = 1, $perpage = 0)
// The post date
$post->date = strtotime($timestamp);
+ $post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($filepath)));
// The archive per day
$post->archive = site_url() . 'archive/' . date('Y-m', $post->date);
@@ -360,7 +361,11 @@ function get_posts($posts, $page = 1, $perpage = 0)
if(!empty($tagt)) {
$tl = explode(',', rtrim($tagt, ','));
- $tCom = array_combine($t, $tl);
+ if (count($tl) == count($t)) {
+ $tCom = array_combine($t, $tl);
+ } else {
+ $tCom = array_combine($t, $t);
+ }
foreach ($tCom as $key => $val) {
if(!empty($val)) {
$tag[] = array($val, site_url() . 'tag/' . strtolower($key));
@@ -875,8 +880,8 @@ function get_author($name)
if ($name === $profile) {
// Profile URL
$url= pathinfo($v, PATHINFO_BASENAME);
-
- $author->file = $url;
+
+ $author->file = $url;
$author->url = site_url() . 'author/' . $profile;
@@ -934,11 +939,12 @@ function get_static_post($static)
// The static page URL
$url= pathinfo($v, PATHINFO_FILENAME);
-
+
$post->url = site_url() . $url;
$post->file = $v;
-
+ $post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($v)));
+
$post->md = $url;
// Get the contents and convert it to HTML
@@ -989,10 +995,11 @@ function get_static_sub_post($static, $sub_static)
$post->url = site_url() . $static . "/" . $url;
$post->file = $v;
-
- $post->md = $url;
-
- $post->parent = $static;
+ $post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($v)));
+
+ $post->md = $url;
+
+ $post->parent = $static;
// Get the contents and convert it to HTML
$content = file_get_contents($v);
@@ -1140,7 +1147,7 @@ function get_categorycount($var)
if (stripos($v['dirname'], '/' . $var . '/') !== false) {
$tmp[] = $v;
}
-
+
}
return count($tmp);
@@ -1158,7 +1165,7 @@ function get_typecount($var)
if (stripos($v['dirname'], '/' . $var) !== false) {
$tmp[] = $v;
}
-
+
}
return count($tmp);
@@ -1177,7 +1184,7 @@ function get_draftcount($var)
if (stripos($v['dirname'], '/' . $var . '/') !== false) {
$tmp[] = $v;
}
-
+
}
return count($tmp);
}
@@ -1194,11 +1201,11 @@ function get_scheduledcount($var)
if (stripos($v['dirname'], '/' . $var . '/') !== false) {
$tmp[] = $v;
}
-
+
}
-
+
return count($tmp);
-
+
}
// Return tag count. Matching $var and $str provided.
@@ -1368,7 +1375,7 @@ function popular_posts($custom = null, $count = null)
if ($i++ >= $count)
break;
}
-
+
}
}
@@ -1450,7 +1457,7 @@ function archive_list($custom = null)
foreach ($posts as $index => $v) {
$arr = explode('_', pathinfo($v, PATHINFO_FILENAME));
-
+
$date = $arr[0];
$data = explode('-', $date);
$col[] = $data;