- Updated each tier with:

Enable groups for this tier toggle.
Maximum People Per Group input.
Minimum 2, including the group owner.
This commit is contained in:
Ty Clifford
2026-06-08 16:59:53 -04:00
parent de8ec43aa4
commit 7214bb69f9
2 changed files with 22 additions and 6 deletions
+21 -5
View File
@@ -125,9 +125,8 @@ function renderAdminPlatformTab(): void {
$events = $db->query("SELECT event_type,COUNT(*) AS total FROM visitor_events
WHERE created_at>" . (time() - 2592000) . " GROUP BY event_type ORDER BY total DESC")->fetchAll();
$featureKeys = [
'voice_messages', 'recording_status', 'auto_voice_send', 'auto_voice_play', 'groups_available', 'group_member_limit',
'username_color', 'text_archive_days', 'text_export', 'voice_archive',
'voice_export', 'email_2fa',
'voice_messages', 'recording_status', 'auto_voice_send', 'auto_voice_play',
'username_color', 'text_archive_days', 'text_export', 'voice_archive', 'voice_export', 'email_2fa',
];
?>
<div class="page-head"><h1>PLANS & PLATFORM</h1>
@@ -205,11 +204,28 @@ function renderAdminPlatformTab(): void {
<div class="field"><label>Sort Order</label><input type="number" name="plans[<?= $plan['id'] ?>][sort_order]" value="<?= (int)$plan['sort_order'] ?>"></div>
</div>
<label class="cb-row"><input type="checkbox" name="plans[<?= $plan['id'] ?>][active]" <?= $plan['active'] ? 'checked' : '' ?>><span>Plan active</span></label>
<div style="border:1px solid var(--bd2);border-radius:4px;padding:12px;margin:12px 0">
<div class="panel-title" style="margin-bottom:10px">// GROUPS</div>
<div class="form-row">
<label class="cb-row" style="align-self:center;margin:0">
<input type="checkbox" name="plans[<?= $plan['id'] ?>][features][groups_available]"
<?= !empty($plan['features']['groups_available']) ? 'checked' : '' ?>>
<span><strong>Enable groups for this tier</strong></span>
</label>
<div class="field">
<label>Maximum People Per Group</label>
<input type="number" min="2" max="100" step="1"
name="plans[<?= $plan['id'] ?>][features][group_member_limit]"
value="<?= max(2, (int)($plan['features']['group_member_limit'] ?? 2)) ?>">
<div class="dim" style="margin-top:5px">Minimum 2, including the group owner. Use the toggle to disable groups; no 0 value is needed.</div>
</div>
</div>
</div>
<div class="form-row3">
<?php foreach ($featureKeys as $key): ?>
<?php if (in_array($key, ['group_member_limit','text_archive_days'], true)): ?>
<?php if ($key === 'text_archive_days'): ?>
<div class="field"><label><?= esc(adminFeatureLabel($key)) ?></label><input type="number"
min="<?= $key==='text_archive_days' ? 30 : 2 ?>"
min="30"
name="plans[<?= $plan['id'] ?>][features][<?= $key ?>]" value="<?= (int)($plan['features'][$key] ?? 0) ?>"></div>
<?php else: ?>
<label class="cb-row"><input type="checkbox" name="plans[<?= $plan['id'] ?>][features][<?= $key ?>]"