mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-03 11:47:51 +02:00
Blog Plugin as a part of Monstra CMS
This commit is contained in:
5
plugins/blog/views/frontend/block.view.php
Normal file
5
plugins/blog/views/frontend/block.view.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php foreach($posts as $post) { ?>
|
||||
<a href="<?php echo Option::get('siteurl'); ?><?php echo Blog::$parent_page_name; ?>/<?php echo $post['slug']; ?>"><?php echo $post['title']; ?></a> <small class="monstra-blog-date"><?php echo Date::format($post['date'], 'd M Y'); ?></small><br>
|
||||
<?php echo $post['content']; ?>
|
||||
<br><br>
|
||||
<?php } ?>
|
5
plugins/blog/views/frontend/breadcrumbs.view.php
Normal file
5
plugins/blog/views/frontend/breadcrumbs.view.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php if ($parent) { ?>
|
||||
<a href="<?php echo Site::url().$page['parent']; ?><?php if(Notification::get('tag')) { ?>?tag=<?php echo Notification::get('tag'); ?><?php } ?>"><?php echo $parent_page['title']; ?></a> <span>→</span> <a href="<?php echo Site::url().$page['parent'].'/'.$page['slug']; ?>"><?php echo $page['title']; ?></a>
|
||||
<?php } else { ?>
|
||||
<a href="<?php echo Site::url().$page['slug']; ?><?php if(Notification::get('tag')) { ?>?tag=<?php echo Notification::get('tag'); ?><?php } ?>"><?php echo $page['title']; ?></a>
|
||||
<?php } ?>
|
5
plugins/blog/views/frontend/index.view.php
Normal file
5
plugins/blog/views/frontend/index.view.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php foreach($posts as $post) { ?>
|
||||
<a href="<?php echo Option::get('siteurl'); ?><?php echo Blog::$parent_page_name; ?>/<?php echo $post['slug'] ?>"><?php echo $post['title']; ?></a> <small class="monstra-blog-date"><?php echo Date::format($post['date'], 'd M Y'); ?></small><br>
|
||||
<?php echo $post['content']; ?>
|
||||
<br><br>
|
||||
<?php } ?>
|
28
plugins/blog/views/frontend/pager.view.php
Normal file
28
plugins/blog/views/frontend/pager.view.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
if (Request::get('tag')) $tag = '&tag='.Request::get('tag'); else $tag = '';
|
||||
|
||||
$neighbours = 6;
|
||||
$left_neighbour = $page - $neighbours;
|
||||
if ($left_neighbour < 1) $left_neighbour = 1;
|
||||
|
||||
$right_neighbour = $page + $neighbours;
|
||||
if ($right_neighbour > $pages) $right_neighbour = $pages;
|
||||
|
||||
if ($page > 1) {
|
||||
echo ' <a href="?page=1'.$tag.'">'.__('begin', 'blog').'</a> ... <a href="?page=' . ($page-1) . $tag.'">'.__('prev', 'blog').'</a> ';
|
||||
}
|
||||
|
||||
for ($i=$left_neighbour; $i<=$right_neighbour; $i++) {
|
||||
if ($i != $page) {
|
||||
echo ' <a href="?page=' . $i . $tag.'">' . $i . '</a> ';
|
||||
} else {
|
||||
echo ' <b>' . $i . '</b> ';
|
||||
}
|
||||
}
|
||||
|
||||
if ($page < $pages) {
|
||||
echo ' <a href="?page=' . ($page+1) . $tag.'">'.__('next', 'blog').'</a> ... <a href="?page=' . $pages . $tag.'">'.__('end', 'blog').'</a> ';
|
||||
}
|
||||
|
||||
?>
|
7
plugins/blog/views/frontend/related_posts.view.php
Normal file
7
plugins/blog/views/frontend/related_posts.view.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<br><br>
|
||||
<b><?php echo __('Related posts', 'blog'); ?>:</b>
|
||||
<div>
|
||||
<?php foreach($related_posts as $related_post) { ?>
|
||||
<a href="<?php echo Option::get('siteurl'); ?><?php echo Blog::$parent_page_name; ?>/<?php echo $related_post['slug']; ?>"><?php echo $related_post['title']; ?></a><br>
|
||||
<?php } ?>
|
||||
</div>
|
3
plugins/blog/views/frontend/tags.view.php
Normal file
3
plugins/blog/views/frontend/tags.view.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php foreach($tags as $tag) { ?>
|
||||
<a href="<?php echo Option::get('siteurl'); ?><?php echo Blog::$parent_page_name; ?>?tag=<?php echo $tag; ?>"><span class="label label-important" data-original-title=""><?php echo $tag; ?></span></a>
|
||||
<?php } ?>
|
Reference in New Issue
Block a user