| Server IP : 188.114.96.3 / Your IP : 216.73.216.143 Web Server : Apache System : Linux sv058.home.net.pl 6.8.2 husak_dirty_pages_fix #1 SMP PREEMPT_DYNAMIC Tue Apr 2 22:06:51 CEST 2024 x86_64 User : ( 3194769) PHP Version : 8.5.12 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /polana/admin/ |
Upload File : |
<?php
declare(strict_types=1);
require_once dirname(__DIR__) . '/includes/functions.php';
require_login();
$keys = [
'site_public_mode',
'site_splash_badge', 'site_splash_title', 'site_splash_text',
'site_splash_note', 'site_splash_button_label', 'site_splash_button_url',
'site_splash_robots',
'menu_view_mode',
'menu_seo_title', 'menu_seo_description', 'menu_seo_intro',
'menu_splash_badge', 'menu_splash_title', 'menu_splash_text',
'menu_splash_note', 'menu_splash_button_label', 'menu_splash_button_url',
'menu_splash_robots',
'default_og_image', 'twitter_card_type',
'google_verification', 'facebook_app_id',
'og_title_override', 'og_description_override',
];
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
verify_csrf();
$stmt = db()->prepare(
'INSERT INTO settings (setting_key, setting_value)
VALUES (?, ?)
ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value)'
);
foreach ($keys as $key) {
$value = trim((string)($_POST[$key] ?? ''));
$stmt->execute([$key, $value]);
}
admin_log('seo_update', 'Zmieniono ustawienia SEO i zaślepki strony');
flash('success', 'Ustawienia SEO i zaślepki zostały zapisane.');
redirect('/admin/seo.php');
}
$defaults = [
'site_public_mode' => 'normal',
'site_splash_badge' => 'Moja Polana Smaków',
'site_splash_title' => 'Do zobaczenia wkrótce',
'site_splash_text' => 'Na Polanie trwa krótka przerwa. Gotujemy, układamy kolejne smaki i już niedługo znów zaprosimy Was do stołu.',
'site_splash_note' => 'Zajrzyj ponownie za chwilę — nowa karta i aktualne informacje pojawią się tutaj.',
'site_splash_button_label' => 'Kontakt',
'site_splash_button_url' => '/kontakt',
'site_splash_robots' => 'noindex,follow',
'menu_view_mode' => 'auto',
'menu_seo_title' => 'Menu | Moja Polana Smaków – Andrzej Polan',
'menu_seo_description' => 'Aktualne menu restauracji Moja Polana Smaków Andrzeja Polana. Sezonowa karta, polskie smaki i autorska kuchnia.',
'menu_seo_intro' => 'Aktualne menu restauracji Moja Polana Smaków.',
'menu_splash_badge' => 'Do zobaczenia wkrótce',
'menu_splash_title' => 'Dziś nie serwujemy menu online',
'menu_splash_text' => 'Menu jest chwilowo niedostępne albo restauracja ma przerwę. Zapraszamy ponownie wkrótce.',
'menu_splash_note' => 'W sprawie rezerwacji lub aktualnych informacji skontaktuj się z nami bezpośrednio.',
'menu_splash_button_label' => 'Kontakt',
'menu_splash_button_url' => '/kontakt',
'menu_splash_robots' => 'noindex,follow',
'twitter_card_type' => 'summary_large_image',
];
$values = [];
foreach ($keys as $key) {
$values[$key] = setting($key, $defaults[$key] ?? '');
}
render_admin_header('SEO i zaślepka');
?>
<!-- PIN77_SEO_LINK --><div class="form-card" style="margin:12px 0;padding:12px 18px"><strong>IndexNow / Bing:</strong> <a href="/admin/polana-indexnow.php">Kolejka zgłoszeń, mapa witryny i automatyzacja →</a></div>
<div class="admin-title-row">
<div>
<h1>SEO i zaślepka</h1>
<p>Ustaw tu globalną zaślepkę całej strony, tryb menu i dane SEO.</p>
</div>
</div>
<form class="form-card form-grid seo-form" method="post">
<?= csrf_field() ?>
<div class="full admin-section-title">
<h2>Globalna zaślepka całej strony</h2>
<p>Jak w WordPressie: niezalogowani goście widzą zaślepkę na całej stronie, a zalogowany użytkownik nadal widzi pełną stronę i może ją testować.</p>
</div>
<label class="full">
Tryb strony publicznej
<select name="site_public_mode">
<option value="normal" <?= $values['site_public_mode'] === 'normal' ? 'selected' : '' ?>>Normalnie – strona działa</option>
<option value="splash" <?= $values['site_public_mode'] === 'splash' ? 'selected' : '' ?>>Zaślepka dla gości – zalogowani widzą stronę</option>
</select>
</label>
<label>
Robots dla globalnej zaślepki
<select name="site_splash_robots">
<option value="noindex,follow" <?= $values['site_splash_robots'] === 'noindex,follow' ? 'selected' : '' ?>>noindex,follow</option>
<option value="index,follow" <?= $values['site_splash_robots'] === 'index,follow' ? 'selected' : '' ?>>index,follow</option>
</select>
</label>
<label>
Mały napis nad tytułem
<input name="site_splash_badge" value="<?= e($values['site_splash_badge']) ?>">
</label>
<label class="full">
Główny tytuł zaślepki
<input name="site_splash_title" value="<?= e($values['site_splash_title']) ?>">
</label>
<label class="full">
Główna treść
<textarea name="site_splash_text" rows="4"><?= e($values['site_splash_text']) ?></textarea>
</label>
<label class="full">
Dodatkowa notka
<textarea name="site_splash_note" rows="3"><?= e($values['site_splash_note']) ?></textarea>
</label>
<label>
Tekst przycisku
<input name="site_splash_button_label" value="<?= e($values['site_splash_button_label']) ?>">
</label>
<label class="full">
Link przycisku
<input name="site_splash_button_url" value="<?= e($values['site_splash_button_url']) ?>" placeholder="/kontakt lub https://...">
</label>
<div class="full admin-section-title">
<h2>Tryb menu / QR</h2>
<p>Gdy globalna zaślepka jest wyłączona, tu decydujesz co ma pokazywać /menu.</p>
</div>
<label class="full">
Tryb wyświetlania /menu
<select name="menu_view_mode">
<option value="auto" <?= $values['menu_view_mode'] === 'auto' ? 'selected' : '' ?>>Automatycznie: aktywne menu / graficzna karta</option>
<option value="placeholder" <?= $values['menu_view_mode'] === 'placeholder' ? 'selected' : '' ?>>Pokaż tymczasową kartę / zaślepkę menu</option>
<option value="splash" <?= $values['menu_view_mode'] === 'splash' ? 'selected' : '' ?>>Pokaż stronę przerwy tylko dla menu</option>
</select>
</label>
<label>
Robots dla zaślepki menu
<select name="menu_splash_robots">
<option value="noindex,follow" <?= $values['menu_splash_robots'] === 'noindex,follow' ? 'selected' : '' ?>>noindex,follow</option>
<option value="index,follow" <?= $values['menu_splash_robots'] === 'index,follow' ? 'selected' : '' ?>>index,follow</option>
</select>
</label>
<div class="full admin-section-title">
<h2>Treść zaślepki tylko dla menu</h2>
</div>
<label>
Mały napis nad tytułem
<input name="menu_splash_badge" value="<?= e($values['menu_splash_badge']) ?>">
</label>
<label class="full">
Główny tytuł zaślepki menu
<input name="menu_splash_title" value="<?= e($values['menu_splash_title']) ?>">
</label>
<label class="full">
Główna treść
<textarea name="menu_splash_text" rows="4"><?= e($values['menu_splash_text']) ?></textarea>
</label>
<label class="full">
Dodatkowa informacja / notka
<textarea name="menu_splash_note" rows="3"><?= e($values['menu_splash_note']) ?></textarea>
</label>
<label>
Tekst przycisku
<input name="menu_splash_button_label" value="<?= e($values['menu_splash_button_label']) ?>">
</label>
<label class="full">
Link przycisku
<input name="menu_splash_button_url" value="<?= e($values['menu_splash_button_url']) ?>" placeholder="/kontakt lub https://...">
</label>
<div class="full admin-section-title">
<h2>SEO menu</h2>
<p>Dotyczy strony tekstowej /menu-seo, która pracuje pod Google.</p>
</div>
<label class="full">
SEO title menu
<input name="menu_seo_title" value="<?= e($values['menu_seo_title']) ?>">
</label>
<label class="full">
SEO description menu
<textarea name="menu_seo_description" rows="4" maxlength="320"><?= e($values['menu_seo_description']) ?></textarea>
</label>
<label class="full">
Wstęp na stronie /menu-seo
<textarea name="menu_seo_intro" rows="4"><?= e($values['menu_seo_intro']) ?></textarea>
</label>
<div class="full admin-section-title">
<h2>Open Graph / social / weryfikacje</h2>
<p>Opcjonalne pola do udostępnień i narzędzi webmastera.</p>
</div>
<label class="full">
Domyślny obraz Open Graph (pełny URL)
<input type="url" name="default_og_image" value="<?= e($values['default_og_image']) ?>" placeholder="https://polanasmakow.pl/assets/img/logo.png">
</label>
<label class="full">
Nadpisanie OG title – opcjonalnie
<input name="og_title_override" value="<?= e($values['og_title_override']) ?>">
</label>
<label class="full">
Nadpisanie OG description – opcjonalnie
<textarea name="og_description_override" rows="3"><?= e($values['og_description_override']) ?></textarea>
</label>
<label>
Twitter Card
<select name="twitter_card_type">
<option value="summary_large_image" <?= $values['twitter_card_type'] === 'summary_large_image' ? 'selected' : '' ?>>summary_large_image</option>
<option value="summary" <?= $values['twitter_card_type'] === 'summary' ? 'selected' : '' ?>>summary</option>
</select>
</label>
<label class="full">
Google site verification
<input name="google_verification" value="<?= e($values['google_verification']) ?>">
</label>
<label class="full">
Facebook App ID
<input name="facebook_app_id" value="<?= e($values['facebook_app_id']) ?>">
</label>
<div class="full">
<button class="btn btn-primary" type="submit">Zapisz ustawienia</button>
</div>
</form>
<?php render_admin_footer(); ?>