2016-07-18 16:39:37 +00:00
|
|
|
<?php
|
2022-10-08 06:10:14 +00:00
|
|
|
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
|
2022-10-06 12:28:43 +00:00
|
|
|
redirectToLogin();
|
2022-03-17 04:00:03 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 06:10:14 +00:00
|
|
|
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
|
|
|
|
become403Page();
|
|
|
|
}
|
|
|
|
|
2022-10-02 09:02:17 +00:00
|
|
|
if (!isset($_COOKIE['bootstrap4'])) {
|
|
|
|
$REQUIRE_LIB['bootstrap5'] = '';
|
|
|
|
}
|
|
|
|
|
2016-07-18 16:39:37 +00:00
|
|
|
$blogs_pag = new Paginator(array(
|
|
|
|
'col_names' => array('*'),
|
|
|
|
'table_name' => 'blogs',
|
2022-09-29 14:06:36 +00:00
|
|
|
'cond' => "poster = '".UOJContext::userid()."' and is_hidden = 0",
|
2022-10-02 09:02:17 +00:00
|
|
|
'tail' => 'order by post_time desc',
|
|
|
|
'page_len' => 5
|
2016-07-18 16:39:37 +00:00
|
|
|
));
|
2022-09-29 14:06:36 +00:00
|
|
|
|
2022-10-02 09:02:17 +00:00
|
|
|
$all_tags = DB::selectAll("select distinct tag from blogs_tags where blog_id in (select id from blogs where $blogs_cond)");
|
2022-09-29 14:06:36 +00:00
|
|
|
|
2016-07-18 16:39:37 +00:00
|
|
|
$REQUIRE_LIB['mathjax'] = '';
|
2022-09-29 14:06:36 +00:00
|
|
|
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
|
|
|
$REQUIRE_LIB['hljs'] = '';
|
|
|
|
} else {
|
|
|
|
$REQUIRE_LIB['shjs'] = '';
|
|
|
|
}
|
2022-09-18 04:58:35 +00:00
|
|
|
?>
|
2016-07-18 16:39:37 +00:00
|
|
|
<?php echoUOJPageHeader(UOJContext::user()['username'] . '的博客') ?>
|
|
|
|
|
|
|
|
<div class="row">
|
2022-10-02 09:02:17 +00:00
|
|
|
<div class="
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
col-lg-9
|
|
|
|
<?php else: ?>
|
|
|
|
col-md-9
|
|
|
|
<?php endif ?>
|
|
|
|
">
|
2016-07-18 16:39:37 +00:00
|
|
|
<?php if ($blogs_pag->isEmpty()): ?>
|
|
|
|
<div class="text-muted">此人很懒,什么博客也没留下。</div>
|
|
|
|
<?php else: ?>
|
|
|
|
<?php foreach ($blogs_pag->get() as $blog): ?>
|
|
|
|
<?php echoBlog($blog, array('is_preview' => true)) ?>
|
|
|
|
<?php endforeach ?>
|
|
|
|
<?php endif ?>
|
2022-10-02 09:02:17 +00:00
|
|
|
<div class="text-center">
|
|
|
|
<?= $blogs_pag->pagination(); ?>
|
|
|
|
</div>
|
2016-07-18 16:39:37 +00:00
|
|
|
</div>
|
2022-10-02 09:02:17 +00:00
|
|
|
<div class="
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
col-lg-3
|
|
|
|
<?php else: ?>
|
|
|
|
col-md-3
|
|
|
|
<?php endif ?>">
|
|
|
|
<img class="media-object img-thumbnail center-block" alt="<?= UOJContext::user()['username'] ?> Avatar" src="<?= HTML::avatar_addr(UOJContext::user(), 512) ?>" />
|
|
|
|
<?php if (UOJContext::hasBlogPermission()): ?>
|
|
|
|
<div class="btn-group d-flex mt-3">
|
|
|
|
<a href="<?= HTML::blog_url(UOJContext::userid(), '/post/new/write') ?>" class="btn btn-primary">
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
<i class="bi bi-pencil-square"></i>
|
|
|
|
<?php else: ?>
|
|
|
|
<span class="glyphicon glyphicon-edit"></span>
|
|
|
|
<?php endif ?>
|
|
|
|
写新博客
|
|
|
|
</a>
|
|
|
|
<a href="<?= HTML::blog_url(UOJContext::userid(), '/slide/new/write') ?>" class="btn btn-primary">
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
<i class="bi bi-file-earmark-slides"></i>
|
|
|
|
<?php else: ?>
|
|
|
|
<span class="glyphicon glyphicon-edit"></span>
|
|
|
|
<?php endif ?>
|
|
|
|
写新幻灯片
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<?php endif ?>
|
|
|
|
<div class="card border-info
|
|
|
|
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
|
|
|
mt-3
|
|
|
|
<?php else: ?>
|
|
|
|
top-buffer-sm
|
|
|
|
<?php endif ?>">
|
|
|
|
<div class="card-header bg-info">标签</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<?php if ($all_tags): ?>
|
|
|
|
<?php foreach ($all_tags as $tag): ?>
|
|
|
|
<?php echoBlogTag($tag['tag']) ?>
|
|
|
|
<?php endforeach ?>
|
|
|
|
<?php else: ?>
|
|
|
|
<div class="text-muted">暂无</div>
|
|
|
|
<?php endif ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-07-18 16:39:37 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php echoUOJPageFooter() ?>
|