feat(forum): guest cash purchase for topic and plate follow

- Reuse pay_no_logged_in / pay_cookie_day; generalized guest cookie helpers
- Topic + plate cash: guest preview/purchase (no balance), order.user_id=0, cookie unlock
- View gates: can_view_topic pay + plate follow accept signed guest cookies
- Templates: guest buy/follow CTAs; poll endpoint allows plate_follow guest orders
This commit is contained in:
kate522 committed 2026-07-15 13:58:54 +08:00
1 parent a9150862ef
commit 6b6314b033
9 files changed
+274 -70

No files matched your search

@@ -209,6 +209,13 @@ trait AKSRT_Forum_Board_Service_Part_2 {
}
if ($user_id <= 0) {
// Guest cash follow unlock via signed cookie (money follow pay only).
if ($allow_view === 'follow'
&& function_exists('aksrt_guest_has_plate_follow_access')
&& aksrt_guest_has_plate_follow_access($plate_id)
) {
return true;
}
return false;
}
@@ -282,9 +289,13 @@ trait AKSRT_Forum_Board_Service_Part_2 {
* Check if a user is following a plate (§7.2 关注).
*/
public function is_user_following_plate(int $user_id, int $plate_id): bool {
if ($user_id <= 0) {
if ($plate_id <= 0) {
return false;
}
if ($user_id <= 0) {
return function_exists('aksrt_guest_has_plate_follow_access')
&& aksrt_guest_has_plate_follow_access($plate_id);
}
$follow_list = get_user_meta($user_id, 'aksrt_follow_plate', true);
if (!is_array($follow_list)) {
return false;