From d91f72491f24c5b1dcaf954501947be89509b566 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Fri, 17 Feb 2023 18:45:48 +0800 Subject: [PATCH] fix(blogs): list order --- web/app/controllers/blogs.php | 6 +++--- web/app/libs/uoj-html-lib.php | 18 ------------------ 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/web/app/controllers/blogs.php b/web/app/controllers/blogs.php index e393df7..32280ef 100644 --- a/web/app/controllers/blogs.php +++ b/web/app/controllers/blogs.php @@ -3,7 +3,7 @@ requirePHPLib('form'); Auth::check() || redirectToLogin(); -function echoBlogItem($info) { +function echoBlog($info) { $blog = new UOJBlog($info); $poster = UOJUser::query($blog->info['poster']); @@ -60,7 +60,7 @@ $pag = new Paginator([ 'table_name' => 'blogs', 'col_names' => ['id', 'poster', 'title', 'post_time', 'active_time', 'zan', 'is_hidden'], 'cond' => '1', - 'tail' => 'order by post_time desc', + 'tail' => 'order by post_time desc, id desc', 'post_filter' => function ($info) { return (new UOJBlog($info))->userCanView(Auth::user()); }, @@ -104,7 +104,7 @@ $pag = new Paginator([ get() as $idx => $row) : ?> - + diff --git a/web/app/libs/uoj-html-lib.php b/web/app/libs/uoj-html-lib.php index 7885dfb..a0aca2a 100644 --- a/web/app/libs/uoj-html-lib.php +++ b/web/app/libs/uoj-html-lib.php @@ -983,24 +983,6 @@ function echoHacksList($cond, $tail, $config, $user) { ); } -function echoBlog($blog, $config = array()) { - global $REQUIRE_LIB; - - $default_config = array( - 'blog' => $blog, - 'show_title_only' => false, - 'is_preview' => false - ); - foreach ($default_config as $key => $val) { - if (!isset($config[$key])) { - $config[$key] = $val; - } - } - - $config['REQUIRE_LIB'] = $REQUIRE_LIB; - - uojIncludeView('blog-preview', $config); -} function echoBlogTag($tag) { echo ' ', '', HTML::escape($tag), ' '; }