Files
Nexumi/landingpage/index.php
TheOnlyMace bda5c116fe Update legal documents and localization for compliance and clarity
- Updated .env.example with legal operator details for compliance.
- Refactored Impressum, Privacy, and Terms pages to utilize a new LegalDocument component for improved structure and maintainability.
- Enhanced localization files to include legal content in both German and English, ensuring accurate representation of legal information.
- Improved i18n handling to support locale detection from Accept-Language headers.
2026-07-22 19:18:28 +02:00

113 lines
3.9 KiB
PHP

<?php
declare(strict_types=1);
require __DIR__ . '/includes/bootstrap.php';
require __DIR__ . '/includes/layout.php';
$locale = detect_locale();
$messages = load_messages($locale);
$inviteUrl = bot_invite_url($config);
$dashboardUrl = rtrim((string) $config['dashboard_url'], '/');
$loginUrl = $dashboardUrl . '/login';
$supportUrl = isset($config['support_url']) && $config['support_url'] !== ''
? (string) $config['support_url']
: null;
$guildCount = 0;
$userCount = 0;
$statsApi = (string) ($config['stats_api_url'] ?? '');
if ($statsApi !== '') {
$ctx = stream_context_create([
'http' => [
'timeout' => 3,
'header' => "Accept: application/json\r\n",
],
]);
$raw = @file_get_contents($statsApi, false, $ctx);
if ($raw !== false) {
$json = json_decode($raw, true);
if (is_array($json)) {
$guildCount = (int) ($json['guildCount'] ?? 0);
$userCount = (int) ($json['approximateUserCount'] ?? 0);
}
}
}
$numberLocale = $locale === 'de' ? 'de_DE' : 'en_US';
$formatNumber = static function (int $value) use ($numberLocale): string {
if (class_exists(NumberFormatter::class)) {
$formatter = new NumberFormatter($numberLocale, NumberFormatter::DECIMAL);
$formatted = $formatter->format($value);
if ($formatted !== false) {
return $formatted;
}
}
return number_format($value, 0, $locale === 'de' ? ',' : '.', $locale === 'de' ? '.' : ',');
};
/** @var array<string, array{label: string, modules: list<array{label: string, description: string}>}> $groups */
$groups = $messages['module_groups'];
render_header(
$config,
$messages,
$locale,
'Nexumi',
t($messages, 'meta.description')
);
?>
<section class="border-b">
<div class="container hero">
<div class="hero-brand">
<img src="assets/nexumi-logo.svg" alt="" width="48" height="48">
<h1>Nexumi</h1>
</div>
<p><?= h(t($messages, 'landing.subtitle')) ?></p>
<div class="actions">
<a class="btn btn-lg btn-primary" href="<?= h($inviteUrl) ?>" target="_blank" rel="noreferrer"><?= h(t($messages, 'landing.invite')) ?></a>
<a class="btn btn-lg btn-secondary" href="<?= h($loginUrl) ?>"><?= h(t($messages, 'landing.login')) ?></a>
<?php if ($supportUrl): ?>
<a class="btn btn-lg btn-outline" href="<?= h($supportUrl) ?>" target="_blank" rel="noreferrer"><?= h(t($messages, 'landing.support')) ?></a>
<?php endif; ?>
</div>
</div>
</section>
<section class="border-b">
<div class="container stats">
<div class="card">
<p class="card-label"><?= h(t($messages, 'landing.stats_guilds')) ?></p>
<p class="card-value"><?= h($formatNumber($guildCount)) ?></p>
</div>
<div class="card">
<p class="card-label"><?= h(t($messages, 'landing.stats_users')) ?></p>
<p class="card-value"><?= h($formatNumber($userCount)) ?></p>
</div>
</div>
</section>
<section>
<div class="container features">
<div class="intro">
<h2><?= h(t($messages, 'landing.features_title')) ?></h2>
<p><?= h(t($messages, 'landing.features_subtitle')) ?></p>
</div>
<?php foreach ($groups as $group): ?>
<div class="group">
<h3><?= h($group['label']) ?></h3>
<div class="grid">
<?php foreach ($group['modules'] as $module): ?>
<div class="card">
<p class="module-title"><?= h($module['label']) ?></p>
<p class="module-desc"><?= h($module['description']) ?></p>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endforeach; ?>
</div>
</section>
<?php
render_footer($config, $messages);