szurubooru/src/Views/index-index.phtml
Marcin Kurczewski a5d0a3f9ef HTML validation
2013-11-18 14:00:54 +01:00

48 lines
1.5 KiB
PHTML

<div id="welcome">
<h1><?php echo $this->config->main->title ?></h1>
<p>
<span>serving <?php echo $this->context->transport->postCount ?> posts</span>
</p>
</div>
<?php if (!empty($this->context->featuredPost)): ?>
<div class="body">
<a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->featuredPost->id]) ?>">
<img title="Featured image" src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->featuredPost->name]) ?>" alt="<?php echo $this->context->featuredPost->name ?>"/>
</a>
</div>
<div class="footer">
<div class="left">
Tags:&nbsp;
<ul class="tags">
<?php foreach ($this->context->featuredPost->sharedTag as $tag): ?>
<li>
<a href="<?php echo \Chibi\UrlHelper::route('post', 'list', ['query' => $tag->name]) ?>">
<?php echo $tag->name ?>
</a>
</li>
<?php endforeach ?>
</ul>
</div>
<div class="right">
Featured&#32;
<?php if ($this->context->featuredPostUser): ?>
by <a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->featuredPostUser->name]) ?>"><?php echo $this->context->featuredPostUser->name ?></a>,&#32;
<?php endif ?>
<?php $x = round((time() - $this->context->featuredPostDate) / (24 * 3600.)) ?>
<?php if ($x == 0): ?>
today
<?php elseif ($x == 1):?>
yesterday
<?php else: ?>
<?php printf('%d days ago', $x) ?>
<?php endif ?>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<?php endif ?>