Skip to content

Commit d90797e

Browse files
committed
Blog Date Finished
1 parent 041fde0 commit d90797e

5 files changed

Lines changed: 29 additions & 11 deletions

File tree

admin/admin-pages/post.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<div class="col-lg-9 col-sm-10 textarea">
2323
<textarea name="<?=$key?>" class="form-control editor"><?php if(isset($postInfo[$key])) { print $postInfo[$key]; } ?></textarea>
2424
</div>
25-
<?php } else if ($key == 'title' || $key == 'author' || $key == 'keywords' || $key == 'description' || $key == 'image-alt-text' || $key == 'link-text') { ?>
25+
<?php } else if ($key == 'title' || $key == 'author' || $key == 'keywords' || $key == 'description' || $key == 'image-alt-text' || $key == 'link-text' || $key == 'date') { ?>
2626
<div class="col-lg-9 col-sm-10">
2727
<input name="<?=$key?>" class="form-control" value="<?php if(isset($postInfo[$key])) { print $postInfo[$key]; } ?>" autocomplete="off">
2828
</div>
@@ -34,11 +34,6 @@
3434
<input type="file" name="<?=$key?>" id="<?=$key?>" style="display: none;" onchange="readURL(this, '<?=$key?>');">
3535
<button type="button" class="btn btn-info btn-block upload-button dirtyOK" data-trigger="<?=$key?>">Upload Image</button>
3636
</div>
37-
<?php } else if ($key == 'date') { ?>
38-
<div class="col-lg-6 col-sm-6">
39-
</div>
40-
<div class="col-lg-6 col-sm-6">
41-
</div>
4237
<?php } ?>
4338
</div>
4439
<?php } ?>

admin/system/functions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ function processBlog($files) {
692692
mkdir($blogFolder);
693693
}
694694

695-
$blogArr = Array('post-page' => null,'types' => Array('title' => false, 'keywords' => false, 'description' => false, 'author' => false, 'image' => false, 'image-alt-text' => false, 'short-blog' => false, 'full-blog' => false, 'link-text' => false, 'date' => false), 'posts' => Array());
695+
$blogArr = Array('post-page' => null,'types' => Array('title' => false, 'keywords' => false, 'description' => false, 'author' => false, 'date' => false, 'image' => false, 'image-alt-text' => false, 'short-blog' => false, 'full-blog' => false, 'link-text' => false), 'posts' => Array());
696696

697697
foreach ($files as $file) {
698698
$fileData = file_get_contents('../' . $file, true);
@@ -713,7 +713,7 @@ function processBlog($files) {
713713
}
714714
$blog->class = str_replace('auto-blog-head', '', $blog->class);
715715
} else if (strpos($blog->class, 'auto-blog-list') !== false) {
716-
foreach($html->find('.auto-blog-list .auto-blog-title, .auto-blog-list .auto-blog-bg-img, .auto-blog-list .auto-blog-img, .auto-blog-list .auto-blog-short, .auto-blog-list .auto-blog-full, .auto-blog-list .auto-blog-link') as $list) {
716+
foreach($html->find('.auto-blog-list .auto-blog-title, .auto-blog-list .auto-blog-date, .auto-blog-list .auto-blog-bg-img, .auto-blog-list .auto-blog-img, .auto-blog-list .auto-blog-short, .auto-blog-list .auto-blog-full, .auto-blog-list .auto-blog-link') as $list) {
717717
if (strpos($list->class, 'auto-blog-title') !== false) {
718718
$list->innertext = '<?=getBlog("title", "$x")?>';
719719
$list->class = str_replace('auto-blog-title', '', $list->class);
@@ -737,7 +737,7 @@ function processBlog($files) {
737737
$list->class = str_replace('auto-blog-full', '', $list->class);
738738
$blogArr['types']['full'] = true;
739739
} else if (strpos($list->class, 'auto-blog-date') !== false) {
740-
$list->innertext = '<?=getBlog("full-date", "$x")?>';
740+
$list->innertext = '<?=getBlog("date", "$x")?>';
741741
$list->class = str_replace('auto-blog-date', '', $list->class);
742742
$blogArr['types']['date'] = true;
743743
} else if (strpos($list->class, 'auto-blog-link') !== false) {
@@ -757,7 +757,7 @@ function processBlog($files) {
757757

758758
} else if (strpos($blog->class, 'auto-blog-post') !== false) {
759759
$blogArr['post-page'] = str_replace(Array('.html', '.htm'), '', $file);
760-
foreach($html->find('.auto-blog-post .auto-blog-title, .auto-blog-post .auto-blog-bg-img, .auto-blog-post .auto-blog-img, .auto-blog-post .auto-blog-short, .auto-blog-post .auto-blog-full') as $post) {
760+
foreach($html->find('.auto-blog-post .auto-blog-title, .auto-blog-post .auto-blog-date, .auto-blog-post .auto-blog-bg-img, .auto-blog-post .auto-blog-img, .auto-blog-post .auto-blog-short, .auto-blog-post .auto-blog-full') as $post) {
761761
if (strpos($post->class, 'auto-blog-title') !== false) {
762762
$post->innertext = '<?=getBlog("title")?>';
763763
$post->class = str_replace('auto-blog-title', '', $post->class);
@@ -781,7 +781,7 @@ function processBlog($files) {
781781
$post->class = str_replace('auto-blog-full', '', $post->class);
782782
$blogArr['types']['full-blog'] = true;
783783
} else if (strpos($post->class, 'auto-blog-date') !== false) {
784-
$post->innertext = '<?=getBlog("full-date", "$x")?>';
784+
$post->innertext = '<?=getBlog("date")?>';
785785
$post->class = str_replace('auto-blog-date', '', $post->class);
786786
$blogArr['types']['date'] = true;
787787
}

testing/blog.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
<div class="auto-blog-list">
2323
<h1 class="auto-blog-title"></h1>
24+
<div class="auto-blog-date"></div>
2425
<img class="auto-blog-img small-img">
2526
<div class="auto-blog-short"></div>
2627
<br><br>

testing/error.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head class="auto-head">
4+
<title>Test content management</title>
5+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6+
<meta name="keywords" content="">
7+
<meta name="description" content="">
8+
<meta name="author" content="">
9+
</head>
10+
<body>
11+
<nav>
12+
<a href="/" class="auto-nav" autocms="withTags navigation">Home</a> | <a href="blog.html" class="auto-nav" autocms="withoutTags navigation">Blog</a>
13+
</nav>
14+
<br><br>
15+
<div class="auto-edit">404 Error</div>
16+
17+
<div class="auto-footer">
18+
<div class="auto-edit-text" autocms="footer copyright">&copy; auto-CMS.com</div>
19+
</div>
20+
</body>
21+
</html>

testing/post.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
<div class="auto-blog-post">
2323
<div class="auto-blog-title"></div>
24+
<div class="auto-blog-date"></div>
2425
<div class="auto-blog-bg-img small-bg"></div>
2526
<div class="auto-blog-full"></div>
2627
</div>

0 commit comments

Comments
 (0)