$data) { foreach (array_keys($data['profiles'] ?? []) as $p) { $all_profiles[$p] = true; } } // Sort: preferred order first, then any extras alphabetically $ordered = []; foreach ($profile_order as $p) { if (isset($all_profiles[$p])) $ordered[] = $p; } foreach (array_keys($all_profiles) as $p) { if (!in_array($p, $ordered, true)) $ordered[] = $p; } $profile_labels = [ 'basic' => 'Basic', 'home' => 'Home', 'vehicle' => 'Vehicle', 'farming' => 'Farming', 'outdoors' => 'Places', 'alltemps' => 'Temps', 'showall' => 'Show All', 'custom' => 'Custom', ]; $total_visits = array_sum(array_column($tracking, 'visits')); $profile_totals = []; foreach ($ordered as $p) { $profile_totals[$p] = array_sum(array_map(fn($d) => $d['profiles'][$p] ?? 0, $tracking)); } ?> SunScope — Stats
Usage stats
Total visits
Days tracked
clicks
No tracking data yet.
$data): ?>
Date Visits
Total
← Back to SunScope