refactor(assets): vendor 资产迁入标准目录并全仓去除 zibll 标识
- assets/vendor 全量迁移: fontawesome5→assets/fontawesome5, css→assets/css, js→assets/js/runtime(避开 14 个同名自有文件), img 合并去重→assets/img, fonts→assets/fonts; 删除 assets/vendor - libs 五个与 widgets/third-party 字节相同的库不重复入库, loader paths 改指向 - 运行时切换: _win.uri=assets 根, loader baseUrl=/js/runtime, enlighter 注入 路径同步; PHP 7 个引用文件切换并改名 $zibll_*→$runtime_* - 去品牌: Qinver 头注释/品牌 console.log/演示链接清除, 默认文案中性化 - 功能标识符改名: zib__→aksrt__, zib_ajax→aksrt_ajax, window.zib→ window.aksrtLegacy, zibllblock/*→aksrtblock/*, .zib-widget→.aksrt-panel, .zib-slider→.aksrt-slider, zib_menu_options meta 键等 - 自有 CSS 改名: legacy-utilities/compat-vars/footer shell - admin SPA 重建; 契约测试同步(路径/断言/文件更名) - 例外保留: tests/visual 对照环境与 fixtures 前缀(外部 Zibll 产品引用) 验证: php -l 133 个改动文件通过; runtime 86 个 JS node --check 通过; 契约测试 68/70(2 个失败经 stash 对照确认为存量问题)
This commit is contained in:
1 parent
4f2391fb64
commit
9375b1c30c
591 files changed
+1690
-11041
No files matched your search
+19
-19
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* AKSRT Pay System — 统一付费内容系统(1:1 对齐 zibll)
|
||||
* AKSRT Pay System — 统一付费内容系统(1:1 对齐 legacy)
|
||||
*
|
||||
* 核心机制:
|
||||
* - 任何 post 通过 _aksrt_pay meta 成为付费文章
|
||||
@@ -218,7 +218,7 @@ if (!function_exists('aksrt_get_download_box_meta')) {
|
||||
'view_count' => max(0, $view_count),
|
||||
'virtual_sales' => $virtual_sales,
|
||||
'sales_volume' => max(0, $sales_volume),
|
||||
// Zibll: virtual (pay_cuont) + real sales_volume; fall back to downloads when no sales yet.
|
||||
// legacy: virtual (pay_cuont) + real sales_volume; fall back to downloads when no sales yet.
|
||||
'sales_count' => $show_sales ? ($virtual_sales + max(0, $sales_volume, $download_count)) : 0,
|
||||
'show_sales' => $show_sales,
|
||||
'download_limit_over_price' => $over_price,
|
||||
@@ -276,7 +276,7 @@ if (!function_exists('aksrt_bump_content_sales_volume')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether guest cash purchase is allowed (Zibll pay_no_logged_in + pay_limit=0).
|
||||
* Whether guest cash purchase is allowed (legacy pay_no_logged_in + pay_limit=0).
|
||||
*/
|
||||
if (!function_exists('aksrt_allow_guest_content_pay')) {
|
||||
function aksrt_allow_guest_content_pay($post = null): bool {
|
||||
@@ -307,7 +307,7 @@ if (!function_exists('aksrt_allow_guest_content_pay')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Cookie lifetime days for guest paid content (Zibll pay_cookie_day).
|
||||
* Cookie lifetime days for guest paid content (legacy pay_cookie_day).
|
||||
*/
|
||||
if (!function_exists('aksrt_guest_pay_cookie_days')) {
|
||||
function aksrt_guest_pay_cookie_days(int $post_id = 0): int {
|
||||
@@ -337,7 +337,7 @@ if (!function_exists('aksrt_pay_client_ip')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Build token material for guest order cookie (zibll-style).
|
||||
* Build token material for guest order cookie (legacy-style).
|
||||
*
|
||||
* @param array<string,mixed> $order
|
||||
*/
|
||||
@@ -385,7 +385,7 @@ if (!function_exists('aksrt_set_guest_pay_cookies')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set guest paid cookies after content order paid (Zibll zibpay_posts_order_created_set_cookie).
|
||||
* Set guest paid cookies after content order paid (legacy aksrtpay_posts_order_created_set_cookie).
|
||||
*
|
||||
* @param array<string,mixed> $order
|
||||
*/
|
||||
@@ -477,7 +477,7 @@ if (!function_exists('aksrt_guest_has_paid_access')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the amount a given user should pay for a post (Zibll VIP tier min).
|
||||
* Resolve the amount a given user should pay for a post (legacy VIP tier min).
|
||||
*
|
||||
* VIP tier prices only apply when configured as a positive discount (< base).
|
||||
* Full free for VIP uses vip_free_download / exempt roles (handled separately).
|
||||
@@ -560,7 +560,7 @@ if (!function_exists('aksrt_get_user_pay_price')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether content cashier may accept coupons for this post (zibll coupon_post_s || coupon_s).
|
||||
* Whether content cashier may accept coupons for this post (legacy coupon_post_s || coupon_s).
|
||||
*/
|
||||
if (!function_exists('aksrt_is_content_coupon_allowed')) {
|
||||
function aksrt_is_content_coupon_allowed($post = null): bool {
|
||||
@@ -582,7 +582,7 @@ if (!function_exists('aksrt_is_content_coupon_allowed')) {
|
||||
|
||||
/**
|
||||
* Buyer-facing 推广折扣 amount for a post (0 if no eligible referrer).
|
||||
* Cash only; mirrors zibpay_get_post_rebate_discount.
|
||||
* Cash only; mirrors aksrtpay_get_post_rebate_discount.
|
||||
*/
|
||||
if (!function_exists('aksrt_get_post_rebate_discount')) {
|
||||
function aksrt_get_post_rebate_discount($post = null, int $user_id = 0): float {
|
||||
@@ -615,18 +615,18 @@ if (!function_exists('aksrt_get_post_rebate_discount')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether cash checkout may use points deduction (zibll points_deduction).
|
||||
* Whether cash checkout may use points deduction (legacy points_deduction).
|
||||
*
|
||||
* zibll: zibpay_is_allow_points_deduction() always returns false ("暂未启用").
|
||||
* legacy: aksrtpay_is_allow_points_deduction() always returns false ("暂未启用").
|
||||
* Keep the same contract: schema/UI may exist, runtime is hard-off unless filter overrides.
|
||||
*/
|
||||
if (!function_exists('aksrt_is_allow_points_deduction')) {
|
||||
function aksrt_is_allow_points_deduction(string $context = 'content'): bool {
|
||||
// Mirror zibll hard-off first.
|
||||
// Mirror legacy hard-off first.
|
||||
$allowed = false;
|
||||
if (class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'get_all')) {
|
||||
$all = \AKSRT\Settings\Settings::get_all();
|
||||
// Even if switch on, default remains false like zibll until product enables it.
|
||||
// Even if switch on, default remains false like legacy until product enables it.
|
||||
if (!empty($all['points_deduction_s']) && class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'credits_enabled') && \AKSRT\Settings\Settings::credits_enabled()) {
|
||||
$allowed = false; // still disabled at runtime
|
||||
}
|
||||
@@ -637,7 +637,7 @@ if (!function_exists('aksrt_is_allow_points_deduction')) {
|
||||
|
||||
/**
|
||||
* Content cashier does not accept card_pass payment_method.
|
||||
* Card-pass for balance/VIP/points is user-center redeem (zibll order types 4/8/9),
|
||||
* Card-pass for balance/VIP/points is user-center redeem (legacy order types 4/8/9),
|
||||
* not content pay types (reading/download/gallery/video).
|
||||
*/
|
||||
if (!function_exists('aksrt_is_content_card_pass_pay_allowed')) {
|
||||
@@ -848,7 +848,7 @@ if (!function_exists('aksrt_get_download_cost')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* URL of the Zibll-style single-post download page (page template + ?post=ID).
|
||||
* URL of the legacy-style single-post download page (page template + ?post=ID).
|
||||
*/
|
||||
if (!function_exists('aksrt_get_single_download_page_url')) {
|
||||
function aksrt_get_single_download_page_url($post = null): string {
|
||||
@@ -874,7 +874,7 @@ if (!function_exists('aksrt_get_single_download_page_url')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether independent download page mode is enabled (Zibll down_alone_page).
|
||||
* Whether independent download page mode is enabled (legacy down_alone_page).
|
||||
*/
|
||||
if (!function_exists('aksrt_is_download_alone_page_enabled')) {
|
||||
function aksrt_is_download_alone_page_enabled(): bool {
|
||||
@@ -993,7 +993,7 @@ if (!function_exists('aksrt_get_pay_type_badge')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Zibll zibpay_get_service() — service bullets under pay/download box.
|
||||
* legacy aksrtpay_get_service() — service bullets under pay/download box.
|
||||
*
|
||||
* @return string HTML list of service items.
|
||||
*/
|
||||
@@ -1045,7 +1045,7 @@ if (!function_exists('aksrt_get_pay_service_html')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Demo link button (Zibll zibpay_get_demo_link).
|
||||
* Demo link button (legacy aksrtpay_get_demo_link).
|
||||
*/
|
||||
if (!function_exists('aksrt_get_demo_link_html')) {
|
||||
function aksrt_get_demo_link_html($post = null, string $class = 'resource-download-box__btn btn-outline resource-download-box__btn--demo'): string {
|
||||
@@ -1072,7 +1072,7 @@ if (!function_exists('aksrt_get_demo_link_html')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Product attributes row (Zibll zibpay_get_product_attributes).
|
||||
* Product attributes row (legacy aksrtpay_get_product_attributes).
|
||||
*/
|
||||
if (!function_exists('aksrt_get_pay_attributes_html')) {
|
||||
function aksrt_get_pay_attributes_html($post = null, string $class = 'resource-download-box__attrs'): string {
|
||||
|
||||
Reference in new issue
Block a user