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:
1 parent
a9150862ef
commit
6b6314b033
9 files changed
+274
-70
No files matched your search
@@ -220,7 +220,8 @@ trait AKSRT_Forum_Topic_Service_Part_3 {
|
||||
|
||||
if ($visibility === AKSRT_Forum::VISIBILITY_PAY) {
|
||||
if ($viewer_user_id <= 0) {
|
||||
return false;
|
||||
return function_exists('aksrt_guest_has_paid_access')
|
||||
&& aksrt_guest_has_paid_access((int) $post->ID);
|
||||
}
|
||||
return $this->has_user_paid_topic($viewer_user_id, (int) $post->ID);
|
||||
}
|
||||
@@ -514,9 +515,12 @@ trait AKSRT_Forum_Topic_Service_Part_3 {
|
||||
* Paid access for VISIBILITY_PAY: unlock list OR paid resource order OR VIP free.
|
||||
*/
|
||||
public function has_user_paid_topic(int $user_id, int $topic_id): bool {
|
||||
if ($user_id <= 0 || $topic_id <= 0) {
|
||||
if ($topic_id <= 0) {
|
||||
return false;
|
||||
}
|
||||
if ($user_id <= 0) {
|
||||
return function_exists('aksrt_guest_has_paid_access') && aksrt_guest_has_paid_access($topic_id);
|
||||
}
|
||||
|
||||
if ($this->has_user_unlocked_topic($user_id, $topic_id)) {
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user