This commit is contained in:
Baoshuo Ren 2023-02-24 15:31:11 +08:00
parent 5394bbb2f7
commit d9a913f03a
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
3 changed files with 9 additions and 13 deletions

View File

@ -25,7 +25,7 @@ function echoBlog($info) {
echo '<div>', UOJUser::getLink($poster), '</div>'; echo '<div>', UOJUser::getLink($poster), '</div>';
echo '<div class="hstack gap-2 flex-wrap small text-muted">'; echo '<div class="hstack gap-2 flex-wrap small text-muted">';
echo '<span>', '<i class="bi bi-chat-dots"></i> ', $blog->getReplyCnt(), ' </span>'; echo '<span>', '<i class="bi bi-chat-dots"></i> ', $blog->getReplyCnt(), ' </span>';
echo '<span>', '<i class="bi bi-hand-thumbs-up"></i> ', $blog->info['zan'], ' </span>'; echo '<span>', '<i class="bi bi-hand-thumbs-up"></i> ', $blog->getDisplayZanCnt(), ' </span>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';

View File

@ -122,6 +122,14 @@ class UOJBlog {
} }
} }
public function getDisplayZanCnt() {
$display_zan = $this->info['zan'] > 0 ? "+{$this->info['zan']}" : $this->info['zan'];
if ($this->info['zan'] < 0) $display_zan = '-';
return $display_zan;
}
public function queryNewestComment() { public function queryNewestComment() {
return DB::selectFirst([ return DB::selectFirst([
"select * from blogs_comments", "select * from blogs_comments",

View File

@ -619,15 +619,3 @@ form.form-horizontal {
[data-bs-theme='dark'] .uoj-username-brown { [data-bs-theme='dark'] .uoj-username-brown {
color: #996f1c; color: #996f1c;
} }
/* Dark: Table Colors */
[data-bs-theme='dark'] .table-success {
--bs-table-bg: #d1e7ddb9;
--bs-table-border-color: #bcd0c7b9;
}
[data-bs-theme='dark'] .table-warning {
--bs-table-bg: #fff3cdb9;
--bs-table-border-color: #e6dbb9b9;
}