fix(web/blogs): display hidden blogs

This commit is contained in:
Baoshuo Ren 2022-03-17 11:30:38 +08:00
parent a03a5063d7
commit a52b553e6d
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -3,7 +3,11 @@
function echoBlogCell($blog) { function echoBlogCell($blog) {
echo '<tr>'; echo '<tr>';
echo '<td>' . getBlogLink($blog['id']) . '</td>'; if ($blog['is_hidden']) {
echo '<td><span class="text-danger">[已隐藏]</span>' . getBlogLink($blog['id']) . '</td>';
} else {
echo '<td>' . getBlogLink($blog['id']) . '</td>';
}
echo '<td>' . getUserLink($blog['poster']) . '</td>'; echo '<td>' . getUserLink($blog['poster']) . '</td>';
echo '<td>' . $blog['post_time'] . '</td>'; echo '<td>' . $blog['post_time'] . '</td>';
echo '</tr>'; echo '</tr>';
@ -28,5 +32,5 @@ EOD;
</div> </div>
<?php endif ?> <?php endif ?>
<h3>博客总览</h3> <h3>博客总览</h3>
<?php echoLongTable(array('id', 'poster', 'title', 'post_time', 'zan'), 'blogs', 'is_hidden = 0', 'order by post_time desc', $header, 'echoBlogCell', $config); ?> <?php echoLongTable(array('id', 'poster', 'title', 'post_time', 'zan', 'is_hidden'), 'blogs', "is_hidden = 0 or poster = '{$myUser['username']}'", 'order by post_time desc', $header, 'echoBlogCell', $config); ?>
<?php echoUOJPageFooter() ?> <?php echoUOJPageFooter() ?>