diff --git a/assets/css/frontend/widget-batch5.css b/assets/css/frontend/widget-batch5.css index 027d6884..20d5c359 100644 --- a/assets/css/frontend/widget-batch5.css +++ b/assets/css/frontend/widget-batch5.css @@ -2296,3 +2296,86 @@ a.main-color > .icon-cover-card:hover, } .tag-cloud.aksrt-tag-cloud a { transition: transform .15s ease; } .tag-cloud.aksrt-tag-cloud a:hover { transform: translateY(-1px); } + + +/* batch22-24 forum/user residual */ +.forum-posts.mini.aksrt-ftopic-mini, +.forum-posts.detail.aksrt-ftopic-detail { + display: block; + position: relative; + padding: 12px 0; + border-bottom: 1px solid var(--color-line-soft, #f0f1f3); +} +.forum-posts.mini.aksrt-ftopic-mini:last-child, +.forum-posts.detail.aksrt-ftopic-detail:last-child { border-bottom: 0; } +.forum-posts .forum-posts-header .avatar-img img, +.forum-posts .avatar-img img { + width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; +} +.forum-posts.detail .avatar-img img { width: 40px; height: 40px; } +.forum-posts .forum-title { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; } +.forum-posts .forum-title a { color: inherit; text-decoration: none; } +.forum-posts .forum-title a:hover { color: var(--theme-color, #f04494); } +.forum-posts .item-meta { gap: 2px; } +.forum-posts .forum-excerpt { line-height: 1.5; } +.forum-posts badge.img-badge { z-index: 2; } + +.plate-lists .plate-item, +.aksrt-plate-lists .plate-item { + display: flex; + gap: 12px; + align-items: flex-start; + padding: 10px 0; + border-bottom: 1px solid var(--color-line-soft, #f0f1f3); + color: inherit; + text-decoration: none; +} +.plate-lists .plate-item:last-child { border-bottom: 0; } +.plate-thumb, +.aksrt-plate-item__thumb { + width: 48px; height: 48px; border-radius: 10px; overflow: hidden; + flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; + background: var(--surface-2, #f3f4f6); color: #999; +} +.plate-thumb img, .aksrt-plate-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; } +.panel-plate.scroll-plate, +.aksrt-plate-cards { + display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; +} +.plate-card, .aksrt-plate-card { + flex: 0 0 160px; width: 160px; text-decoration: none; color: inherit; +} +.plate-card .plate-thumb, .aksrt-plate-card__cover { + width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; + background: var(--surface-2, #f3f4f6); display: flex; align-items: center; justify-content: center; +} +.plate-card .plate-thumb img, .aksrt-plate-card__cover img { width: 100%; height: 100%; object-fit: cover; } + +.moderator-box.aksrt-plate-mods__list, +.aksrt-plate-mods__list { display: flex; flex-direction: column; gap: 12px; } +.aksrt-plate-mods.style-grid .aksrt-plate-mods__list { + display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; +} +.aksrt-plate-mods__item { gap: 4px; } +.aksrt-plate-mods__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; } +.aksrt-plate-mods.style-grid .aksrt-plate-mods__item { text-align: center; } +.aksrt-plate-mods.style-grid .aksrt-plate-mods__avatar { width: 48px; height: 48px; margin: 0 auto 6px; } + +.user-ranking-box .user-ranking-item, +.aksrt-user-ranking-box .user-ranking-item { position: relative; } +.user-ranking-item .avatar-img img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: block; } +.user-ranking-item .badg { white-space: nowrap; } + +.aksrt-category-recommend__card[data-aksrt-animate] { will-change: transform, opacity; } +.aksrt-category-recommend__posts.posts-mini-wrap { margin-top: 8px; } + +.aksrt-plate-info.plate-info-sidebar { overflow: hidden; } +.aksrt-plate-info__cover.plate-thumb { + width: 100%; height: 110px; border-radius: 12px; overflow: hidden; + background: var(--surface-2, #f3f4f6); display: flex; align-items: center; justify-content: center; +} +.aksrt-plate-info__cover.plate-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; } +.aksrt-plate-info__stats.count-mates { gap: 8px; flex-wrap: wrap; } + +.aksrt-ftag-list { display: flex; flex-wrap: wrap; gap: 8px; } +.aksrt-ftag-item.is-card { min-width: 120px; justify-content: space-between; } diff --git a/src/AKSRT/Widgets/CategoryBlockWidget.php b/src/AKSRT/Widgets/CategoryBlockWidget.php index 767328f9..80f72769 100644 --- a/src/AKSRT/Widgets/CategoryBlockWidget.php +++ b/src/AKSRT/Widgets/CategoryBlockWidget.php @@ -215,25 +215,26 @@ if (!function_exists('aksrt_home_widget_render_post_grid')) { return; } - // Fallback: simple sidebar list + // Fallback: shared mini list (lazy thumbs + meta). + if (function_exists('aksrt_render_mini_list')) { + echo '
'; + aksrt_render_mini_list($query, ['context' => 'sidebar', 'show_thumb' => true]); + echo '
'; + return; + } echo ''; wp_reset_postdata(); diff --git a/src/AKSRT/Widgets/CategoryRecommendWidget.php b/src/AKSRT/Widgets/CategoryRecommendWidget.php index 7d002742..32720184 100644 --- a/src/AKSRT/Widgets/CategoryRecommendWidget.php +++ b/src/AKSRT/Widgets/CategoryRecommendWidget.php @@ -48,56 +48,82 @@ class CategoryRecommendWidget extends \WP_Widget { ob_start(); printf('
', (int) $columns); foreach ($cards as $card) { - ?> -
-
- - - - <?php echo esc_attr($card['name']); ?> - - <?php echo esc_attr($card['name']); ?> - - - - 0) : ?> - - - - - -
-
-
-

- -

- -

- -
- - - - -
-
- 0) { + $v = function_exists('aksrt_format_number') ? aksrt_format_number((int) $card['views']) : number_format_i18n((int) $card['views']); + $more = ' ' . esc_html((string) $v) . ''; + } + echo '
'; + if (function_exists('aksrt_graphic_card') && $cover !== '') { + echo aksrt_graphic_card([ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + 'type' => 'style-2', + 'class' => 'aksrt-category-recommend__hero mb10', + 'img' => $cover, + 'alt' => $name, + 'link' => ['url' => $link], + 'text1' => $name, + 'text2' => $show_description ? (string) $card['description'] : '', + 'text3' => $badge, + 'more' => $more, + 'lazy' => true, + ]); + } else { + echo '
'; + echo ''; + if ($lazy['enabled']) { + echo ''; + echo '' . esc_attr($name) . ''; + } else { + echo '' . esc_attr($name) . ''; + } + echo ''; + echo '' . esc_html($badge) . ''; + echo $more; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + echo '
'; + echo '
'; + echo '

