feat(frontend): restore the posts count badge and drop dead vipbg-v1 rules

统计行补回「文章」徽章。上一轮按「项目不做帖子」的要求把它删掉了,现在这个判断反过来了,于是恢复:位置回到参考主题的顺序(文章在最前),计数仍走 count_user_posts,图标改用全局 FA5+ 的 fa-file-alt,与其余徽章(评论 / 点赞 / 人气)保持一致。

删掉 main.css 里 .vipbg-v1 与 .vipbg-v1:before 两条死规则。全站没有任何地方使用这个类,而且 :before 里的 f006 是 FA4 码位,在 FA5 中映射不到任何字形,留着只会让人以为水印能出来。

两个契约测试里原本断言统计行不输出文章徽章,改回断言输出,并补上 fa-file-alt 的校验。

重建 main.min.css;public bundle 本次未变,因为它打包的 header-userbox.css 没有改动。573 项契约测试全部通过。
This commit is contained in:
2026-10-10 16:42:16 +08:00
parent 7e7bf6db23
commit 855e85e7db
5 changed files with 9 additions and 17 deletions
+3 -2
View File
@@ -327,8 +327,7 @@ if (!function_exists('aksrt_get_user_posts_meta_sum')) {
if (!function_exists('aksrt_get_user_badges')) {
/**
* legacy parity: 作者资料卡统计徽章行(评论 / 粉丝|点赞 / 人气值)。
* 本站不做帖子,故不输出文章徽章。
* legacy parity: 作者资料卡统计徽章行(文章 / 评论 / 粉丝|点赞 / 人气值)。
*
* @param int $user_id 用户 ID。
*/
@@ -338,6 +337,7 @@ if (!function_exists('aksrt_get_user_badges')) {
}
$home = aksrt_get_user_home_url($user_id);
$post_n = aksrt_cut_count(count_user_posts($user_id, 'post', true));
$com_n = aksrt_cut_count((int) get_comments([
'user_id' => $user_id,
'status' => 'approve',
@@ -351,6 +351,7 @@ if (!function_exists('aksrt_get_user_badges')) {
$view_n = aksrt_cut_count(aksrt_get_user_posts_meta_sum($user_id, 'aksrt_post_views'));
$html = '';
$html .= '<a class="but c-blue tag-posts" data-toggle="tooltip" title="' . esc_attr(sprintf(__('共%s篇文章', 'aksrt'), $post_n)) . '" href="' . esc_url($home) . '"><i class="fa fas fa-file-alt" aria-hidden="true"></i>' . $post_n . '</a>';
$html .= '<a class="but c-green tag-comment" data-toggle="tooltip" title="' . esc_attr(sprintf(__('共%s条评论', 'aksrt'), $com_n)) . '" href="' . esc_url($home) . '"><i class="fa fas fa-comment-dots" aria-hidden="true"></i>' . $com_n . '</a>';
if ($followed_n) {
$html .= '<a class="but c-yellow tag-follow" data-toggle="tooltip" title="' . esc_attr(sprintf(__('共%s个粉丝', 'aksrt'), $followed_n)) . '" href="' . esc_url($home) . '"><i class="fa fas fa-heart em09" aria-hidden="true"></i>' . $followed_n . '</a>';