mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-25 10:18:41 +00:00
c49b69aa86
Let's welcome brand new look made by Bootstrap 4! Not only website but also our logo is being flat now. The new logo uses blue as main color, to be different from original. For us, it also shows the project has up to a new stage. We hope that the project will get better and better. BREAKING CHANGE: The path for users to place their images is renamed. Logos are saved as new names too. Users should move "pictures" to "images". Any modifications should suit the Bootstrap 4's standard.
54 lines
2.3 KiB
PHP
54 lines
2.3 KiB
PHP
<?php
|
|
if ($is_preview) {
|
|
$readmore_pos = strpos($blog['content'], '<!-- readmore -->');
|
|
if ($readmore_pos !== false) {
|
|
$content = substr($blog['content'], 0, $readmore_pos).'<p><a href="'.HTML::blog_url(UOJContext::userid(), '/post/'.$blog['id']).'">阅读更多……</a></p>';
|
|
} else {
|
|
$content = $blog['content'];
|
|
}
|
|
} else {
|
|
$content = $blog['content'];
|
|
}
|
|
|
|
$extra_text = $blog['is_hidden'] ? '<span class="text-muted">[已隐藏]</span> ' : '';
|
|
|
|
$blog_type = $blog['type'] == 'B' ? 'post' : 'slide';
|
|
?>
|
|
<h2><?= $extra_text ?><a class="header-a" href="<?= HTML::blog_url(UOJContext::userid(), '/post/'.$blog['id']) ?>"><?= $blog['title'] ?></a></h2>
|
|
<div><?= $blog['post_time'] ?> <strong>By</strong> <?= getUserLink($blog['poster']) ?></div>
|
|
<?php if (!$show_title_only): ?>
|
|
<div class="card mb-4">
|
|
<div class="card-body">
|
|
<?php if ($blog_type == 'post'): ?>
|
|
<article><?= $content ?></article>
|
|
<?php elseif ($blog_type == 'slide'): ?>
|
|
<article>
|
|
<div class="embed-responsive embed-responsive-16by9">
|
|
<iframe class="embed-responsive-item" src="<?= HTML::blog_url(UOJContext::userid(), '/slide/'.$blog['id']) ?>"></iframe>
|
|
</div>
|
|
<div class="text-right top-buffer-sm">
|
|
<a class="btn btn-secondary btn-md" href="<?= HTML::blog_url(UOJContext::userid(), '/slide/'.$blog['id']) ?>"><span class="glyphicon glyphicon-fullscreen"></span> 全屏</a>
|
|
</div>
|
|
</article>
|
|
<?php endif ?>
|
|
</div>
|
|
<div class="card-footer text-right">
|
|
<ul class="list-inline bot-buffer-no">
|
|
<li class="list-inline-item">
|
|
<?php foreach (queryBlogTags($blog['id']) as $tag): ?>
|
|
<?php echoBlogTag($tag) ?>
|
|
<?php endforeach ?>
|
|
</li>
|
|
<?php if ($is_preview): ?>
|
|
<li class="list-inline-item"><a href="<?= HTML::blog_url(UOJContext::userid(), '/post/'.$blog['id']) ?>">阅读全文</a></li>
|
|
<?php endif ?>
|
|
<?php if (Auth::check() && (isSuperUser(Auth::user()) || Auth::id() == $blog['poster'])): ?>
|
|
<li class="list-inline-item"><a href="<?=HTML::blog_url(UOJContext::userid(), '/'.$blog_type.'/'.$blog['id'].'/write')?>">修改</a></li>
|
|
<li class="list-inline-item"><a href="<?=HTML::blog_url(UOJContext::userid(), '/post/'.$blog['id'].'/delete')?>">删除</a></li>
|
|
<?php endif ?>
|
|
<li class="list-inline-item"><?= getClickZanBlock('B', $blog['id'], $blog['zan']) ?></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<?php endif ?>
|