2016-07-18 16:39:37 +00:00
|
|
|
<?php
|
|
|
|
if ($is_preview) {
|
|
|
|
$readmore_pos = strpos($blog['content'], '<!-- readmore -->');
|
|
|
|
if ($readmore_pos !== false) {
|
style(web): change link location of blog functions
When using sub-directory blog, the 'blogof' not looks so good.
And, there are duplicate 'blog' characters, which making people uncomfortable.
So, for sub-directory blog, use 'blog' instead of 'blogof'.
'blog' is not as a sub folder or type anymore, use 'post' instead.
BREAKING CHANGE: Due to the conflict of 'blog' sub-directory, when go to blog post,
now should use 'blogs/{id}'; but when subdomain mode is on, you can still use 'blog'
to access these blog posts. 'blogof' is no longer used, and you need to inform users
that blog link is changed, to avoid the inaccessbility.
2019-07-12 04:13:30 +00:00
|
|
|
$content = substr($blog['content'], 0, $readmore_pos).'<p><a href="'.HTML::blog_url(UOJContext::userid(), '/post/'.$blog['id']).'">阅读更多……</a></p>';
|
2016-07-18 16:39:37 +00:00
|
|
|
} else {
|
|
|
|
$content = $blog['content'];
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$content = $blog['content'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$extra_text = $blog['is_hidden'] ? '<span class="text-muted">[已隐藏]</span> ' : '';
|
|
|
|
|
style(web): change link location of blog functions
When using sub-directory blog, the 'blogof' not looks so good.
And, there are duplicate 'blog' characters, which making people uncomfortable.
So, for sub-directory blog, use 'blog' instead of 'blogof'.
'blog' is not as a sub folder or type anymore, use 'post' instead.
BREAKING CHANGE: Due to the conflict of 'blog' sub-directory, when go to blog post,
now should use 'blogs/{id}'; but when subdomain mode is on, you can still use 'blog'
to access these blog posts. 'blogof' is no longer used, and you need to inform users
that blog link is changed, to avoid the inaccessbility.
2019-07-12 04:13:30 +00:00
|
|
|
$blog_type = $blog['type'] == 'B' ? 'post' : 'slide';
|
2022-09-18 04:58:35 +00:00
|
|
|
?>
|
2022-09-29 14:02:56 +00:00
|
|
|
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
|
2022-09-18 12:47:21 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="<?= HTML::url('/css/markdown.css') ?>">
|
2022-09-29 14:02:56 +00:00
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<h1 class="h2">
|
|
|
|
<?= $extra_text ?>
|
|
|
|
<a class="header-a
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
text-decoration-none text-body
|
|
|
|
<?php endif ?>
|
|
|
|
" href="<?= HTML::blog_url(UOJContext::userid(), '/post/'.$blog['id']) ?>">
|
|
|
|
<?= $blog['title'] ?>
|
|
|
|
</a>
|
|
|
|
</h1>
|
|
|
|
|
2022-09-28 11:48:49 +00:00
|
|
|
<div><?= $blog['post_time'] ?> <strong>By</strong> <?= getUserLink($blog['poster']) ?> (<strong>博客 ID: </strong> <?= $blog['id'] ?>)</div>
|
2016-07-18 16:39:37 +00:00
|
|
|
<?php if (!$show_title_only): ?>
|
2019-09-10 02:15:20 +00:00
|
|
|
<div class="card mb-4">
|
|
|
|
<div class="card-body">
|
style(web): change link location of blog functions
When using sub-directory blog, the 'blogof' not looks so good.
And, there are duplicate 'blog' characters, which making people uncomfortable.
So, for sub-directory blog, use 'blog' instead of 'blogof'.
'blog' is not as a sub folder or type anymore, use 'post' instead.
BREAKING CHANGE: Due to the conflict of 'blog' sub-directory, when go to blog post,
now should use 'blogs/{id}'; but when subdomain mode is on, you can still use 'blog'
to access these blog posts. 'blogof' is no longer used, and you need to inform users
that blog link is changed, to avoid the inaccessbility.
2019-07-12 04:13:30 +00:00
|
|
|
<?php if ($blog_type == 'post'): ?>
|
2022-09-29 14:02:56 +00:00
|
|
|
|
|
|
|
<!-- content -->
|
|
|
|
<article class="markdown-body">
|
|
|
|
<?= $content ?>
|
|
|
|
</article>
|
|
|
|
<!-- content end -->
|
|
|
|
|
2016-07-18 16:39:37 +00:00
|
|
|
<?php elseif ($blog_type == 'slide'): ?>
|
|
|
|
<article>
|
2022-10-01 03:55:31 +00:00
|
|
|
<div class="
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
ratio ratio-16x9
|
|
|
|
<?php else: ?>
|
|
|
|
embed-responsive embed-responsive-16by9
|
|
|
|
<?php endif ?>
|
|
|
|
">
|
2017-11-25 04:00:00 +00:00
|
|
|
<iframe class="embed-responsive-item" src="<?= HTML::blog_url(UOJContext::userid(), '/slide/'.$blog['id']) ?>"></iframe>
|
2016-07-18 16:39:37 +00:00
|
|
|
</div>
|
2022-10-01 03:55:31 +00:00
|
|
|
<div class="
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
text-end mt-2
|
|
|
|
<?php else: ?>
|
|
|
|
text-right top-buffer-sm
|
|
|
|
<?php endif ?>">
|
|
|
|
<a class="btn btn-secondary btn-md" href="<?= HTML::blog_url(UOJContext::userid(), '/slide/'.$blog['id']) ?>">
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
<i class="bi bi-arrows-fullscreen"></i>
|
|
|
|
<?php else: ?>
|
|
|
|
<span class="glyphicon glyphicon-fullscreen"></span>
|
|
|
|
<?php endif ?>
|
|
|
|
全屏
|
|
|
|
</a>
|
2016-07-18 16:39:37 +00:00
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
<?php endif ?>
|
|
|
|
</div>
|
2022-09-29 14:02:56 +00:00
|
|
|
<div class="card-footer
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
text-end
|
|
|
|
<?php else: ?>
|
|
|
|
text-right
|
|
|
|
<?php endif ?>">
|
|
|
|
<ul class="list-inline
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
mb-0
|
|
|
|
<?php else: ?>
|
|
|
|
bot-buffer-no
|
|
|
|
<?php endif ?>">
|
2019-09-10 02:15:20 +00:00
|
|
|
<li class="list-inline-item">
|
2016-07-18 16:39:37 +00:00
|
|
|
<?php foreach (queryBlogTags($blog['id']) as $tag): ?>
|
|
|
|
<?php echoBlogTag($tag) ?>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</li>
|
|
|
|
<?php if ($is_preview): ?>
|
2022-09-29 14:02:56 +00:00
|
|
|
<li class="list-inline-item">
|
|
|
|
<a class="
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
text-decoration-none
|
|
|
|
<?php endif ?>
|
|
|
|
" href="<?= HTML::blog_url(UOJContext::userid(), '/post/'.$blog['id']) ?>">
|
|
|
|
阅读全文
|
|
|
|
</a>
|
|
|
|
</li>
|
2016-07-18 16:39:37 +00:00
|
|
|
<?php endif ?>
|
|
|
|
<?php if (Auth::check() && (isSuperUser(Auth::user()) || Auth::id() == $blog['poster'])): ?>
|
2022-09-29 14:02:56 +00:00
|
|
|
<li class="list-inline-item">
|
|
|
|
<a class="
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
text-decoration-none
|
|
|
|
<?php endif ?>
|
|
|
|
" href="<?=HTML::blog_url(UOJContext::userid(), '/'.$blog_type.'/'.$blog['id'].'/write')?>">
|
|
|
|
修改
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="list-inline-item">
|
|
|
|
<a class="
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
text-decoration-none
|
|
|
|
<?php endif ?>
|
|
|
|
" href="<?=HTML::blog_url(UOJContext::userid(), '/post/'.$blog['id'].'/delete')?>">
|
|
|
|
删除
|
|
|
|
</a>
|
|
|
|
</li>
|
2016-07-18 16:39:37 +00:00
|
|
|
<?php endif ?>
|
2019-09-10 02:15:20 +00:00
|
|
|
<li class="list-inline-item"><?= getClickZanBlock('B', $blog['id'], $blog['zan']) ?></li>
|
2016-07-18 16:39:37 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php endif ?>
|