feat(navigation): hard-switch to Zibll navigation and Font Awesome 5
This commit is contained in:
1 parent
3c3ddac8be
commit
a0b84977a2
630 files changed
+101647
-11293
No files matched your search
+18
-32
@@ -978,15 +978,15 @@ if (!function_exists('aksrt_get_pay_type_badge')) {
|
||||
$badges = [
|
||||
AKSRT_PAY_TYPE_READING => ['label' => __('付费阅读', 'aksrt'), 'color' => '#EF4444', 'icon' => 'fa-lock'],
|
||||
AKSRT_PAY_TYPE_DOWNLOAD => ['label' => __('付费下载', 'aksrt'), 'color' => '#F97316', 'icon' => 'fa-download'],
|
||||
AKSRT_PAY_TYPE_GALLERY => ['label' => __('付费图库', 'aksrt'), 'color' => '#10B981', 'icon' => 'fa-images'],
|
||||
AKSRT_PAY_TYPE_GALLERY => ['label' => __('付费图库', 'aksrt'), 'color' => '#10B981', 'icon' => 'fa-image'],
|
||||
AKSRT_PAY_TYPE_VIDEO => ['label' => __('付费视频', 'aksrt'), 'color' => '#8B5CF6', 'icon' => 'fa-play-circle'],
|
||||
AKSRT_PAY_TYPE_VIP => ['label' => __('VIP 专属', 'aksrt'), 'color' => '#3B82F6', 'icon' => 'fa-crown'],
|
||||
AKSRT_PAY_TYPE_VIP => ['label' => __('VIP 专属', 'aksrt'), 'color' => '#3B82F6', 'icon' => 'fa-certificate'],
|
||||
];
|
||||
|
||||
if (!isset($badges[$pay_type])) return '';
|
||||
$b = $badges[$pay_type];
|
||||
return sprintf(
|
||||
'<span class="aksrt-pay-badge" style="background:%s"><i class="fas %s"></i> %s</span>',
|
||||
'<span class="aksrt-pay-badge" style="background:%s"><i class="fa %s"></i> %s</span>',
|
||||
esc_attr($b['color']), esc_attr($b['icon']), esc_html($b['label'])
|
||||
);
|
||||
}
|
||||
@@ -1008,9 +1008,9 @@ if (!function_exists('aksrt_get_pay_service_html')) {
|
||||
$items = [];
|
||||
$text = trim((string) ($service['text'] ?? ''));
|
||||
$value = trim((string) ($service['value'] ?? ''));
|
||||
$icon = trim((string) ($service['icon'] ?? 'fas fa-check-circle'));
|
||||
$icon = trim((string) ($service['icon'] ?? 'fa fas fa-check-circle'));
|
||||
if ($icon === '') {
|
||||
$icon = 'fas fa-check-circle';
|
||||
$icon = 'fa fas fa-check-circle';
|
||||
}
|
||||
|
||||
// Support multi-line pay_service textarea (one bullet per line).
|
||||
@@ -1063,7 +1063,7 @@ if (!function_exists('aksrt_get_demo_link_html')) {
|
||||
}
|
||||
$text = __('查看演示', 'aksrt');
|
||||
return sprintf(
|
||||
'<a target="_blank" rel="nofollow noopener" href="%s" class="%s"><i class="fas fa-external-link-alt" aria-hidden="true"></i><span>%s</span></a>',
|
||||
'<a target="_blank" rel="nofollow noopener" href="%s" class="%s"><i class="fa fas fa-external-link-alt" aria-hidden="true"></i><span>%s</span></a>',
|
||||
esc_url($url),
|
||||
esc_attr($class),
|
||||
esc_html($text)
|
||||
@@ -1146,7 +1146,7 @@ if (!function_exists('aksrt_get_paywall_html')) {
|
||||
|
||||
$type_labels = [
|
||||
AKSRT_PAY_TYPE_READING => ['icon' => 'fa-lock', 'label' => __('付费阅读', 'aksrt'), 'desc' => __('付费后即可查看完整内容', 'aksrt')],
|
||||
AKSRT_PAY_TYPE_GALLERY => ['icon' => 'fa-images', 'label' => __('付费图库', 'aksrt'), 'desc' => __('付费后即可查看全部图片', 'aksrt')],
|
||||
AKSRT_PAY_TYPE_GALLERY => ['icon' => 'fa-image', 'label' => __('付费图库', 'aksrt'), 'desc' => __('付费后即可查看全部图片', 'aksrt')],
|
||||
AKSRT_PAY_TYPE_VIDEO => ['icon' => 'fa-play-circle', 'label' => __('付费视频', 'aksrt'), 'desc' => __('付费后即可观看完整视频', 'aksrt')],
|
||||
];
|
||||
|
||||
@@ -1169,7 +1169,7 @@ if (!function_exists('aksrt_get_paywall_html')) {
|
||||
<div class="aksrt-paywall<?php echo $is_fragment ? ' aksrt-paywall--fragment' : ''; ?>" data-post-id="<?php echo esc_attr((string) $post->ID); ?>" data-pay-type="<?php echo esc_attr($pay_type); ?>" data-pay-modo="<?php echo esc_attr($pay_modo); ?>">
|
||||
<div class="aksrt-paywall__card" role="group" aria-label="<?php esc_attr_e('付费内容购买', 'aksrt'); ?>">
|
||||
<div class="aksrt-paywall__icon">
|
||||
<i class="fas <?php echo esc_attr($type_info['icon']); ?>" aria-hidden="true"></i>
|
||||
<i class="fa <?php echo esc_attr($type_info['icon']); ?>" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="aksrt-paywall__body">
|
||||
<h3 class="aksrt-paywall__title"><?php echo esc_html($type_info['label']); ?></h3>
|
||||
@@ -1191,25 +1191,25 @@ if (!function_exists('aksrt_get_paywall_html')) {
|
||||
<?php if (!$is_logged_in) : ?>
|
||||
<?php if ($pay_limit <= 0 && $price > 0 && $pay_modo !== 'points' && function_exists('aksrt_allow_guest_content_pay') && aksrt_allow_guest_content_pay($post)) : ?>
|
||||
<button type="button" class="but <?php echo $pay_modo === 'points' ? 'jb-yellow' : 'jb-red'; ?> padding-lg cashier-link aksrt-paywall__btn" data-aksrt-pay-content="<?php echo esc_attr((string) $post->ID); ?>">
|
||||
<i class="fa fa-shopping-cart" aria-hidden="true"></i> <?php printf(esc_html__('游客购买(%s)', 'aksrt'), $price_text); ?>
|
||||
<i class="fa fas fa-shopping-cart" aria-hidden="true"></i> <?php printf(esc_html__('游客购买(%s)', 'aksrt'), $price_text); ?>
|
||||
</button>
|
||||
<a href="<?php echo esc_url($login_url); ?>" class="aksrt-paywall__login-link"><?php esc_html_e('已有账号?登录后购买', 'aksrt'); ?></a>
|
||||
<?php else : ?>
|
||||
<a href="<?php echo esc_url($login_url); ?>" class="but jb-red padding-lg aksrt-paywall__btn">
|
||||
<i class="fa fa-sign-in" aria-hidden="true"></i> <?php esc_html_e('登录后购买', 'aksrt'); ?>
|
||||
<i class="fa fas fa-sign-in-alt" aria-hidden="true"></i> <?php esc_html_e('登录后购买', 'aksrt'); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php elseif ($member_blocked) : ?>
|
||||
<a href="<?php echo esc_url($vip_url); ?>" class="but jb-vip padding-lg aksrt-paywall__btn">
|
||||
<i class="fas fa-crown" aria-hidden="true"></i> <?php esc_html_e('开通会员后可查看', 'aksrt'); ?>
|
||||
<i class="fa fas fa-certificate" aria-hidden="true"></i> <?php esc_html_e('开通会员后可查看', 'aksrt'); ?>
|
||||
</a>
|
||||
<?php elseif ($price > 0) : ?>
|
||||
<button type="button" class="but <?php echo $pay_modo === 'points' ? 'jb-yellow' : 'jb-red'; ?> padding-lg cashier-link aksrt-paywall__btn" data-aksrt-pay-content="<?php echo esc_attr((string) $post->ID); ?>">
|
||||
<i class="fa fa-shopping-cart" aria-hidden="true"></i> <?php printf(esc_html__('立即购买(%s)', 'aksrt'), $price_text); ?>
|
||||
<i class="fa fas fa-shopping-cart" aria-hidden="true"></i> <?php printf(esc_html__('立即购买(%s)', 'aksrt'), $price_text); ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<p class="aksrt-paywall__hint">
|
||||
<i class="fas fa-shield-alt" aria-hidden="true"></i> <?php esc_html_e('购买后永久有效,支持重复查看', 'aksrt'); ?>
|
||||
<i class="fa fas fa-shield-alt" aria-hidden="true"></i> <?php esc_html_e('购买后永久有效,支持重复查看', 'aksrt'); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1239,7 +1239,7 @@ if (!function_exists('aksrt_render_paid_gallery')) {
|
||||
<div class="aksrt-paid-gallery" data-post-id="<?php echo esc_attr((string) $post->ID); ?>">
|
||||
<?php if ($has_access) : ?>
|
||||
<!-- 已付费:Swiper 轮播 -->
|
||||
<div class="swiper aksrt-paid-gallery__swiper">
|
||||
<div class="new-swiper aksrt-paid-gallery__swiper" data-loop="true">
|
||||
<div class="swiper-wrapper">
|
||||
<?php foreach ($images as $img_url) : ?>
|
||||
<div class="swiper-slide">
|
||||
@@ -1258,7 +1258,7 @@ if (!function_exists('aksrt_render_paid_gallery')) {
|
||||
<img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $images[0], 'aksrt-gallery-locked', aksrt_get_lazy_thumb('lg')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
|
||||
</div>
|
||||
<div class="aksrt-paid-gallery__overlay">
|
||||
<i class="fas fa-images" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-image" aria-hidden="true"></i>
|
||||
<p><?php
|
||||
printf(
|
||||
/* translators: %d: image count */
|
||||
@@ -1271,27 +1271,13 @@ if (!function_exists('aksrt_render_paid_gallery')) {
|
||||
<span class="aksrt-paid-gallery__price"><?php echo esc_html((string) $price_label['text']); ?></span>
|
||||
<?php endif; ?>
|
||||
<button type="button" class="but jb-red padding-lg cashier-link" data-aksrt-pay-content="<?php echo esc_attr((string) $post->ID); ?>">
|
||||
<i class="fa fa-shopping-cart" aria-hidden="true"></i> <?php esc_html_e('立即购买', 'aksrt'); ?>
|
||||
<i class="fa fas fa-shopping-cart" aria-hidden="true"></i> <?php esc_html_e('立即购买', 'aksrt'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ($has_access) : ?>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
new Swiper('.aksrt-paid-gallery__swiper', {
|
||||
loop: true,
|
||||
pagination: { el: '.swiper-pagination', clickable: true },
|
||||
navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' },
|
||||
lazy: true,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
}
|
||||
@@ -1331,7 +1317,7 @@ if (!function_exists('aksrt_render_paid_video')) {
|
||||
<!-- 未付费:锁定预览(不输出真实视频地址) -->
|
||||
<div class="aksrt-paid-video__locked">
|
||||
<div class="aksrt-paid-video__placeholder">
|
||||
<i class="fas fa-play-circle" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-play-circle" aria-hidden="true"></i>
|
||||
<p><?php esc_html_e('付费后即可观看完整视频', 'aksrt'); ?></p>
|
||||
<?php $price_label = function_exists('aksrt_get_pay_price_label') ? aksrt_get_pay_price_label($post) : ['text' => '']; ?>
|
||||
<?php if (!empty($price_label['text'])) : ?>
|
||||
@@ -1339,7 +1325,7 @@ if (!function_exists('aksrt_render_paid_video')) {
|
||||
<?php endif; ?>
|
||||
<p style="margin-top:14px;">
|
||||
<button type="button" class="but jb-red padding-lg cashier-link" data-aksrt-pay-content="<?php echo esc_attr((string) $post->ID); ?>">
|
||||
<i class="fa fa-shopping-cart" aria-hidden="true"></i> <?php esc_html_e('立即购买', 'aksrt'); ?>
|
||||
<i class="fa fas fa-shopping-cart" aria-hidden="true"></i> <?php esc_html_e('立即购买', 'aksrt'); ?>
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user