bludit/bl-themes/future-imperfect/php/home.php

87 lines
2.3 KiB
PHP
Raw Normal View History

2016-05-20 05:44:15 +02:00
<!-- For each post on this page -->
2016-01-19 04:01:08 +01:00
<?php foreach ($posts as $Post): ?>
<article class="post">
2016-05-20 05:44:15 +02:00
<!-- Show plugins, Hook: Post Begin -->
2016-01-19 04:01:08 +01:00
<?php Theme::plugins('postBegin') ?>
<!-- Post's header -->
<header>
2016-05-20 05:44:15 +02:00
<!-- Post's title and description -->
2016-01-19 04:01:08 +01:00
<div class="title">
<h2><a href="<?php echo $Post->permalink() ?>"><?php echo $Post->title() ?></a></h2>
<p><?php echo $Post->description() ?></p>
</div>
2016-05-20 05:44:15 +02:00
<!-- Post's date, author name and author avatar -->
<div class="meta">
<?php
// Post's username
$User = $Post->user();
2016-01-19 04:01:08 +01:00
if( Text::isNotEmpty($User->firstName()) || Text::isNotEmpty($User->lastName()) ) {
2016-05-20 05:44:15 +02:00
// Author = First name and Last name
2016-01-19 04:01:08 +01:00
$author = $User->firstName().' '.$User->lastName();
}
2016-05-20 05:44:15 +02:00
else {
// Author = username
$author = $User->username();
}
2016-01-19 04:01:08 +01:00
?>
<time class="published" datetime="2015-11-01"><?php echo $Post->date() ?></time>
<div class="author"><span class="name"><?php echo $author ?></span><img src="<?php echo $User->profilePicture() ?>" alt=""></div>
</div>
</header>
2016-01-21 03:42:15 +01:00
<!-- Cover Image -->
<?php
if($Post->coverImage()) {
echo '<a href="'.$Post->permalink().'" class="image featured"><img src="'.$Post->coverImage().'" alt="Cover Image"></a>';
}
?>
2016-01-19 04:01:08 +01:00
<!-- Post's content, the first part if has pagebrake -->
<?php echo $Post->content(false) ?>
<!-- Post's footer -->
<footer>
<!-- Read more button -->
<?php if($Post->readMore()) { ?>
<ul class="actions">
<li><a href="<?php echo $Post->permalink() ?>" class="button big"><?php $Language->p('Read more') ?></a></li>
</ul>
<?php } ?>
<!-- Post's tags -->
<ul class="stats">
<?php
$tags = $Post->tags(true);
foreach($tags as $tagKey=>$tagName) {
echo '<li><a href="'.HTML_PATH_ROOT.$Url->filters('tag').'/'.$tagKey.'">'.$tagName.'</a></li>';
}
?>
</ul>
</footer>
2016-05-20 05:44:15 +02:00
<!-- Show plugins, Hook: Post End -->
2016-01-19 04:01:08 +01:00
<?php Theme::plugins('postEnd') ?>
</article>
<?php endforeach; ?>
<!-- Pagination -->
<ul class="actions pagination">
<?php
if( Paginator::get('showNewer') ) {
2016-01-21 03:16:32 +01:00
echo '<li><a href="'.Paginator::urlPrevPage().'" class="button big previous">Previous Page</a></li>';
2016-01-19 04:01:08 +01:00
}
if( Paginator::get('showOlder') ) {
2016-01-21 03:16:32 +01:00
echo '<li><a href="'.Paginator::urlNextPage().'" class="button big next">Next Page</a></li>';
2016-01-19 04:01:08 +01:00
}
?>
2016-05-20 05:44:15 +02:00
</ul>