szurubooru/src/Views/post-file-render.phtml

24 lines
878 B
PHTML
Raw Normal View History

<?php $post = $this->context->transport->post ?>
<?php if ($post->type == PostType::Image): ?>
<?php if (!empty($this->context->imageLink)): ?>
<a href="<?php echo $this->context->imageLink ?>">
<?php endif ?>
<img src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>" alt="<?php echo $post->name ?>"/>
<?php if (!empty($this->context->imageLink)): ?>
</a>
<?php endif ?>
<?php elseif ($post->type == PostType::Flash): ?>
<iframe width="<?php echo $post->imageWidth ?>" height="<?php echo $post->imageHeight ?>" src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>"> </iframe>
<?php elseif ($post->type == PostType::Youtube): ?>
<iframe style="width: 800px; height: 600px; border: 0;" src="//www.youtube.com/embed/<?php echo $post->origName ?>" allowfullscreen></iframe>
<?php endif ?>