539 lines
26 KiB
PHP
539 lines
26 KiB
PHP
<?php
|
||
/**
|
||
* 站点页脚 — Zibll template_1 shell
|
||
*
|
||
* 主内容区对齐 zibll `zib_footer_con` 契约;浮动按钮与移动端 tabbar 保留。
|
||
*
|
||
* @package AKSRT
|
||
* @version 4.1.0
|
||
*/
|
||
|
||
defined('ABSPATH') || exit;
|
||
|
||
// 数据准备
|
||
$blog_name = function_exists('aksrt_get_site_logo_text') ? aksrt_get_site_logo_text() : get_bloginfo('name');
|
||
$has_settings = class_exists('\AKSRT\Settings\Settings');
|
||
$search_placeholder = function_exists('aksrt_get_search_placeholder') ? aksrt_get_search_placeholder() : __('开启精彩搜索', 'aksrt');
|
||
$search_hot_keywords = function_exists('aksrt_get_search_hot_keywords') ? aksrt_get_search_hot_keywords() : [];
|
||
$search_history_enabled = function_exists('aksrt_search_history_enabled') ? aksrt_search_history_enabled() : true;
|
||
$search_suggest_enabled = function_exists('aksrt_search_suggestions_enabled') ? aksrt_search_suggestions_enabled() : false;
|
||
|
||
// 联系图标 / 社交链接(legacy contacts list — fallback for more icons)
|
||
$footer_contacts = $has_settings ? \AKSRT\Settings\Settings::get_footer_contacts() : [];
|
||
if (empty($footer_contacts) && function_exists('aksrt_get_about_info')) {
|
||
$about = aksrt_get_about_info();
|
||
$footer_contacts = $about['contacts'] ?? [];
|
||
}
|
||
|
||
// 友情链接 / 快速链接(仅当 fcode_t2_code_1 为空时回退)
|
||
$friend_links = function_exists('aksrt_get_friend_links') ? aksrt_get_friend_links() : [];
|
||
$quick_links = $has_settings ? \AKSRT\Settings\Settings::get_quick_links() : [];
|
||
$more_links = $has_settings ? \AKSRT\Settings\Settings::get_more_links() : [];
|
||
$hot_cat_count = $has_settings ? \AKSRT\Settings\Settings::get_hot_categories_count() : 0;
|
||
|
||
// 备案 / 版权(customize 为空时回退)
|
||
$filing = $has_settings ? \AKSRT\Settings\Settings::get_filing_settings() : ['icp_enabled' => true, 'icp_filing' => '', 'police_enabled' => true, 'police_filing' => ''];
|
||
$icp_filing = !empty($filing['icp_enabled']) ? (string) ($filing['icp_filing'] ?? '') : '';
|
||
$police_filing = !empty($filing['police_enabled']) ? (string) ($filing['police_filing'] ?? '') : '';
|
||
$footer_text = $has_settings ? \AKSRT\Settings\Settings::footer_text() : '';
|
||
$copyright_text = $has_settings ? \AKSRT\Settings\Settings::get_copyright_text() : '';
|
||
|
||
// §2.3 三列结构化字段(Zibll keys)
|
||
$footer_brand = $has_settings ? \AKSRT\Settings\Settings::get_footer_brand_settings() : ['m_s' => ['pc', 'mobile'], 'img' => '', 'img_dark' => '', 'title' => '', 'custom_code' => ''];
|
||
$footer_contact_ext = $has_settings ? \AKSRT\Settings\Settings::get_footer_contact_extended_settings() : ['m_s' => ['pc', 'mobile'], 'wechat_img' => '', 'qq' => '', 'weibo' => '', 'email' => '', 'more' => [], 'code_1' => '', 'code_2' => ''];
|
||
$footer_mini = $has_settings ? \AKSRT\Settings\Settings::get_footer_mini_img_settings() : ['m_s' => ['pc', 'mobile'], 'items' => []];
|
||
$footer_customize_code = $has_settings ? \AKSRT\Settings\Settings::get_footer_customize_code() : '';
|
||
|
||
// 设备可见性 → Zibll hidden-xs(仅在不含 mobile 时隐藏移动端)
|
||
$_brand_show_sm = in_array('mobile', (array) ($footer_brand['m_s'] ?? []), true);
|
||
$_contact_show_sm = in_array('mobile', (array) ($footer_contact_ext['m_s'] ?? []), true);
|
||
$_mini_show_sm = in_array('mobile', (array) ($footer_mini['m_s'] ?? []), true);
|
||
$_brand_xs_cls = $_brand_show_sm ? '' : ' hidden-xs';
|
||
$_contact_xs_cls = $_contact_show_sm ? '' : ' hidden-xs';
|
||
$_mini_xs_cls = $_mini_show_sm ? '' : ' hidden-xs';
|
||
|
||
/**
|
||
* 渲染快速链接 URL:支持外链 / 站内相对路径
|
||
*/
|
||
$render_link_url = static function ($raw) {
|
||
if (empty($raw)) {
|
||
return '#';
|
||
}
|
||
if (strpos((string) $raw, 'http') === 0) {
|
||
return esc_url($raw);
|
||
}
|
||
return esc_url(home_url($raw));
|
||
};
|
||
|
||
/**
|
||
* 构建 fcode-links 回退 HTML(structured links)
|
||
*/
|
||
$build_fallback_links_html = static function () use ($quick_links, $more_links, $friend_links, $hot_cat_count, $render_link_url) {
|
||
$link_bits = [];
|
||
foreach ((array) $quick_links as $ql) {
|
||
$label = $ql['name'] ?? $ql['label'] ?? '';
|
||
$url = $render_link_url($ql['url'] ?? '');
|
||
if ($label !== '') {
|
||
$link_bits[] = '<a href="' . esc_url($url) . '">' . esc_html($label) . '</a>';
|
||
}
|
||
}
|
||
foreach ((array) $more_links as $ml) {
|
||
$label = $ml['name'] ?? $ml['label'] ?? '';
|
||
$url = $render_link_url($ml['url'] ?? '');
|
||
if ($label !== '') {
|
||
$link_bits[] = '<a href="' . esc_url($url) . '">' . esc_html($label) . '</a>';
|
||
}
|
||
}
|
||
foreach ((array) $friend_links as $fl) {
|
||
$label = $fl['name'] ?? '';
|
||
$url = $fl['url'] ?? '#';
|
||
if ($label !== '') {
|
||
$link_bits[] = '<a href="' . esc_url($url) . '" target="_blank" rel="noopener noreferrer nofollow">' . esc_html($label) . '</a>';
|
||
}
|
||
}
|
||
if ($hot_cat_count > 0) {
|
||
$_hot_cache_key = 'aksrt_footer_hot_cats_' . (int) $hot_cat_count;
|
||
$_hot_cats = wp_cache_get($_hot_cache_key, 'aksrt');
|
||
if (!is_array($_hot_cats)) {
|
||
$_hot_cats = get_categories([
|
||
'orderby' => 'count',
|
||
'order' => 'DESC',
|
||
'number' => $hot_cat_count,
|
||
'hide_empty' => true,
|
||
]);
|
||
if (!is_array($_hot_cats)) {
|
||
$_hot_cats = [];
|
||
}
|
||
wp_cache_set($_hot_cache_key, $_hot_cats, 'aksrt', 12 * HOUR_IN_SECONDS);
|
||
}
|
||
foreach ($_hot_cats as $hc) {
|
||
$link_bits[] = '<a href="' . esc_url(get_category_link($hc->term_id)) . '">' . esc_html($hc->name) . '</a>';
|
||
}
|
||
}
|
||
return implode(' ', $link_bits);
|
||
};
|
||
|
||
// 品牌 / 联系 / 二维码列内容存在性
|
||
$_logo_html = '';
|
||
if (function_exists('aksrt_get_adaptive_theme_img')) {
|
||
$_logo_html = aksrt_get_adaptive_theme_img(
|
||
(string) ($footer_brand['img'] ?? ''),
|
||
(string) ($footer_brand['img_dark'] ?? ''),
|
||
$blog_name,
|
||
'style="height: 40px;"'
|
||
);
|
||
}
|
||
$_has_brand = $_logo_html !== '' || !empty($footer_brand['title']) || !empty($footer_brand['custom_code']);
|
||
|
||
$_fcode_links = trim((string) ($footer_contact_ext['code_1'] ?? ''));
|
||
if ($_fcode_links === '') {
|
||
$_fcode_links = $build_fallback_links_html();
|
||
}
|
||
$_fcode_links_is_raw = trim((string) ($footer_contact_ext['code_1'] ?? '')) !== '';
|
||
|
||
$_has_contact_icons = !empty($footer_contacts)
|
||
|| !empty($footer_contact_ext['wechat_img'])
|
||
|| !empty($footer_contact_ext['qq'])
|
||
|| !empty($footer_contact_ext['email'])
|
||
|| !empty($footer_contact_ext['more'])
|
||
|| !empty($footer_contact_ext['weibo']);
|
||
$_has_links_col = $_fcode_links !== '' || !empty($footer_contact_ext['code_2']) || $_has_contact_icons;
|
||
$_has_mini = !empty($footer_mini['items']);
|
||
$_has_cols = $_has_brand || $_has_links_col || $_has_mini;
|
||
|
||
// 底栏:customize 优先;否则回退版权/备案
|
||
$_footer_conter = trim((string) $footer_customize_code);
|
||
if ($_footer_conter === '') {
|
||
$footer_bits = [];
|
||
if ($icp_filing !== '') {
|
||
$footer_bits[] = '<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer nofollow">' . esc_html($icp_filing) . '</a>';
|
||
}
|
||
if ($police_filing !== '') {
|
||
$footer_bits[] = '<a href="https://beian.mps.gov.cn/" target="_blank" rel="noopener noreferrer nofollow">' . esc_html($police_filing) . '</a>';
|
||
}
|
||
$copy = '© ' . esc_html(gmdate('Y')) . ' ' . esc_html($blog_name) . '.';
|
||
if ($copyright_text !== '') {
|
||
$copy .= ' ' . wp_kses_post($copyright_text);
|
||
}
|
||
if ($footer_text !== '') {
|
||
$copy .= ' ' . esc_html($footer_text);
|
||
}
|
||
if (!empty($footer_bits)) {
|
||
$copy .= ' ' . implode(' · ', $footer_bits);
|
||
}
|
||
$_footer_conter = $copy;
|
||
} else {
|
||
$_footer_conter = wp_kses_post($_footer_conter);
|
||
}
|
||
?>
|
||
|
||
<?php if (is_active_sidebar('single_bottom_fluid') && is_singular('post')) : ?>
|
||
<div class="fluid-widget-wrap">
|
||
<?php dynamic_sidebar('single_bottom_fluid'); ?>
|
||
</div>
|
||
<?php endif; ?>
|
||
|
||
<?php \AKSRT\WidgetSystem\WidgetAreas::render('all_bottom_fluid', 'fluid-widget-wrap'); ?>
|
||
|
||
<footer class="footer" data-aksrt-shell="site-footer" role="contentinfo">
|
||
<?php if (is_active_sidebar('all_footer')) : ?>
|
||
<?php dynamic_sidebar('all_footer'); ?>
|
||
<?php endif; ?>
|
||
|
||
<div class="container-fluid container-footer">
|
||
<?php if ($_has_cols) : ?>
|
||
<ul class="list-inline">
|
||
<?php if ($_has_brand) : ?>
|
||
<li class="<?php echo esc_attr(trim($_brand_xs_cls)); ?>" style="max-width: 300px;">
|
||
<?php if ($_logo_html !== '') : ?>
|
||
<p>
|
||
<a class="footer-logo" href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr($blog_name); ?>">
|
||
<?php echo $_logo_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||
</a>
|
||
</p>
|
||
<?php endif; ?>
|
||
<?php if (!empty($footer_brand['title'])) : ?>
|
||
<p class="title-h-left"><?php echo esc_html($footer_brand['title']); ?></p>
|
||
<?php endif; ?>
|
||
<?php if (!empty($footer_brand['custom_code'])) : ?>
|
||
<div class="footer-muted em09"><?php echo wp_kses_post($footer_brand['custom_code']); ?></div>
|
||
<?php endif; ?>
|
||
</li>
|
||
<?php endif; ?>
|
||
|
||
<?php if ($_has_links_col) : ?>
|
||
<li style="max-width: 550px;">
|
||
<?php if ($_fcode_links !== '') : ?>
|
||
<p class="fcode-links"><?php
|
||
if ($_fcode_links_is_raw) {
|
||
echo wp_kses_post($_fcode_links);
|
||
} else {
|
||
echo $_fcode_links; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- built with esc_* above
|
||
}
|
||
?></p>
|
||
<?php endif; ?>
|
||
|
||
<?php if (!empty($footer_contact_ext['code_2'])) : ?>
|
||
<div class="footer-muted em09"><?php echo wp_kses_post($footer_contact_ext['code_2']); ?></div>
|
||
<?php endif; ?>
|
||
|
||
<?php if ($_has_contact_icons) : ?>
|
||
<div class="footer-contact mt10<?php echo esc_attr($_contact_xs_cls); ?>">
|
||
<?php if (!empty($footer_contact_ext['wechat_img'])) : ?>
|
||
<a class="toggle-radius hover-show nowave" href="javascript:;" title="<?php esc_attr_e('微信', 'aksrt'); ?>">
|
||
<i class="fab fa-weixin" aria-hidden="true"></i>
|
||
<div class="hover-show-con footer-wechat-img">
|
||
<img style="box-shadow: 0 5px 10px rgba(0,0,0,.2); border-radius:4px;" height="100" src="<?php echo esc_url($footer_contact_ext['wechat_img']); ?>" alt="<?php esc_attr_e('微信', 'aksrt'); ?>">
|
||
</div>
|
||
</a>
|
||
<?php endif; ?>
|
||
<?php if (!empty($footer_contact_ext['qq'])) : ?>
|
||
<a class="toggle-radius" target="_blank" rel="noopener noreferrer" title="<?php esc_attr_e('QQ', 'aksrt'); ?>" href="<?php echo esc_url('https://wpa.qq.com/msgrd?v=3&uin=' . rawurlencode((string) $footer_contact_ext['qq']) . '&site=qq&menu=yes'); ?>">
|
||
<i class="fab fa-qq" aria-hidden="true"></i>
|
||
</a>
|
||
<?php endif; ?>
|
||
<?php if (!empty($footer_contact_ext['weibo'])) : ?>
|
||
<a class="toggle-radius" target="_blank" rel="noopener noreferrer" title="<?php esc_attr_e('微博', 'aksrt'); ?>" href="<?php echo esc_url($footer_contact_ext['weibo']); ?>">
|
||
<i class="fab fa-weibo" aria-hidden="true"></i>
|
||
</a>
|
||
<?php endif; ?>
|
||
<?php if (!empty($footer_contact_ext['email'])) : ?>
|
||
<a class="toggle-radius" title="<?php esc_attr_e('邮箱', 'aksrt'); ?>" href="<?php echo esc_url('mailto:' . $footer_contact_ext['email']); ?>">
|
||
<i class="fas fa-envelope" aria-hidden="true"></i>
|
||
</a>
|
||
<?php endif; ?>
|
||
<?php foreach ((array) ($footer_contact_ext['more'] ?? []) as $more_item) :
|
||
if (!is_array($more_item)) {
|
||
continue;
|
||
}
|
||
$m_img = (string) ($more_item['img'] ?? '');
|
||
$m_url = (string) ($more_item['link'] ?? '');
|
||
$m_text = (string) ($more_item['desc'] ?? '');
|
||
$m_icon = (string) ($more_item['icon'] ?? '');
|
||
$m_icon_html = ($m_icon !== '' && function_exists('aksrt_brand_icon'))
|
||
? aksrt_brand_icon($m_icon)
|
||
: '';
|
||
if ($m_icon_html === '') {
|
||
$m_icon_html = '<i class="fas fa-heart" aria-hidden="true"></i>';
|
||
}
|
||
if ($m_img !== '') :
|
||
?>
|
||
<a class="toggle-radius hover-show nowave" href="javascript:;" title="<?php echo esc_attr($m_text); ?>">
|
||
<?php echo $m_icon_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||
<div class="hover-show-con footer-wechat-img">
|
||
<img style="box-shadow: 0 5px 10px rgba(0,0,0,.2); border-radius:4px;" height="100" src="<?php echo esc_url($m_img); ?>" alt="<?php echo esc_attr($m_text); ?>">
|
||
</div>
|
||
</a>
|
||
<?php elseif ($m_url !== '') : ?>
|
||
<a class="toggle-radius" target="_blank" rel="noopener noreferrer" title="<?php echo esc_attr($m_text); ?>" href="<?php echo esc_url($m_url); ?>">
|
||
<?php echo $m_icon_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||
</a>
|
||
<?php endif; ?>
|
||
<?php endforeach; ?>
|
||
<?php foreach ((array) $footer_contacts as $contact) :
|
||
$c_icon = $contact['icon'] ?? '';
|
||
$c_url = $contact['url'] ?? '#';
|
||
$c_label = $contact['title'] ?? ($contact['label'] ?? (function_exists('aksrt_icon_key_to_name') ? aksrt_icon_key_to_name($c_icon) : ''));
|
||
$c_icon_html = function_exists('aksrt_brand_icon') ? aksrt_brand_icon((string) $c_icon) : '';
|
||
if ($c_icon_html === '') {
|
||
$c_icon_html = '<i class="fas fa-globe" aria-hidden="true"></i>';
|
||
}
|
||
?>
|
||
<a class="toggle-radius" href="<?php echo esc_url($c_url); ?>" target="_blank" rel="noopener noreferrer" title="<?php echo esc_attr($c_label); ?>" aria-label="<?php echo esc_attr($c_label); ?>">
|
||
<?php echo $c_icon_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||
</a>
|
||
<?php endforeach; ?>
|
||
</div>
|
||
<?php endif; ?>
|
||
</li>
|
||
<?php endif; ?>
|
||
|
||
<?php if ($_has_mini) : ?>
|
||
<li class="<?php echo esc_attr(trim($_mini_xs_cls)); ?>">
|
||
<?php foreach ($footer_mini['items'] as $mi) :
|
||
$mi_img = (string) ($mi['img'] ?? $mi['image'] ?? '');
|
||
$mi_text = (string) ($mi['text'] ?? $mi['label'] ?? '');
|
||
if ($mi_img === '') {
|
||
continue;
|
||
}
|
||
?>
|
||
<div class="footer-miniimg"<?php echo $mi_text !== '' ? ' title="' . esc_attr($mi_text) . '"' : ''; ?>>
|
||
<p>
|
||
<img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $mi_img); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="<?php echo esc_attr($mi_text !== '' ? $mi_text : $blog_name); ?>">
|
||
</p>
|
||
<?php if ($mi_text !== '') : ?>
|
||
<span class="opacity8 em09"><?php echo esc_html($mi_text); ?></span>
|
||
<?php endif; ?>
|
||
</div>
|
||
<?php endforeach; ?>
|
||
</li>
|
||
<?php endif; ?>
|
||
</ul>
|
||
<?php endif; ?>
|
||
|
||
<?php if ($_footer_conter !== '') : ?>
|
||
<p class="footer-conter"><?php echo $_footer_conter; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
|
||
<?php endif; ?>
|
||
</div>
|
||
</footer>
|
||
|
||
|
||
<!-- 浮动右侧按钮组 -->
|
||
<?php
|
||
$floating_settings = $has_settings ? \AKSRT\Settings\Settings::get_floating_buttons_settings() : [];
|
||
$floating_items = $has_settings ? \AKSRT\Settings\Settings::get_floating_buttons_items() : [];
|
||
$aksrt_hide_chrome = is_page_template('templates/pages/page-submit.php');
|
||
$floating_enabled = !$aksrt_hide_chrome && !empty($floating_settings['enabled']) && !empty($floating_items);
|
||
$tabbar_settings = $has_settings ? \AKSRT\Settings\Settings::get_footer_tabbar_settings() : [];
|
||
$tabbar_items = $has_settings ? \AKSRT\Settings\Settings::get_footer_tabbar_items() : [];
|
||
$tabbar_enabled = !$aksrt_hide_chrome && !empty($tabbar_settings['enabled']) && !empty($tabbar_items);
|
||
$floating_classes = 'float-right';
|
||
$floating_classes .= ' ' . (!empty($floating_settings['style']) ? sanitize_html_class($floating_settings['style']) : 'round');
|
||
$floating_classes .= !empty($floating_settings['position']) && $floating_settings['position'] === 'center' ? ' position-center' : ' position-bottom';
|
||
if (!empty($floating_settings['scroll_hide'])) {
|
||
$floating_classes .= ' scrolling-hide';
|
||
}
|
||
if (!empty($floating_settings['scroll_down_hide'])) {
|
||
$floating_classes .= ' scroll-down-hide';
|
||
}
|
||
if (empty($floating_settings['shadow'])) {
|
||
$floating_classes .= ' no-shadow';
|
||
}
|
||
if (empty($floating_settings['animation'])) {
|
||
$floating_classes .= ' no-animation';
|
||
}
|
||
$float_blur = is_array($floating_settings['filter_blur'] ?? null) ? $floating_settings['filter_blur'] : [];
|
||
if (in_array('pc', $float_blur, true)) {
|
||
$floating_classes .= ' has-blur-pc';
|
||
}
|
||
if (in_array('mobile', $float_blur, true)) {
|
||
$floating_classes .= ' has-blur-mobile';
|
||
}
|
||
if ($floating_enabled) :
|
||
?>
|
||
<div id="float-right-btns" class="<?php echo esc_attr($floating_classes); ?>">
|
||
<?php foreach ($floating_items as $item) :
|
||
$item_type = $item['type'] ?? 'custom';
|
||
$item_icon = $item['icon'] ?? 'fas fa-circle';
|
||
$item_text = $item['text'] ?? '';
|
||
$item_url = $item['link'] ?? '#';
|
||
$item_target = !empty($item['new_window']) ? ' target="_blank" rel="noopener noreferrer"' : '';
|
||
$item_color = $item['color'] ?? '';
|
||
$item_bg = $item['bg'] ?? '';
|
||
$pc_show = $item['pc_s'] ?? true;
|
||
$m_show = $item['m_s'] ?? true;
|
||
|
||
$item_class = 'float-btn';
|
||
$inline_styles = [];
|
||
if ($item_color !== '') {
|
||
$inline_styles[] = '--this-color:' . esc_attr($item_color);
|
||
}
|
||
if ($item_bg !== '') {
|
||
$inline_styles[] = '--this-bg:' . esc_attr($item_bg);
|
||
}
|
||
if (!$pc_show) {
|
||
$item_class .= ' hide-on-pc';
|
||
}
|
||
if (!$m_show) {
|
||
$item_class .= ' hide-on-mobile';
|
||
}
|
||
$style_attr = $inline_styles ? ' style="' . implode(';', $inline_styles) . '"' : '';
|
||
|
||
if ($item_type === 'back_top') :
|
||
$item_class .= ' ontop';
|
||
?>
|
||
<a href="#" class="<?php echo esc_attr($item_class); ?>" id="float-back-to-top" role="button" aria-label="<?php echo esc_attr($item_text ?: __('返回顶部', 'aksrt')); ?>"<?php echo $style_attr; ?>>
|
||
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
|
||
</a>
|
||
<?php elseif ($item_type === 'theme_mode') :
|
||
$item_class .= ' theme-toggle-btn';
|
||
?>
|
||
<a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" data-action="toggle-theme" aria-label="<?php echo esc_attr($item_text ?: __('切换主题', 'aksrt')); ?>"<?php echo $style_attr; ?>>
|
||
<i class="fas fa-sun float-btn__icon-sun" aria-hidden="true"></i>
|
||
<i class="fas fa-moon float-btn__icon-moon" aria-hidden="true"></i>
|
||
</a>
|
||
<?php elseif ($item_type === 'pay_vip') :
|
||
$vip_html = function_exists('aksrt_get_float_pay_vip_html') ? aksrt_get_float_pay_vip_html($item) : '';
|
||
if ($vip_html !== '') {
|
||
echo $vip_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||
}
|
||
?>
|
||
<?php elseif ($item_type === 'service_wechat') :
|
||
$item_class .= ' service-wechat';
|
||
$wechat_img = $item['wechat_img'] ?? ($item['qrcode_img'] ?? '');
|
||
?>
|
||
<a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" aria-label="<?php echo esc_attr($item_text ?: __('微信', 'aksrt')); ?>"<?php echo $style_attr; ?>>
|
||
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
|
||
<?php if ($wechat_img) : ?>
|
||
<div class="hover-show-con">
|
||
<img src="<?php echo esc_url($wechat_img); ?>" alt="<?php esc_attr_e('微信二维码', 'aksrt'); ?>">
|
||
<?php if ($item_text !== '') : ?><p><?php echo esc_html($item_text); ?></p><?php endif; ?>
|
||
</div>
|
||
<?php endif; ?>
|
||
</a>
|
||
<?php elseif ($item_type === 'service_qq') :
|
||
$item_class .= ' service-qq';
|
||
$qq_number = $item['qq'] ?? '';
|
||
$qq_img = $item['qrcode_img'] ?? '';
|
||
?>
|
||
<a href="<?php echo $qq_number ? esc_url('https://wpa.qq.com/msgrd?v=3&uin=' . $qq_number . '&site=qq&menu=yes') : '#'; ?>" class="<?php echo esc_attr($item_class); ?>" role="button"<?php echo $qq_number ? ' target="_blank" rel="noopener noreferrer"' : ''; ?> aria-label="<?php echo esc_attr($item_text ?: 'QQ'); ?>"<?php echo $style_attr; ?>>
|
||
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
|
||
<?php if ($qq_img || $qq_number) : ?>
|
||
<div class="hover-show-con">
|
||
<?php if ($qq_img) : ?>
|
||
<img src="<?php echo esc_url($qq_img); ?>" alt="QQ">
|
||
<?php endif; ?>
|
||
<?php if ($qq_number) : ?><p>QQ: <?php echo esc_html($qq_number); ?></p><?php endif; ?>
|
||
</div>
|
||
<?php endif; ?>
|
||
</a>
|
||
<?php elseif ($item_type === 'add') :
|
||
$item_class .= ' newadd-btns';
|
||
$add_items = is_array($item['add_items'] ?? null) ? $item['add_items'] : [];
|
||
?>
|
||
<a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" aria-label="<?php echo esc_attr($item_text ?: __('发布', 'aksrt')); ?>"<?php echo $style_attr; ?>>
|
||
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
|
||
<?php if (!empty($add_items)) : ?>
|
||
<div class="hover-show-con">
|
||
<div class="float-add-menu">
|
||
<?php foreach ($add_items as $sub) :
|
||
$sub_url = $sub['url'] ?? '#';
|
||
$sub_icon = $sub['icon'] ?? 'fas fa-plus';
|
||
$sub_text = $sub['text'] ?? '';
|
||
?>
|
||
<a href="<?php echo esc_url($sub_url); ?>" class="float-add-menu__item">
|
||
<i class="<?php echo esc_attr($sub_icon); ?>" aria-hidden="true"></i>
|
||
<span><?php echo esc_html($sub_text); ?></span>
|
||
</a>
|
||
<?php endforeach; ?>
|
||
</div>
|
||
</div>
|
||
<?php endif; ?>
|
||
</a>
|
||
<?php elseif ($item_type === 'qrcode') :
|
||
$item_class .= ' qrcode-btn';
|
||
?>
|
||
<a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" aria-label="<?php echo esc_attr($item_text ?: __('二维码', 'aksrt')); ?>"<?php echo $style_attr; ?>>
|
||
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
|
||
<div class="hover-show-con">
|
||
<div
|
||
class="float-btn-qrcode"
|
||
data-qrcode-url="<?php echo esc_attr(get_permalink() ?: home_url('/')); ?>"
|
||
data-qr-text="<?php echo esc_attr(get_permalink() ?: home_url('/')); ?>"
|
||
></div>
|
||
<?php if ($item_text !== '') : ?><p class="float-btn-qrcode__title"><?php echo esc_html($item_text); ?></p><?php endif; ?>
|
||
</div>
|
||
</a>
|
||
<?php else :
|
||
$hover_html = $item['hover'] ?? '';
|
||
$hover_width = (int) ($item['hover_width'] ?? 200);
|
||
?>
|
||
<a href="<?php echo esc_url($item_url ?: '#'); ?>" class="<?php echo esc_attr($item_class); ?>"<?php echo $item_target; echo $style_attr; ?>>
|
||
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
|
||
<?php if ($hover_html !== '') : ?>
|
||
<div class="hover-show-con"<?php echo $hover_width !== 200 ? ' style="min-width:' . (int) $hover_width . 'px"' : ''; ?>>
|
||
<div class="float-right__html"><?php echo wp_kses_post($hover_html); ?></div>
|
||
</div>
|
||
<?php endif; ?>
|
||
</a>
|
||
<?php endif; ?>
|
||
<?php endforeach;
|
||
// After loop: inject missing shop cart once. Never auto-inject pay_vip
|
||
// (admin may already add one; previous in-loop inject created duplicates).
|
||
?>
|
||
</div>
|
||
<?php endif; ?>
|
||
|
||
<?php if ($tabbar_enabled) :
|
||
$tabbar_use_single_extend = function_exists('aksrt_should_use_footer_tabbar_single_extend')
|
||
&& aksrt_should_use_footer_tabbar_single_extend();
|
||
?>
|
||
<div class="footer-tabbar-placeholder" aria-hidden="true"></div>
|
||
<nav id="footer-tabbar" class="footer-tabbar<?php echo !empty($tabbar_settings['animation']) ? ' has-animation' : ''; ?><?php echo !empty($tabbar_settings['scroll_down_hide']) ? ' scroll-down-hide' : ''; ?><?php echo empty($tabbar_settings['border']) ? ' no-border' : ''; ?><?php echo empty($tabbar_settings['shadow']) ? ' no-shadow' : ''; ?><?php echo $tabbar_use_single_extend ? ' footer-tabbar--single-extend' : ''; ?>" aria-label="<?php esc_attr_e('底部导航', 'aksrt'); ?>">
|
||
<?php if ($tabbar_use_single_extend && function_exists('aksrt_render_footer_tabbar_single_extend')) :
|
||
aksrt_render_footer_tabbar_single_extend(!empty($tabbar_settings['show_text']));
|
||
else :
|
||
foreach ($tabbar_items as $tab_item) :
|
||
$tab_type = sanitize_key((string) ($tab_item['type'] ?? 'custom'));
|
||
$tab_text = (string) ($tab_item['text'] ?? '');
|
||
$tab_icon = (string) ($tab_item['icon'] ?? 'fas fa-circle');
|
||
$tab_href = home_url('/');
|
||
if ($tab_type === 'category') {
|
||
$tab_href = get_post_type_archive_link('post') ?: home_url('/');
|
||
} elseif ($tab_type === 'auth') {
|
||
$tab_href = is_user_logged_in() ? aksrt_get_user_center_url() : aksrt_get_login_url();
|
||
} elseif ($tab_type === 'search') {
|
||
$tab_href = home_url('/');
|
||
} elseif ($tab_type === 'custom' && !empty($tab_item['link'])) {
|
||
$tab_href = (string) $tab_item['link'];
|
||
} elseif ($tab_type === 'home') {
|
||
$tab_href = home_url('/');
|
||
}
|
||
?>
|
||
<a href="<?php echo esc_url($tab_href); ?>" class="tabbar-item" data-type="<?php echo esc_attr($tab_type); ?>">
|
||
<i class="<?php echo esc_attr($tab_icon); ?>" aria-hidden="true"></i>
|
||
<?php if (!empty($tabbar_settings['show_text'])) : ?><span><?php echo esc_html($tab_text); ?></span><?php endif; ?>
|
||
</a>
|
||
<?php endforeach;
|
||
endif; ?>
|
||
</nav>
|
||
<?php endif; ?>
|
||
|
||
<?php
|
||
// Global search panel (desktop header button + mobile tabbar search).
|
||
$aksrt_search_panel = AKSRT_DIR . '/templates/parts/search-panel.php';
|
||
if (is_readable($aksrt_search_panel)) {
|
||
include $aksrt_search_panel;
|
||
}
|
||
?>
|
||
|
||
<?php
|
||
// 弹窗登录/注册模板(仅未登录用户)
|
||
if (!is_user_logged_in() && file_exists(AKSRT_DIR . '/templates/parts/modal-auth.php')) {
|
||
include AKSRT_DIR . '/templates/parts/modal-auth.php';
|
||
}
|
||
?>
|
||
|
||
<?php wp_footer(); ?>
|
||
</html>
|