szurubooru/src/Views/index-index.phtml
Marcin Kurczewski 5607cfc353 Models rewrite; removed RedBeanPHP; misc changes
Pages load 1.5-2x faster
Exception trace in JSON is now represented as an array
Fixed pagination of default favorites page in user pages
Fixed thumbnail size validation for non-square thumbnails
2013-12-18 15:17:49 +01:00

50 lines
1.6 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">
<?php $this->context->imageLink = \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->featuredPost->id]) ?>
<?php $this->context->transport->post = $this->context->featuredPost ?>
<?php echo $this->renderFile('post-file-render') ?>
</div>
<div class="footer">
<div class="left">
Tags:&nbsp;
<ul class="tags">
<?php $tags = $this->context->featuredPost->getTags() ?>
<?php uasort($tags, function($a, $b) { return strnatcasecmp($a->name, $b->name); }) ?>
<?php foreach ($tags 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 ?>