' . esc_html($name) . '

'; + if ($show_description && $card['description'] !== '') { + echo '

' . esc_html((string) $card['description']) . '

'; + } + echo '
'; + } + echo '
'; + // Prefer shared mini list when post IDs available. + if (!empty($card['post_ids']) && function_exists('aksrt_render_mini_list')) { + $q = new \WP_Query([ + 'post_type' => 'any', + 'post__in' => array_map('intval', (array) $card['post_ids']), + 'orderby' => 'post__in', + 'posts_per_page' => count((array) $card['post_ids']), + 'ignore_sticky_posts' => true, + 'no_found_rows' => true, + ]); + echo '
'; + aksrt_render_mini_list($q, ['context' => 'widget', 'show_thumb' => true, 'show_meta' => $show_dates]); + echo '
'; + wp_reset_postdata(); + } else { + echo '
    '; + foreach ($card['posts'] as $post_item) { + echo '
  • '; + echo '' . esc_html($post_item['title']) . ''; + if ($show_dates && $post_item['date'] !== '') { + echo '' . esc_html($post_item['date']) . ''; + } + echo '
  • '; + } + echo '
'; + } + if ($show_more) { + echo ''; + } + echo '
'; } echo '
'; return (string) ob_get_clean(); diff --git a/src/AKSRT/Widgets/CategoryTabsWidget.php b/src/AKSRT/Widgets/CategoryTabsWidget.php index aa738b19..6552eacc 100644 --- a/src/AKSRT/Widgets/CategoryTabsWidget.php +++ b/src/AKSRT/Widgets/CategoryTabsWidget.php @@ -130,7 +130,7 @@ class CategoryTabsWidget extends \WP_Widget { if(showMore&&more){ html+=''; } - panel.innerHTML=html||'

暂无文章

'; + panel.innerHTML=html||'
暂无文章
'; panel.setAttribute('data-loaded','1'); panel.classList.remove('is-ajax-loading'); }).catch(function(){panel.classList.remove('is-ajax-loading');}); diff --git a/src/AKSRT/Widgets/WidgetProductTab.php b/src/AKSRT/Widgets/WidgetProductTab.php index 8bece9e6..12fb5cf9 100644 --- a/src/AKSRT/Widgets/WidgetProductTab.php +++ b/src/AKSRT/Widgets/WidgetProductTab.php @@ -49,6 +49,13 @@ class WidgetProductTab extends \WP_Widget { $paginate = sanitize_key((string) ($instance['paginate'] ?? 'ajax')); $tabs = self::parse_tabs($tabs_raw); if (!$tabs) { + if (current_user_can('manage_options')) { + echo $args['before_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + echo function_exists('aksrt_get_widget_null') + ? aksrt_get_widget_null(__('请至少配置一个 TAB', 'aksrt')) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + : '

' . esc_html__('请至少配置一个 TAB', 'aksrt') . '

'; + echo $args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } return; }