Admin unavailable

FLIXCOOKS_ADMIN_KEY is not configured.

FlixCooks Admin Login

Admin

Enter your password to manage recipes.

$r) { if (($r['slug'] ?? '') === $slugEdit) { $editing = $r; $editIndex = $idx; $editingEn = $r['i18n']['en'] ?? []; $editingDe = $r['i18n']['de'] ?? []; break; } } } if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['action'] ?? '') === 'save_settings') { if (!hash_equals($_SESSION['csrf_token'] ?? '', $_POST['token'] ?? '')) { $errors[] = 'Invalid form token, please retry.'; } else { $imprint = $siteSettings['imprint']; $privacy = $siteSettings['privacy']; $imprint['de']['owner_name'] = trim($_POST['owner_name_de'] ?? $imprint['de']['owner_name']); $imprint['en']['owner_name'] = trim($_POST['owner_name_en'] ?? $imprint['en']['owner_name']); $imprint['de']['address'] = trim($_POST['address_de'] ?? $imprint['de']['address']); $imprint['en']['address'] = trim($_POST['address_en'] ?? $imprint['en']['address']); $imprint['de']['email'] = trim($_POST['email_de'] ?? $imprint['de']['email']); $imprint['en']['email'] = trim($_POST['email_en'] ?? $imprint['en']['email']); $imprint['de']['phone'] = trim($_POST['phone_de'] ?? $imprint['de']['phone']); $imprint['en']['phone'] = trim($_POST['phone_en'] ?? $imprint['en']['phone']); $imprint['de']['legal_form'] = trim($_POST['legal_form_de'] ?? $imprint['de']['legal_form']); $imprint['en']['legal_form'] = trim($_POST['legal_form_en'] ?? $imprint['en']['legal_form']); $imprint['de']['business_purpose'] = trim($_POST['business_purpose_de'] ?? $imprint['de']['business_purpose']); $imprint['en']['business_purpose'] = trim($_POST['business_purpose_en'] ?? $imprint['en']['business_purpose']); $imprint['de']['wko_membership'] = trim($_POST['wko_de'] ?? $imprint['de']['wko_membership']); $imprint['en']['wko_membership'] = trim($_POST['wko_en'] ?? $imprint['en']['wko_membership']); $imprint['de']['authority'] = trim($_POST['authority_de'] ?? $imprint['de']['authority']); $imprint['en']['authority'] = trim($_POST['authority_en'] ?? $imprint['en']['authority']); $imprint['de']['uid'] = trim($_POST['uid_de'] ?? $imprint['de']['uid']); $imprint['en']['uid'] = trim($_POST['uid_en'] ?? $imprint['en']['uid']); $imprint['de']['odr'] = trim($_POST['odr_link'] ?? $imprint['de']['odr']); $imprint['en']['odr'] = $imprint['de']['odr']; $imprint['de']['last_updated'] = date('Y-m-d'); $imprint['en']['last_updated'] = date('Y-m-d'); $privacy['de']['controller'] = trim($_POST['controller_de'] ?? $privacy['de']['controller']); $privacy['en']['controller'] = trim($_POST['controller_en'] ?? $privacy['en']['controller']); $privacy['de']['address'] = trim($_POST['privacy_address_de'] ?? $privacy['de']['address']); $privacy['en']['address'] = trim($_POST['privacy_address_en'] ?? $privacy['en']['address']); $privacy['de']['contact_email'] = trim($_POST['privacy_email_de'] ?? $privacy['de']['contact_email']); $privacy['en']['contact_email'] = trim($_POST['privacy_email_en'] ?? $privacy['en']['contact_email']); $privacy['de']['contact_phone'] = trim($_POST['privacy_phone_de'] ?? $privacy['de']['contact_phone']); $privacy['en']['contact_phone'] = trim($_POST['privacy_phone_en'] ?? $privacy['en']['contact_phone']); $privacy['de']['hosting_provider'] = trim($_POST['hosting_de'] ?? $privacy['de']['hosting_provider']); $privacy['en']['hosting_provider'] = trim($_POST['hosting_en'] ?? $privacy['en']['hosting_provider']); $privacy['de']['cookie_statement'] = trim($_POST['cookie_de'] ?? $privacy['de']['cookie_statement']); $privacy['en']['cookie_statement'] = trim($_POST['cookie_en'] ?? $privacy['en']['cookie_statement']); $privacy['de']['purposes'] = trim($_POST['purposes_de'] ?? $privacy['de']['purposes']); $privacy['en']['purposes'] = trim($_POST['purposes_en'] ?? $privacy['en']['purposes']); $privacy['de']['log_retention_days'] = (int) ($_POST['log_retention'] ?? $privacy['de']['log_retention_days']); $privacy['en']['log_retention_days'] = $privacy['de']['log_retention_days']; $privacy['de']['last_updated'] = date('Y-m-d'); $privacy['en']['last_updated'] = date('Y-m-d'); // Require core fields $requiredPairs = [ ['imprint', 'owner_name', 'Owner name'], ['imprint', 'address', 'Address'], ['imprint', 'email', 'Email'], ['imprint', 'phone', 'Phone'], ['imprint', 'business_purpose', 'Business purpose'], ['privacy', 'controller', 'Controller'], ['privacy', 'contact_email', 'Privacy email'], ['privacy', 'contact_phone', 'Privacy phone'], ['privacy', 'hosting_provider', 'Hosting provider'], ['privacy', 'cookie_statement', 'Cookie statement'], ]; foreach ($requiredPairs as [$section, $key, $label]) { $deVal = ${$section}['de'][$key] ?? ''; $enVal = ${$section}['en'][$key] ?? ''; if ($deVal === '' && $enVal !== '') { ${$section}['de'][$key] = $enVal; } elseif ($enVal === '' && $deVal !== '') { ${$section}['en'][$key] = $deVal; } elseif ($deVal === '' && $enVal === '') { $errors[] = $label . ' is required (DE or EN).'; } } if (empty($errors)) { $siteSettings['imprint'] = $imprint; $siteSettings['privacy'] = $privacy; if (save_site_settings($siteSettings)) { $siteSettings = load_site_settings(true); $message = 'Settings saved.'; } else { $errors[] = 'Could not save settings. Check the database connection.'; } } } } if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['action'] ?? '') === 'delete') { if (!hash_equals($_SESSION['csrf_token'] ?? '', $_POST['token'] ?? '')) { $errors[] = 'Invalid form token, please retry.'; } else { $slugDel = trim($_POST['slug'] ?? ''); if ($slugDel !== '' && delete_recipe($slugDel)) { $message = 'Recipe deleted.'; $allRecipes = load_recipes(); } else { $message = 'Could not delete recipe.'; } $editing = null; $editIndex = null; } } elseif ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['action'] ?? '') === 'save') { if (!hash_equals($_SESSION['csrf_token'] ?? '', $_POST['token'] ?? '')) { $errors[] = 'Invalid form token, please retry.'; } else { // helpers $parse_csv = fn($text) => array_values(array_filter(array_map('trim', explode(',', $text ?? '')), 'strlen')); $parse_lines = fn($text) => array_values(array_filter(array_map('trim', preg_split('/\\r?\\n/', $text ?? '')), 'strlen')); $parse_lines_exact = fn($text) => array_map('trim', preg_split('/\\r?\\n/', $text ?? '')); $titleEn = trim($_POST['title_en'] ?? ''); $titleDe = trim($_POST['title_de'] ?? ''); $descriptionEn = trim($_POST['description_en'] ?? ''); $descriptionDe = trim($_POST['description_de'] ?? ''); $hero = trim($_POST['hero'] ?? ''); $categoryEn = trim($_POST['category_en'] ?? ''); $categoryDe = trim($_POST['category_de'] ?? ''); $tagsEn = $parse_csv($_POST['tags_en'] ?? ''); $tagsDe = $parse_csv($_POST['tags_de'] ?? ''); $prep = (int) ($_POST['prep_time'] ?? 0); $cook = (int) ($_POST['cook_time'] ?? 0); $total = (int) ($_POST['total_time'] ?? ($prep + $cook)); $servings = (int) ($_POST['servings'] ?? 0); $difficultyEn = trim($_POST['difficulty_en'] ?? 'Easy'); $difficultyDe = trim($_POST['difficulty_de'] ?? 'Einfach'); $ingredientsEn = $parse_lines($_POST['ingredients_en'] ?? ''); $ingredientsDe = $parse_lines($_POST['ingredients_de'] ?? ''); $utensilsEn = $parse_lines($_POST['utensils_en'] ?? ''); $utensilsDe = $parse_lines($_POST['utensils_de'] ?? ''); $stepsEn = $parse_lines($_POST['steps_en'] ?? ''); $stepsDe = $parse_lines($_POST['steps_de'] ?? ''); $stepVideosEn = $parse_lines_exact($_POST['step_videos_en'] ?? ''); $stepVideosDe = $parse_lines_exact($_POST['step_videos_de'] ?? ''); $stepTimersEn = $parse_lines_exact($_POST['step_timers_en'] ?? ''); $stepTimersDe = $parse_lines_exact($_POST['step_timers_de'] ?? ''); $featured = isset($_POST['featured']) && $_POST['featured'] === '1'; $comingSoon = isset($_POST['coming_soon']) && $_POST['coming_soon'] === '1'; $slugOriginal = trim($_POST['slug_original'] ?? ''); $nutriCal = (int) ($_POST['nutrition_calories'] ?? 0); $nutriProt = (int) ($_POST['nutrition_protein'] ?? 0); $nutriCarb = (int) ($_POST['nutrition_carbs'] ?? 0); $nutriFat = (int) ($_POST['nutrition_fat'] ?? 0); // keep previous language data if fields left blank while editing $prevEn = $editing['i18n']['en'] ?? []; $prevDe = $editing['i18n']['de'] ?? []; $titleEn = $titleEn !== '' ? $titleEn : ($prevEn['title'] ?? ''); $titleDe = $titleDe !== '' ? $titleDe : ($prevDe['title'] ?? ''); $descriptionEn = $descriptionEn !== '' ? $descriptionEn : ($prevEn['description'] ?? ''); $descriptionDe = $descriptionDe !== '' ? $descriptionDe : ($prevDe['description'] ?? ''); $categoryEn = $categoryEn !== '' ? $categoryEn : ($prevEn['category'] ?? ''); $categoryDe = $categoryDe !== '' ? $categoryDe : ($prevDe['category'] ?? ''); $difficultyEn = $difficultyEn !== '' ? $difficultyEn : ($prevEn['difficulty'] ?? 'Easy'); $difficultyDe = $difficultyDe !== '' ? $difficultyDe : ($prevDe['difficulty'] ?? 'Einfach'); $tagsEn = !empty($tagsEn) ? $tagsEn : ($prevEn['tags'] ?? []); $tagsDe = !empty($tagsDe) ? $tagsDe : ($prevDe['tags'] ?? []); $ingredientsEn = !empty($ingredientsEn) ? $ingredientsEn : ($prevEn['ingredients'] ?? []); $ingredientsDe = !empty($ingredientsDe) ? $ingredientsDe : ($prevDe['ingredients'] ?? []); $utensilsEn = !empty($utensilsEn) ? $utensilsEn : ($prevEn['utensils'] ?? []); $utensilsDe = !empty($utensilsDe) ? $utensilsDe : ($prevDe['utensils'] ?? []); $stepsEn = !empty($stepsEn) ? $stepsEn : ($prevEn['steps'] ?? []); $stepsDe = !empty($stepsDe) ? $stepsDe : ($prevDe['steps'] ?? []); $stepVideosEn = !empty($stepVideosEn) ? $stepVideosEn : ($prevEn['step_videos'] ?? []); $stepVideosDe = !empty($stepVideosDe) ? $stepVideosDe : ($prevDe['step_videos'] ?? []); $stepTimersEn = !empty($stepTimersEn) ? $stepTimersEn : ($prevEn['step_timers'] ?? []); $stepTimersDe = !empty($stepTimersDe) ? $stepTimersDe : ($prevDe['step_timers'] ?? []); if ($titleEn === '') { $message = 'English title is required.'; } elseif (!$comingSoon && (empty($ingredientsEn) || empty($stepsEn))) { $message = 'Ingredients and steps are required unless marked coming soon.'; } else { // determine slug if ($slugOriginal) { $slug = $slugOriginal; } else { $slug = slugify($titleEn ?: $titleDe); // ensure unique slug $existingSlugs = array_map(fn($r) => $r['slug'] ?? '', $allRecipes); $base = $slug; $i = 1; while (in_array($slug, $existingSlugs, true)) { $slug = $base . '-' . $i; $i++; } } $record = [ 'slug' => $slug, 'hero' => $hero, 'prep_time' => $prep, 'cook_time' => $cook, 'total_time' => $total, 'servings' => $servings, 'featured' => $featured, 'coming_soon' => $comingSoon, 'nutrition' => [ 'calories' => $nutriCal, 'protein' => $nutriProt, 'carbs' => $nutriCarb, 'fat' => $nutriFat ], 'i18n' => [ 'en' => [ 'title' => $titleEn, 'description' => $descriptionEn, 'category' => $categoryEn, 'difficulty' => $difficultyEn, 'tags' => $tagsEn, 'ingredients' => $ingredientsEn, 'utensils' => $utensilsEn, 'steps' => $stepsEn, 'step_videos' => $stepVideosEn, 'step_timers' => $stepTimersEn, ], 'de' => [ 'title' => $titleDe ?: $titleEn, 'description' => $descriptionDe ?: $descriptionEn, 'category' => $categoryDe ?: $categoryEn, 'difficulty' => $difficultyDe, 'tags' => !empty($tagsDe) ? $tagsDe : $tagsEn, 'ingredients' => !empty($ingredientsDe) ? $ingredientsDe : $ingredientsEn, 'utensils' => !empty($utensilsDe) ? $utensilsDe : $utensilsEn, 'steps' => !empty($stepsDe) ? $stepsDe : $stepsEn, 'step_videos' => !empty($stepVideosDe) ? $stepVideosDe : $stepVideosEn, 'step_timers' => !empty($stepTimersDe) ? $stepTimersDe : $stepTimersEn, ], ], ]; if ($slugOriginal && $slugOriginal !== $slug) { delete_recipe($slugOriginal); } if (save_recipe($record)) { $message = $slugOriginal ? 'Saved changes.' : 'Saved! New recipe added.'; $allRecipes = load_recipes(); } else { $message = 'Could not save to database.'; } } } // end CSRF else } ?> FlixCooks Admin

FlixCooks Admin

View site Back

Imprint (DE)


Imprint (EN)


Privacy (DE)


Privacy (EN)

Existing recipes ()

No recipes yet.

Featured Coming soon
Edit

Accepts full URLs or relative paths (e.g. /assets/images/hero.jpg).


English


Deutsch