From d11fef003238eb329a65f2ce55cd5a6674b64b29 Mon Sep 17 00:00:00 2001 From: Git Manager GUI Date: Wed, 29 Apr 2026 16:41:51 +0200 Subject: [PATCH] Upload via Git Manager GUI --- wp-ingame-shop/wp-ingame-shop-pro.php | 98 ++++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 11 deletions(-) diff --git a/wp-ingame-shop/wp-ingame-shop-pro.php b/wp-ingame-shop/wp-ingame-shop-pro.php index ad42174..d0a94ce 100644 --- a/wp-ingame-shop/wp-ingame-shop-pro.php +++ b/wp-ingame-shop/wp-ingame-shop-pro.php @@ -1135,6 +1135,12 @@ class WIS_Admin { $resolved_item_id = 'rank_' . $rank_id . '_' . $lp_group . '_' . $default_group . '_' . $rank_days; } elseif ($item_type === 'fly_abo') { $resolved_item_id = 'fly_abo'; + } elseif ($item_type === 'plot_slots') { + $plot_extra_slots = max(1, intval($_POST['plot_extra_slots'] ?? 1)); + $resolved_item_id = 'plot_slots_' . $plot_extra_slots; + } elseif ($item_type === 'plot_abo') { + $plot_abo_slots = max(1, intval($_POST['plot_abo_slots'] ?? 1)); + $resolved_item_id = 'plot_abo_' . $plot_abo_slots; } else { $resolved_item_id = sanitize_text_field($_POST['item_id'] ?? ''); } @@ -1159,7 +1165,7 @@ class WIS_Admin { 'sell_enabled' => isset($_POST['sell_enabled']) ? 1 : 0, 'sell_price_mode' => in_array($_POST['sell_price_mode'] ?? '', ['percent','fixed','minus']) ? $_POST['sell_price_mode'] : 'percent', 'sell_price_value' => max(0, intval($_POST['sell_price_value'] ?? 80)), - 'status' => (intval($_POST['price'] ?? 0) > 0 || $item_type === 'fly' || $item_type === 'rank' || $item_type === 'fly_abo') ? 'publish' : 'draft', + 'status' => (intval($_POST['price'] ?? 0) > 0 || $item_type === 'fly' || $item_type === 'rank' || $item_type === 'fly_abo' || $item_type === 'plot_slots' || $item_type === 'plot_abo') ? 'publish' : 'draft', ]; if (isset($_GET['edit'])) { @@ -1857,23 +1863,29 @@ class WIS_Admin { // Fallback für altes Format rank_{rank_id}_{days} $is_rank_old = !$is_rank && $item && preg_match('/^rank_(.+)_(\d+)$/', $item->item_id, $rm_old); $is_fly_abo = $item && ($item->item_id === 'fly_abo' || preg_match('/^fly_abo_\d+$/', $item->item_id)); - $cur_abo_days = 0; // nicht mehr relevant + $cur_abo_days = 0; + $is_plot_slots = $item && preg_match('/^plot_slots_(\d+)$/', $item->item_id, $ps_m); + $cur_plot_extra_slots = $is_plot_slots ? intval($ps_m[1]) : 1; + $is_plot_abo = $item && preg_match('/^plot_abo_(\d+)$/', $item->item_id, $pa_m); + $cur_plot_abo_slots = $is_plot_abo ? intval($pa_m[1]) : 1; $cur_rank_id = $is_rank ? $rm[1] : ($is_rank_old ? $rm_old[1] : 'vip'); $cur_lp_group = $is_rank ? $rm[2] : $cur_rank_id; $cur_default_group = $is_rank ? $rm[3] : 'default'; $cur_rank_days = $is_rank ? intval($rm[4]) : ($is_rank_old ? intval($rm_old[2]) : 30); $cur_label = $item ? esc_attr($item->name) : ''; - $detected_type = $is_fly ? 'fly' : (($is_rank || $is_rank_old) ? 'rank' : ($is_fly_abo ? 'fly_abo' : 'minecraft')); + $detected_type = $is_fly ? 'fly' : (($is_rank || $is_rank_old) ? 'rank' : ($is_fly_abo ? 'fly_abo' : ($is_plot_slots ? 'plot_slots' : ($is_plot_abo ? 'plot_abo' : 'minecraft')))); ?>
- +

Z.B.: minecraft:diamond (Kategorien werden automatisch zugewiesen)

@@ -1933,16 +1945,59 @@ class WIS_Admin {

+ + + + @@ -2262,6 +2317,10 @@ class WIS_Admin { echo '👑 ' . esc_html($rm2[1]) . ' — ' . ($rd === 0 ? 'dauerhaft' : esc_html($rd) . ' Tage') . ''; } elseif ($item->item_id === 'fly_abo' || preg_match('/^fly_abo_/', $item->item_id)) { echo '✈ Fly-Abo — monatlich'; + } elseif (preg_match('/^plot_slots_(\d+)$/', $item->item_id, $plt_m)) { + echo '📦 Plot-Slots — +' . esc_html($plt_m[1]) . ' permanent'; + } elseif (preg_match('/^plot_abo_(\d+)$/', $item->item_id, $plt_m)) { + echo '📦 Plot-Abo — +' . esc_html($plt_m[1]) . ' monatlich'; } else { echo '' . esc_html($item->item_id) . ''; } @@ -3568,12 +3627,29 @@ class WIS_API { $title_parts[] = $item['qty'] . 'x ' . $item['title']; } elseif (preg_match('/^fly_abo$/', $item_id) || preg_match('/^fly_abo_\d*$/', $item_id)) { // Fly-Abo: monatlich abonniert, Preis = Monatsbeitrag - // qty > 1 wird ignoriert (nur 1 Abo pro Spieler möglich, Mehrfachkauf = keine Wirkung) $commands_payload[] = [ 'type' => 'fly_abo', 'label' => $item['title'], ]; $title_parts[] = $item['title']; + } elseif (preg_match('/^plot_slots_(\d+)$/', $item_id, $ps_m)) { + // Plot-Slots: einmaliger permanenter Kauf + $extra_slots = intval($ps_m[1]) * intval($item['qty']); + $commands_payload[] = [ + 'type' => 'plot_slots', + 'slots' => $extra_slots, + 'label' => $item['title'], + ]; + $title_parts[] = $item['qty'] . 'x ' . $item['title']; + } elseif (preg_match('/^plot_abo_(\d+)$/', $item_id, $pa_m)) { + // Plot-Abo: monatliche Abbuchung, Preis = Monatsbeitrag + $abo_slots = intval($pa_m[1]); + $commands_payload[] = [ + 'type' => 'plot_abo', + 'slots' => $abo_slots, + 'label' => $item['title'], + ]; + $title_parts[] = $item['title']; } else { // Normales Item $items_payload[] = [